idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
3,600 | public function modifyTable ( ) { if ( ! $ this -> getTable ( ) -> containsColumn ( $ this -> getParameter ( 'deleted_column' ) ) ) { $ this -> getTable ( ) -> addColumn ( array ( 'name' => $ this -> getParameter ( 'deleted_column' ) , 'type' => 'TIMESTAMP' ) ) ; } } | Add the deleted_column to the current table |
3,601 | public function setOutputDirectory ( PhingFile $ out ) { if ( ! $ out -> exists ( ) ) { $ out -> mkdirs ( ) ; } $ this -> outDir = $ out ; } | Set the sqldbmap . |
3,602 | public function initConnection ( PDO $ con , array $ settings ) { $ con -> exec ( "ALTER SESSION SET NLS_DATE_FORMAT='YYYY-MM-DD'" ) ; $ con -> exec ( "ALTER SESSION SET NLS_TIMESTAMP_FORMAT='YYYY-MM-DD HH24:MI:SS'" ) ; if ( isset ( $ settings [ 'queries' ] ) && is_array ( $ settings [ 'queries' ] ) ) { foreach ( $ set... | This method is called after a connection was created to run necessary post - initialization queries or code . Removes the charset query and adds the date queries |
3,603 | public function setBuildProperties ( $ props ) { $ this -> buildProperties = array ( ) ; $ renamedPropelProps = array ( ) ; foreach ( $ props as $ key => $ propValue ) { if ( strpos ( $ key , "propel." ) === 0 ) { $ newKey = substr ( $ key , strlen ( "propel." ) ) ; $ j = strpos ( $ newKey , '.' ) ; while ( $ j !== fal... | Parses the passed - in properties renaming and saving eligible properties in this object . |
3,604 | public function getClassname ( $ propname ) { $ classpath = $ this -> getBuildProperty ( $ propname ) ; if ( null === $ classpath ) { throw new BuildException ( "Unable to find class path for '$propname' property." ) ; } $ lastdotpos = strrpos ( $ classpath , '.' ) ; if ( $ lastdotpos !== false ) { $ classpath { $ last... | Resolves and returns the class name based on the specified property value . |
3,605 | public function getConfiguredPlatform ( PDO $ con = null , $ database = null ) { $ buildConnection = $ this -> getBuildConnection ( $ database ) ; if ( $ this -> getBuildProperty ( 'platformClass' ) ) { $ clazz = $ this -> getClassname ( 'platformClass' ) ; } elseif ( null !== $ buildConnection [ 'adapter' ] ) { $ claz... | Creates and configures a new Platform class . |
3,606 | public function getConfiguredSchemaParser ( PDO $ con = null ) { $ clazz = $ this -> getClassname ( "reverseParserClass" ) ; $ parser = new $ clazz ( ) ; if ( ! $ parser instanceof SchemaParser ) { throw new BuildException ( "Specified platform class ($clazz) does implement SchemaParser interface." , $ this -> getLocat... | Creates and configures a new SchemaParser class for specified platform . |
3,607 | public function getConfiguredBehavior ( $ name ) { $ propname = 'behavior' . ucfirst ( strtolower ( $ name ) ) . 'Class' ; try { $ ret = $ this -> getClassname ( $ propname ) ; } catch ( BuildException $ e ) { $ ret = false ; } return $ ret ; } | Gets a configured behavior class |
3,608 | protected function addColumnAttributes ( & $ script ) { $ table = $ this -> getTable ( ) ; foreach ( $ table -> getColumns ( ) as $ col ) { $ this -> addColumnAttributeComment ( $ script , $ col ) ; $ this -> addColumnAttributeDeclaration ( $ script , $ col ) ; if ( $ col -> isLazyLoad ( ) ) { $ this -> addColumnAttrib... | Adds variables that store column values . |
3,609 | protected function addColumnAttributeDeclaration ( & $ script , Column $ col ) { $ clo = strtolower ( $ col -> getName ( ) ) ; $ script .= " protected \$" . $ clo . ";" ; } | Adds the declaration of a column value storage attribute |
3,610 | protected function addColumnAttributeLoaderDeclaration ( & $ script , Column $ col ) { $ clo = strtolower ( $ col -> getName ( ) ) ; $ script .= " protected \$" . $ clo . "_isLoaded = false;" ; } | Adds the declaration of the attribute keeping track of an attribute s loaded state |
3,611 | protected function addColumnAttributeUnserializedDeclaration ( & $ script , Column $ col ) { $ clo = strtolower ( $ col -> getName ( ) ) . "_unserialized" ; $ script .= " protected \$" . $ clo . ";" ; } | Adds the declaration of the serialized attribute |
3,612 | protected function addApplyDefaultValuesBody ( & $ script ) { $ table = $ this -> getTable ( ) ; $ colsWithDefaults = array ( ) ; foreach ( $ table -> getColumns ( ) as $ col ) { $ def = $ col -> getDefaultValue ( ) ; if ( $ def !== null && ! $ def -> isExpression ( ) ) { $ colsWithDefaults [ ] = $ col ; } } $ colconst... | Adds the function body of the applyDefault method |
3,613 | public function addTemporalAccessorComment ( & $ script , Column $ col ) { $ clo = strtolower ( $ col -> getName ( ) ) ; $ useDateTime = $ this -> getBuildProperty ( 'useDateTimeClass' ) ; $ dateTimeClass = $ this -> getBuildProperty ( 'dateTimeClass' ) ; if ( ! $ dateTimeClass ) { $ dateTimeClass = 'DateTime' ; } $ ha... | Adds the comment for a temporal accessor |
3,614 | public function addTemporalAccessorOpen ( & $ script , Column $ col ) { $ cfc = $ col -> getPhpName ( ) ; $ defaultfmt = null ; $ visibility = $ col -> getAccessorVisibility ( ) ; if ( $ col -> getType ( ) === PropelTypes :: DATE ) { $ defaultfmt = $ this -> getBuildProperty ( 'defaultDateFormat' ) ; } elseif ( $ col -... | Adds the function declaration for a temporal accessor |
3,615 | protected function addTemporalAccessorBody ( & $ script , Column $ col ) { $ cfc = $ col -> getPhpName ( ) ; $ clo = strtolower ( $ col -> getName ( ) ) ; $ useDateTime = $ this -> getBuildProperty ( 'useDateTimeClass' ) ; $ dateTimeClass = $ this -> getBuildProperty ( 'dateTimeClass' ) ; if ( ! $ dateTimeClass ) { $ d... | Adds the body of the temporal accessor |
3,616 | protected function addObjectAccessorBody ( & $ script , Column $ col ) { $ cfc = $ col -> getPhpName ( ) ; $ clo = strtolower ( $ col -> getName ( ) ) ; $ cloUnserialized = $ clo . '_unserialized' ; if ( $ col -> isLazyLoad ( ) ) { $ script .= $ this -> getAccessorLazyLoadSnippet ( $ col ) ; } $ script .= " if (... | Adds the function body for an object accessor method |
3,617 | protected function addEnumAccessorBody ( & $ script , Column $ col ) { $ cfc = $ col -> getPhpName ( ) ; $ clo = strtolower ( $ col -> getName ( ) ) ; if ( $ col -> isLazyLoad ( ) ) { $ script .= $ this -> getAccessorLazyLoadSnippet ( $ col ) ; } $ script .= " if (null === \$this->$clo) { return null;... | Adds the function body for an enum accessor method |
3,618 | public function addDefaultAccessorOpen ( & $ script , Column $ col ) { $ cfc = $ col -> getPhpName ( ) ; $ visibility = $ col -> getAccessorVisibility ( ) ; $ script .= " " . $ visibility . " function get$cfc(" ; if ( $ col -> isLazyLoad ( ) ) { $ script .= "PropelPDO \$con = null" ; } $ script .= ") {" ; } | Adds the function declaration for a default accessor |
3,619 | protected function addDefaultAccessorBody ( & $ script , Column $ col ) { $ cfc = $ col -> getPhpName ( ) ; $ clo = strtolower ( $ col -> getName ( ) ) ; if ( $ col -> isLazyLoad ( ) ) { $ script .= $ this -> getAccessorLazyLoadSnippet ( $ col ) ; } $ script .= " return \$this->$clo;" ; } | Adds the function body for a default accessor method |
3,620 | protected function addLazyLoaderBody ( & $ script , Column $ col ) { $ platform = $ this -> getPlatform ( ) ; $ clo = strtolower ( $ col -> getName ( ) ) ; if ( $ col -> getType ( ) === PropelTypes :: BLOB && $ platform instanceof SqlsrvPlatform ) { $ script .= " \$c = \$this->buildPkeyCriteria(); \$c->ad... | Adds the function body for the lazy loader method |
3,621 | public function addMutatorComment ( & $ script , Column $ col ) { $ clo = strtolower ( $ col -> getName ( ) ) ; $ script .= " /** * Set the value of [$clo] column. * " . $ col -> getDescription ( ) . " * @param " . $ col -> getPhpType ( ) . " \$v new value * @return " . $ this -> getObjectClassname ... | Adds the comment for a mutator |
3,622 | public function addMutatorOpenOpen ( & $ script , Column $ col ) { $ cfc = $ col -> getPhpName ( ) ; $ visibility = $ col -> getMutatorVisibility ( ) ; $ script .= " " . $ visibility . " function set$cfc(\$v) {" ; } | Adds the mutator function declaration |
3,623 | protected function addMutatorOpenBody ( & $ script , Column $ col ) { $ clo = strtolower ( $ col -> getName ( ) ) ; $ cfc = $ col -> getPhpName ( ) ; if ( $ col -> isLazyLoad ( ) ) { $ script .= " // Allow unsetting the lazy loaded column even when its not loaded. if (!\$this->" . $ clo . "_isLoaded && \$... | Adds the mutator open body part |
3,624 | protected function addObjectMutator ( & $ script , Column $ col ) { $ clo = strtolower ( $ col -> getName ( ) ) ; $ cloUnserialized = $ clo . '_unserialized' ; $ this -> addMutatorOpen ( $ script , $ col ) ; $ script .= " if (\$this->$cloUnserialized !== \$v) { \$this->$cloUnserialized = \$v; ... | Adds a setter for Object columns . |
3,625 | protected function addBuildPkeyCriteria ( & $ script ) { $ this -> addBuildPkeyCriteriaComment ( $ script ) ; $ this -> addBuildPkeyCriteriaOpen ( $ script ) ; $ this -> addBuildPkeyCriteriaBody ( $ script ) ; $ this -> addBuildPkeyCriteriaClose ( $ script ) ; } | Adds the buildPkeyCriteria method |
3,626 | protected function addValidationMethods ( & $ script ) { $ this -> addValidationFailuresAttribute ( $ script ) ; $ this -> addGetValidationFailures ( $ script ) ; $ this -> addValidate ( $ script ) ; $ this -> addDoValidate ( $ script ) ; } | Adds the methods related to the validation of the object . |
3,627 | public static function computeDiff ( Database $ fromDatabase , Database $ toDatabase , $ caseInsensitive = false ) { $ dc = new self ( ) ; $ dc -> setFromDatabase ( $ fromDatabase ) ; $ dc -> setToDatabase ( $ toDatabase ) ; $ differences = 0 ; $ differences += $ dc -> compareTables ( $ caseInsensitive ) ; return ( $ d... | Compute and return the difference between two database objects |
3,628 | public function getConfig ( ) { if ( null === $ this -> config ) { require_once dirname ( __FILE__ ) . '/../config/QuickGeneratorConfig.php' ; $ this -> config = new QuickGeneratorConfig ( $ this -> getPlatform ( ) ) ; } return $ this -> config ; } | Getter for the config property |
3,629 | protected function getPdoConnection ( $ datasource ) { $ buildConnection = $ this -> getConnection ( $ datasource ) ; $ dsn = str_replace ( "@DB@" , $ datasource , $ buildConnection [ 'dsn' ] ) ; $ username = isset ( $ buildConnection [ 'user' ] ) && $ buildConnection [ 'user' ] ? $ buildConnection [ 'user' ] : null ; ... | Gets a PDO connection for a given datasource . |
3,630 | public function setDB ( DBAdapter $ v ) { $ this -> db = $ v ; foreach ( $ this -> clauses as $ clause ) { $ clause -> setDB ( $ v ) ; } } | Set the value of db . The DBAdapter might be used to get db specific variations of sql . |
3,631 | public function appendPsTo ( & $ sb , array & $ params ) { $ sb .= str_repeat ( '(' , count ( $ this -> clauses ) ) ; $ this -> dispatchPsHandling ( $ sb , $ params ) ; foreach ( $ this -> clauses as $ key => $ clause ) { $ sb .= $ this -> conjunctions [ $ key ] ; $ clause -> appendPsTo ( $ sb , $ params ) ; $ sb .= ')... | Appends a Prepared Statement representation of the Criterion onto the buffer . |
3,632 | protected function dispatchPsHandling ( & $ sb , array & $ params ) { switch ( $ this -> comparison ) { case Criteria :: CUSTOM : $ this -> appendCustomToPs ( $ sb , $ params ) ; break ; case Criteria :: RAW : $ this -> appendRawToPs ( $ sb , $ params ) ; break ; case Criteria :: IN : case Criteria :: NOT_IN : $ this -... | Figure out which Criterion method to use to build the prepared statement and parameters using to the Criterion comparison and call it to append the prepared statement and the parameters of the current clause |
3,633 | public function hashCode ( ) { $ h = crc32 ( serialize ( $ this -> value ) ) ^ crc32 ( $ this -> comparison ) ; if ( $ this -> table !== null ) { $ h ^= crc32 ( $ this -> table ) ; } if ( $ this -> column !== null ) { $ h ^= crc32 ( $ this -> column ) ; } foreach ( $ this -> clauses as $ clause ) { $ sb = '' ; $ params... | Returns a hash code value for the object . |
3,634 | public function getClasspath ( ) { if ( $ this -> getPackage ( ) ) { $ path = $ this -> getPackage ( ) . '.' . $ this -> getClassname ( ) ; } else { $ path = $ this -> getClassname ( ) ; } return $ path ; } | Gets the dot - path representation of current class being built . |
3,635 | protected function addConstructorBody ( & $ script ) { $ table = $ this -> getTable ( ) ; $ script .= " if (null === \$dbName) { \$dbName = '" . $ table -> getDatabase ( ) -> getName ( ) . "'; } if (null === \$modelName) { \$modelName = '" . addslashes ( $ this -> getNewStubOb... | Adds the function body for the constructor |
3,636 | protected function addJoinRelated ( & $ script , $ fkTable , $ queryClass , $ relationName , $ joinType ) { $ script .= " /** * Adds a JOIN clause to the query using the " . $ relationName . " relation * * @param string \$relationAlias optional alias for the relation * @param string \$joinTyp... | Adds a joinRelated method for this object . |
3,637 | protected function addUseRelatedQuery ( & $ script , $ fkTable , $ queryClass , $ relationName , $ joinType ) { $ script .= " /** * Use the $relationName relation " . $ fkTable -> getPhpName ( ) . " object * * @see useQuery() * * @param string \$relationAlias optional alias for the rela... | Adds a useRelatedQuery method for this object . |
3,638 | public function render ( $ vars = array ( ) ) { if ( null === $ this -> templateFile && null === $ this -> template ) { throw new InvalidArgumentException ( 'You must set a template or a template file before rendering' ) ; } extract ( $ vars ) ; ob_start ( ) ; ob_implicit_flush ( 0 ) ; try { if ( null !== $ this -> tem... | Render the template using the variable provided as arguments . |
3,639 | public function setForeignKey ( $ tableName , $ columnName ) { if ( $ tableName && $ columnName ) { $ this -> relatedTableName = $ tableName ; $ this -> relatedColumnName = $ columnName ; } else { $ this -> relatedTableName = "" ; $ this -> relatedColumnName = "" ; } } | Set the foreign key for this column . |
3,640 | public function getRelation ( ) { if ( ! $ this -> relatedTableName ) { return null ; } foreach ( $ this -> getTable ( ) -> getRelations ( ) as $ name => $ relation ) { if ( $ relation -> getType ( ) == RelationMap :: MANY_TO_ONE ) { if ( $ relation -> getForeignTable ( ) -> getName ( ) == $ this -> getRelatedTableName... | Get the RelationMap object for this foreign key |
3,641 | protected function addClassBody ( & $ script ) { $ table = $ this -> getTable ( ) ; if ( ! $ table -> isAlias ( ) ) { $ this -> addConstantsAndAttributes ( $ script ) ; } $ this -> addTranslateFieldName ( $ script ) ; $ this -> addGetFieldNames ( $ script ) ; if ( $ table -> hasEnumColumns ( ) ) { $ this -> addGetValue... | This method adds the contents of the generated class to the script . |
3,642 | public function getRetrieveMethodName ( ) { if ( $ this -> getTable ( ) -> isAlias ( ) ) { $ retrieveMethod = "retrieve" . $ this -> getTable ( ) -> getPhpName ( ) . "ByPK" ; } else { $ retrieveMethod = "retrieveByPK" ; } return $ retrieveMethod ; } | Returns the retrieveByPK method name to use for this table . If the table is an alias then the method name looks like retrieveTablenameByPK otherwise simply retrieveByPK . |
3,643 | public function getName ( ) { if ( $ this -> indexName === null ) { try { $ this -> createName ( ) ; } catch ( EngineException $ e ) { } } if ( $ database = $ this -> getTable ( ) -> getDatabase ( ) ) { return substr ( $ this -> indexName , 0 , $ database -> getPlatform ( ) -> getMaxColumnNameLength ( ) ) ; } else { re... | Gets the name of this index . |
3,644 | public function addColumn ( $ data ) { if ( $ data instanceof Column ) { $ column = $ data ; $ this -> indexColumns [ ] = $ column -> getName ( ) ; if ( $ column -> getSize ( ) ) { $ this -> indexColumnSizes [ $ column -> getName ( ) ] = $ column -> getSize ( ) ; } } else { $ attrib = $ data ; $ name = $ attrib [ "name... | Adds a new column to an index . |
3,645 | public function setColumns ( array $ indexColumns ) { $ this -> indexColumns = array ( ) ; $ this -> indexColumnSizes = array ( ) ; foreach ( $ indexColumns as $ col ) { $ this -> addColumn ( $ col ) ; } } | Sets array of columns to use for index . |
3,646 | public function getColumnSize ( $ name ) { if ( isset ( $ this -> indexColumnSizes [ $ name ] ) ) { return $ this -> indexColumnSizes [ $ name ] ; } return null ; } | Returns the size for the specified column if given . |
3,647 | public function hasColumnAtPosition ( $ pos , $ name , $ size = null , $ caseInsensitive = false ) { if ( ! isset ( $ this -> indexColumns [ $ pos ] ) ) { return false ; } $ test = $ caseInsensitive ? strtolower ( $ this -> indexColumns [ $ pos ] ) != strtolower ( $ name ) : $ this -> indexColumns [ $ pos ] != $ name ;... | Check whether this index has a given column at a given position |
3,648 | public static function makeList ( $ columns , PropelPlatformInterface $ platform ) { $ list = array ( ) ; foreach ( $ columns as $ col ) { if ( $ col instanceof Column ) { $ col = $ col -> getName ( ) ; } $ list [ ] = $ platform -> quoteIdentifier ( $ col ) ; } return implode ( ", " , $ list ) ; } | Return a comma delimited string listing the specified columns . |
3,649 | public function getStudlyPhpName ( ) { $ phpname = $ this -> getPhpName ( ) ; if ( strlen ( $ phpname ) > 1 ) { return strtolower ( substr ( $ phpname , 0 , 1 ) ) . substr ( $ phpname , 1 ) ; } else { return strtolower ( $ phpname ) ; } } | Get studly version of PHP name . |
3,650 | public function addInheritance ( $ inhdata ) { if ( $ inhdata instanceof Inheritance ) { $ inh = $ inhdata ; $ inh -> setColumn ( $ this ) ; if ( $ this -> inheritanceList === null ) { $ this -> inheritanceList = array ( ) ; $ this -> isEnumeratedClasses = true ; } $ this -> inheritanceList [ ] = $ inh ; return $ inh ;... | Adds a new inheritance definition to the inheritance list and set the parent column of the inheritance to the current column |
3,651 | public function addReferrer ( ForeignKey $ fk ) { if ( $ this -> referrers === null ) { $ this -> referrers = array ( ) ; } $ this -> referrers [ ] = $ fk ; } | Adds the foreign key from another table that refers to this column . |
3,652 | public function setType ( $ propelType ) { $ this -> getDomain ( ) -> setType ( $ propelType ) ; if ( $ propelType == PropelTypes :: VARBINARY || $ propelType == PropelTypes :: LONGVARBINARY || $ propelType == PropelTypes :: BLOB ) { $ this -> needsTransactionInPostgres = true ; } } | Sets the propel colunm type . |
3,653 | public function setDefaultValue ( $ def ) { if ( ! $ def instanceof ColumnDefaultValue ) { $ def = new ColumnDefaultValue ( $ def , ColumnDefaultValue :: TYPE_VALUE ) ; } $ this -> domain -> setDefaultValue ( $ def ) ; return $ this ; } | Set a string that will give this column a default value . |
3,654 | public function getAutoIncrementString ( ) { if ( $ this -> isAutoIncrement ( ) && IDMethod :: NATIVE === $ this -> getTable ( ) -> getIdMethod ( ) ) { return $ this -> getPlatform ( ) -> getAutoIncrement ( ) ; } elseif ( $ this -> isAutoIncrement ( ) ) { throw new EngineException ( sprintf ( 'You have specified autoIn... | Gets the auto - increment string . |
3,655 | public function getVirtualColumn ( $ name ) { if ( ! $ this -> hasVirtualColumn ( $ name ) ) { throw new PropelException ( 'Cannot get value of inexistent virtual column ' . $ name ) ; } return $ this -> virtualColumns [ $ name ] ; } | Get the value of a virtual column in this object |
3,656 | protected function addFindOneOrCreate ( & $ script ) { $ child = $ this -> getChild ( ) ; $ col = $ child -> getColumn ( ) ; $ script .= " /** * Issue a SELECT ... LIMIT 1 query based on the current ModelCriteria * and format the result with the current formatter * By default, returns a model object ... | Adds findOneOrCreate function for this object . |
3,657 | protected function filter ( & $ script ) { $ filter = array ( ) ; if ( $ this -> getParameter ( 'brackets_newline' ) == 'true' ) { $ filter [ '#^(\t*)\}\h(else|elseif|catch)(.*)\h\{$#m' ] = "$1}$1$2$3$1{" ; $ filter [ '#^(\t*)(\w.*)\h\{$#m' ] = "$1$2$1{" ; } if ( $ this -> getParameter ( 'remove_closing_comments' ) == ... | Transform the coding standards of a PHP sourcecode string |
3,658 | public static function stripComments ( $ code ) { $ output = '' ; $ commentTokens = array ( T_COMMENT , T_DOC_COMMENT ) ; foreach ( token_get_all ( $ code ) as $ token ) { if ( is_array ( $ token ) ) { if ( in_array ( $ token [ 0 ] , $ commentTokens ) ) { continue ; } $ token = $ token [ 1 ] ; } $ output .= $ token ; }... | Remove inline and codeblock comments from a PHP code string |
3,659 | public function getBuildConnection ( $ database ) { if ( ! isset ( $ this -> buildConnections [ $ database ] ) ) { return array ( 'dsn' => $ this -> url , 'user' => $ this -> userId , 'password' => $ this -> password , ) ; } return $ this -> buildConnections [ $ database ] ; } | Get the buildtime connection settings for a given database name . |
3,660 | public function main ( ) { $ conf = new GeneratorConfig ( ) ; $ conf -> setBuildProperties ( $ this -> getProject ( ) -> getProperties ( ) ) ; $ this -> setBuildConnections ( $ conf -> getBuildConnections ( ) ) ; if ( $ this -> sqldbmap === null || $ this -> getSqlDbMap ( ) -> exists ( ) === false ) { throw new BuildEx... | Load the sql file and then execute it |
3,661 | protected function insertDatabaseSqlFiles ( $ database , $ statements ) { $ buildConnection = $ this -> getBuildConnection ( $ database ) ; $ dsn = str_replace ( "@DB@" , $ database , $ buildConnection [ 'dsn' ] ) ; $ this -> log ( sprintf ( ' Connecting to database "%s" using DSN "%s"' , $ database , $ dsn ) ) ; try ... | Executes a set of SQL statements into the target database . |
3,662 | protected function execSQL ( $ sql ) { if ( trim ( $ sql ) == "" ) { return ; } try { $ this -> totalSql ++ ; if ( ! $ this -> autocommit ) { $ this -> conn -> beginTransaction ( ) ; } $ stmt = $ this -> conn -> prepare ( $ sql ) ; $ this -> log ( sprintf ( ' Executing statement "%s"' , $ sql ) , Project :: MSG_VERB... | Execute a SQL statement using the current connection property . |
3,663 | public function getDescription ( ) { $ changes = array ( ) ; if ( $ count = $ this -> countAddedTables ( ) ) { $ changes [ ] = sprintf ( '%d added tables' , $ count ) ; } if ( $ count = $ this -> countRemovedTables ( ) ) { $ changes [ ] = sprintf ( '%d removed tables' , $ count ) ; } if ( $ count = $ this -> countModif... | Get a description of the database modifications |
3,664 | public static function doDelete ( Criteria $ criteria , PropelPDO $ con ) { $ db = Propel :: getDB ( $ criteria -> getDbName ( ) ) ; $ dbMap = Propel :: getDatabaseMap ( $ criteria -> getDbName ( ) ) ; if ( count ( $ criteria -> getJoins ( ) ) ) { throw new PropelException ( 'Delete does not support join' ) ; } $ table... | Method to perform deletes based on values and keys in a Criteria . |
3,665 | public static function doDeleteAll ( $ tableName , PropelPDO $ con , $ databaseName = null ) { try { $ db = Propel :: getDB ( $ databaseName ) ; if ( $ db -> useQuoteIdentifier ( ) ) { $ tableName = $ db -> quoteIdentifierTable ( $ tableName ) ; } $ sql = "DELETE FROM " . $ tableName ; $ stmt = $ con -> prepare ( $ sql... | Method to deletes all contents of specified table . |
3,666 | public static function doValidate ( $ dbName , $ tableName , $ columns ) { $ dbMap = Propel :: getDatabaseMap ( $ dbName ) ; $ tableMap = $ dbMap -> getTable ( $ tableName ) ; $ failureMap = array ( ) ; foreach ( $ columns as $ colName => $ colValue ) { if ( $ tableMap -> hasColumn ( $ colName ) ) { $ col = $ tableMap ... | Applies any validators that were defined in the schema to the specified columns . |
3,667 | private static function getPrimaryKey ( Criteria $ criteria ) { $ keys = $ criteria -> keys ( ) ; $ key = $ keys [ 0 ] ; $ table = $ criteria -> getTableName ( $ key ) ; $ pk = null ; if ( ! empty ( $ table ) ) { $ dbMap = Propel :: getDatabaseMap ( $ criteria -> getDbName ( ) ) ; $ pks = $ dbMap -> getTable ( $ table ... | Helper method which returns the primary key contained in the given Criteria object . |
3,668 | public function equals ( ColumnDefaultValue $ other ) { if ( $ this -> getType ( ) != $ other -> getType ( ) ) { return false ; } if ( $ this == $ other ) { return true ; } $ equivalents = array ( 'CURRENT_TIMESTAMP' , 'NOW()' ) ; if ( in_array ( strtoupper ( $ this -> getValue ( ) ) , $ equivalents ) && in_array ( str... | A method to compare if two Default values match |
3,669 | private function createDataDbMap ( ) { if ( $ this -> getDataDbMap ( ) === null ) { return ; } $ datadbmap = new Properties ( ) ; if ( $ this -> getDataDbMap ( ) -> exists ( ) ) { $ datadbmap -> load ( $ this -> getDataDbMap ( ) ) ; } foreach ( $ this -> getDataModels ( ) as $ dataModel ) { foreach ( $ dataModel -> get... | Create the data XML - > database map . |
3,670 | private function getTableDataStmt ( $ tableName , PropelPlatformInterface $ platform ) { return $ this -> conn -> query ( "SELECT * FROM " . $ platform -> quoteIdentifier ( $ tableName ) ) ; } | Gets PDOStatement of query to fetch all data from a table . |
3,671 | private function createXMLDoc ( Database $ database ) { $ doc = new DOMDocument ( '1.0' , 'utf-8' ) ; $ doc -> formatOutput = true ; $ doc -> appendChild ( $ doc -> createComment ( "Created by PropelDataDumpTask." ) ) ; $ dsNode = $ doc -> createElement ( "dataset" ) ; $ dsNode -> setAttribute ( "name" , "all" ) ; $ do... | Creates a DOM document containing data for specified database . |
3,672 | protected function ensureDirExists ( $ path ) { $ f = new PhingFile ( $ this -> getOutputDirectory ( ) , $ path ) ; if ( ! $ f -> exists ( ) ) { if ( ! $ f -> mkdirs ( ) ) { throw new BuildException ( "Error creating directories: " . $ f -> getPath ( ) ) ; } } } | Utility method to create directory for package if it doesn t already exist . |
3,673 | public function generateBlockStorage ( $ object , $ isPrimaryKey = false ) { $ vendorSpecific = $ object -> getVendorInfoForType ( 'oracle' ) ; if ( $ vendorSpecific -> isEmpty ( ) ) { return '' ; } if ( $ isPrimaryKey ) { $ physicalParameters = "USING INDEX" ; $ prefix = "PK" ; } else { $ physicalParameters = "\n" ; $... | Generate oracle block storage |
3,674 | public function getTableForAlias ( $ alias ) { if ( isset ( $ this -> aliases [ $ alias ] ) ) { return $ this -> aliases [ $ alias ] ; } return null ; } | Returns the table name associated with an alias . |
3,675 | public function getNewCriterion ( $ column , $ value = null , $ comparison = self :: EQUAL ) { return new Criterion ( $ this , $ column , $ value , $ comparison ) ; } | Method to return criterion that is not added automatically to this Criteria . This can be used to chain the Criterions to form a more complex where clause . |
3,676 | public function putAll ( $ t ) { if ( is_array ( $ t ) ) { foreach ( $ t as $ key => $ value ) { if ( $ value instanceof Criterion ) { $ this -> map [ $ key ] = $ value ; } else { $ this -> put ( $ key , $ value ) ; } } } elseif ( $ t instanceof Criteria ) { $ this -> joins = $ t -> joins ; } } | Copies all of the mappings from the specified Map to this Criteria These mappings will replace any mappings that this Criteria had for any of the keys currently in the specified Map . |
3,677 | public function combine ( $ criterions = array ( ) , $ operator = self :: LOGICAL_AND , $ name = null ) { $ operatorMethod = ( strtoupper ( $ operator ) == self :: LOGICAL_AND ) ? 'addAnd' : 'addOr' ; $ namedCriterions = array ( ) ; foreach ( $ criterions as $ key ) { if ( array_key_exists ( $ key , $ this -> namedCrit... | Combine several named criterions with a logical operator |
3,678 | public function removeSelectModifier ( $ modifier ) { $ this -> selectModifiers = array_values ( array_diff ( $ this -> selectModifiers , array ( $ modifier ) ) ) ; return $ this ; } | Removes a modifier to the SQL statement . Checks for existence before removal |
3,679 | private function guessPeerCountMethod ( ) { $ selectMethod = $ this -> getPeerSelectMethod ( ) ; if ( $ selectMethod == 'doSelect' ) { $ countMethod = 'doCount' ; } elseif ( ( $ pos = stripos ( $ selectMethod , 'doSelectJoin' ) ) === 0 ) { $ countMethod = 'doCount' . substr ( $ selectMethod , strlen ( 'doSelect' ) ) ; ... | Guesses the Peer count method based on the select method . |
3,680 | private function doRs ( ) { $ this -> criteria -> setOffset ( $ this -> start ) ; $ this -> criteria -> setLimit ( $ this -> max ) ; $ this -> rs = call_user_func ( array ( $ this -> getPeerClass ( ) , $ this -> getPeerSelectMethod ( ) ) , $ this -> criteria ) ; } | Get the paged resultset |
3,681 | public function getTotalPages ( ) { if ( ! isset ( $ this -> pages ) ) { $ recordCount = $ this -> getTotalRecordCount ( ) ; if ( $ this -> max > 0 ) { $ this -> pages = ceil ( $ recordCount / $ this -> max ) ; } else { $ this -> pages = 0 ; } } return $ this -> pages ; } | get total pages |
3,682 | public function getPrevLinks ( $ range = 5 ) { $ total = $ this -> getTotalPages ( ) ; $ start = $ this -> getPage ( ) - 1 ; $ end = $ this -> getPage ( ) - $ range ; $ first = $ this -> getFirstPage ( ) ; $ links = array ( ) ; for ( $ i = $ start ; $ i > $ end ; $ i -- ) { if ( $ i < $ first ) { break ; } $ links [ ] ... | get an array of previous id s |
3,683 | public function getNextLinks ( $ range = 5 ) { $ total = $ this -> getTotalPages ( ) ; $ start = $ this -> getPage ( ) + 1 ; $ end = $ this -> getPage ( ) + $ range ; $ last = $ this -> getLastPage ( ) ; $ links = array ( ) ; for ( $ i = $ start ; $ i < $ end ; $ i ++ ) { if ( $ i > $ last ) { break ; } $ links [ ] = $... | get an array of next id s |
3,684 | public function getPrev ( ) { if ( $ this -> getPage ( ) != $ this -> getFirstPage ( ) ) { $ prev = $ this -> getPage ( ) - 1 ; } else { $ prev = false ; } return $ prev ; } | get previous id |
3,685 | public function getNext ( ) { if ( $ this -> getPage ( ) != $ this -> getLastPage ( ) ) { $ next = $ this -> getPage ( ) + 1 ; } else { $ next = false ; } return $ next ; } | get next id |
3,686 | public function current ( ) { if ( ! isset ( $ this -> rs ) ) { $ this -> doRs ( ) ; } return $ this -> rs [ $ this -> currentKey ] ; } | Returns the current element of the iterator |
3,687 | public function valid ( ) { if ( ! isset ( $ this -> rs ) ) { $ this -> doRs ( ) ; } return in_array ( $ this -> currentKey , array_keys ( $ this -> rs ) ) ; } | Checks if the current key exists in the container |
3,688 | public function getColumnList ( $ columns , $ delim = ',' ) { $ list = array ( ) ; foreach ( $ columns as $ col ) { if ( $ col instanceof Column ) { $ col = $ col -> getName ( ) ; } $ list [ ] = $ col ; } return implode ( $ delim , $ list ) ; } | Creates a delimiter - delimited string list of column names |
3,689 | public function doNaming ( ) { try { for ( $ i = 0 , $ size = count ( $ this -> foreignKeys ) ; $ i < $ size ; $ i ++ ) { $ fk = $ this -> foreignKeys [ $ i ] ; $ name = $ fk -> getName ( ) ; if ( empty ( $ name ) ) { $ name = $ this -> acquireConstraintName ( "FK" , $ i + 1 ) ; $ fk -> setName ( $ name ) ; } } for ( $... | Names composing objects which haven t yet been named . This currently consists of foreign - key and index entities . |
3,690 | private function acquireConstraintName ( $ nameType , $ nbr ) { $ inputs = array ( ) ; $ inputs [ ] = $ this -> getDatabase ( ) ; $ inputs [ ] = $ this -> getCommonName ( ) ; $ inputs [ ] = $ nameType ; $ inputs [ ] = $ nbr ; return NameFactory :: generateName ( NameFactory :: CONSTRAINT_GENERATOR , $ inputs ) ; } | Macro to a constraint name . |
3,691 | public function getBaseClass ( ) { if ( $ this -> isAlias ( ) && $ this -> baseClass === null ) { return $ this -> alias ; } elseif ( $ this -> baseClass === null ) { return $ this -> getDatabase ( ) -> getBaseClass ( ) ; } else { return $ this -> baseClass ; } } | Gets the value of base class for classes produced from this table . |
3,692 | public function getBasePeer ( ) { if ( $ this -> isAlias ( ) && $ this -> basePeer === null ) { return $ this -> alias . "Peer" ; } elseif ( $ this -> basePeer === null ) { return $ this -> getDatabase ( ) -> getBasePeer ( ) ; } else { return $ this -> basePeer ; } } | Get the value of basePeer . |
3,693 | public function removeColumn ( $ col ) { if ( is_string ( $ col ) ) { $ col = $ this -> getColumn ( $ col ) ; } $ pos = array_search ( $ col , $ this -> columnList ) ; if ( false === $ pos ) { throw new EngineException ( sprintf ( 'No column named %s found in table %s' , $ col -> getName ( ) , $ this -> getName ( ) ) )... | Removed a column from the table |
3,694 | public function addValidator ( $ data ) { if ( $ data instanceof Validator ) { $ validator = $ data ; $ col = $ this -> getColumn ( $ validator -> getColumnName ( ) ) ; if ( $ col == null ) { throw new EngineException ( "Failed adding validator to table '" . $ this -> getName ( ) . "': column '" . $ validator -> getCol... | Add a validator to this table . |
3,695 | public function removeValidatorForColumn ( $ columnName ) { foreach ( $ this -> validatorList as $ key => $ validator ) { if ( $ validator -> getColumnName ( ) == $ columnName ) { unset ( $ this -> validatorList [ $ key ] ) ; } } } | Removes validators based on a column name |
3,696 | public function addForeignKey ( $ fkdata ) { if ( $ fkdata instanceof ForeignKey ) { $ fk = $ fkdata ; $ fk -> setTable ( $ this ) ; $ this -> foreignKeys [ ] = $ fk ; if ( $ this -> foreignTableNames === null ) { $ this -> foreignTableNames = array ( ) ; } if ( ! in_array ( $ fk -> getForeignTableName ( ) , $ this -> ... | A utility function to create a new foreign key from attrib and add it to this table . |
3,697 | public function getChildrenNames ( ) { if ( $ this -> inheritanceColumn === null || ! $ this -> inheritanceColumn -> isEnumeratedClasses ( ) ) { return null ; } $ children = $ this -> inheritanceColumn -> getChildren ( ) ; $ names = array ( ) ; for ( $ i = 0 , $ size = count ( $ children ) ; $ i < $ size ; $ i ++ ) { $... | Get the subclasses that can be created from this table . |
3,698 | public function addIdMethodParameter ( $ impdata ) { if ( $ impdata instanceof IdMethodParameter ) { $ imp = $ impdata ; $ imp -> setTable ( $ this ) ; if ( $ this -> idMethodParameters === null ) { $ this -> idMethodParameters = array ( ) ; } $ this -> idMethodParameters [ ] = $ imp ; return $ imp ; } else { $ imp = n... | A utility function to create a new id method parameter from attrib or object and add it to this table . |
3,699 | public function removeIndex ( $ name ) { foreach ( $ this -> indices as $ n => $ idx ) { if ( $ idx -> getName ( ) == $ name ) { unset ( $ this -> indices [ $ n ] ) ; return ; } } } | Removed a index from the table |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.