[ Index ] |
|
Code source de Symfony 1.0.0 |
1 <?php 2 3 /* 4 * $Id: PgsqlDataSQLBuilder.php 497 2006-01-22 13:07:47Z fabien $ 5 * 6 * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS 7 * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 8 * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR 9 * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT 10 * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, 11 * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT 12 * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, 13 * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY 14 * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 15 * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE 16 * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 17 * 18 * This software consists of voluntary contributions made by many individuals 19 * and is licensed under the LGPL. For more information please see 20 * <http://propel.phpdb.org>. 21 */ 22 23 require_once 'propel/engine/builder/sql/DataSQLBuilder.php'; 24 25 /** 26 * PostgreSQL class for building data dump SQL. 27 * 28 * @author Hans Lellelid <hans@xmpl.org> 29 * @package propel.engine.builder.sql.pgsql 30 */ 31 class PgsqlDataSQLBuilder extends DataSQLBuilder { 32 33 /** 34 * Get SQL value to insert for Postgres BOOLEAN column. 35 * @param boolean $value 36 * @return string The representation of boolean for Postgres ('t' or 'f'). 37 */ 38 protected function getBooleanSql($value) 39 { 40 return ($value ? "'t'" : "'f'"); 41 } 42 43 /** 44 * 45 * @param mixed $blob Blob object or string containing data. 46 * @return string 47 */ 48 protected function getBlobSql($blob) 49 { 50 // they took magic __toString() out of PHP5.0.0; this sucks 51 if (is_object($blob)) { 52 $blob = $blob->__toString(); 53 } 54 return "'" . pg_escape_bytea($blob) . "'"; 55 } 56 57 }
titre
Description
Corps
titre
Description
Corps
titre
Description
Corps
titre
Corps
Généré le : Fri Mar 16 22:42:14 2007 | par Balluche grâce à PHPXref 0.7 |