idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
235,200 | public function initPages ( $ overrideExisting = true ) { if ( null !== $ this -> collPages && ! $ overrideExisting ) { return ; } $ collectionClassName = PageTableMap :: getTableMap ( ) -> getCollectionClassName ( ) ; $ this -> collPages = new $ collectionClassName ; $ this -> collPages -> setModel ( '\Attogram\Shared... | Initializes the collPages collection . |
235,201 | public function getPages ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { $ partial = $ this -> collPagesPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collPages || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collPages ) { $ this -> initPages ( ) ; ... | Gets an array of ChildPage objects which contain a foreign key that references this object . |
235,202 | public function countPages ( Criteria $ criteria = null , $ distinct = false , ConnectionInterface $ con = null ) { $ partial = $ this -> collPagesPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collPages || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collPages ) { ret... | Returns the number of related Page objects . |
235,203 | public function addPage ( ChildPage $ l ) { if ( $ this -> collPages === null ) { $ this -> initPages ( ) ; $ this -> collPagesPartial = true ; } if ( ! $ this -> collPages -> contains ( $ l ) ) { $ this -> doAddPage ( $ l ) ; if ( $ this -> pagesScheduledForDeletion and $ this -> pagesScheduledForDeletion -> contains ... | Method called to associate a ChildPage object to this object through the ChildPage foreign key attribute . |
235,204 | public function submitMissingKeys ( ) { if ( $ this -> missing_keys_by_sources == null ) return ; $ params = array ( ) ; $ source_keys = array ( ) ; foreach ( $ this -> missing_keys_by_sources as $ source => $ keys ) { array_push ( $ source_keys , $ source ) ; $ keys_data = array ( ) ; foreach ( $ keys as $ key ) { $ j... | Submits missing keys to the service |
235,205 | public function up ( ) { $ record = new MigrationRecord ( ) ; if ( $ this -> connection !== null ) { $ record -> setConnection ( $ this -> connection ) ; } $ record -> migration = $ this -> name ; $ record -> save ( ) ; } | Insert data into migration table |
235,206 | public function down ( ) { $ record = new MigrationRecord ( ) ; if ( $ this -> connection !== null ) { $ record -> setConnection ( $ this -> connection ) ; } $ record -> where ( 'migration' , $ this -> name ) -> delete ( ) ; } | Remove data from migration table |
235,207 | public function run ( ) { $ this -> execute ( ) ; if ( $ handler = $ this -> getFormHandler ( @ $ _REQUEST [ '_form_name' ] ) ) call_user_func ( $ handler , $ _REQUEST ) ; } | The entry point for a plugin . This should be called immediately in your bootstrap file . |
235,208 | public function addResources ( ) { if ( $ this -> resourceChain === null ) $ this -> resourceChain = new ResourceChain ( $ this ) ; return $ this -> resourceChain ; } | Returns a ResourceChain object that can be used to add stylesheets and scripts . |
235,209 | public function run ( array $ sources , array $ destinations ) { $ fileSystem = new Filesystem ( ) ; if ( count ( $ sources ) !== count ( $ destinations ) && count ( $ destinations ) !== 1 ) { throw new Exception ( 'Sources and destinations count mismatch' ) ; } if ( count ( $ destinations ) === 1 && ! is_dir ( $ desti... | Copy the sources files to the destinations . |
235,210 | public function install ( $ module , $ version , $ options = null ) { $ module = strtolower ( $ module ) ; $ options = is_null ( $ options ) ? array ( ) : $ options ; $ modules = $ this -> findModules ( ) ; $ current = array ( ) ; foreach ( $ modules as $ name ) { $ modVersion = $ this -> getModuleVersion ( $ name ) ; ... | Install module dependencies |
235,211 | public function resolveDependencies ( $ module ) { $ version = $ this -> getModuleVersion ( $ module ) ; if ( null === $ version ) { throw new \ Exception ( sprintf ( "Unable to resolve dependencies for module '%s'. Module definitions are missing or incomplete." , $ module ) ) ; } $ resolved = new \ ArrayObject ( ) ; $... | Resolve module dependencies recursively |
235,212 | protected function resolveDepsRecursive ( $ module , $ version , \ ArrayObject $ resolved ) { $ module = strtolower ( $ module ) ; if ( $ resolved -> offsetExists ( $ module ) ) { $ new = new SoftwareVersion ( $ version ) ; if ( $ new -> isGt ( $ resolved [ $ module ] ) ) { unset ( $ resolved [ $ module ] ) ; $ resolve... | Resolve dependencies recursively . The level and order in module dependency hierarchy defines the module s priority . |
235,213 | public function findModules ( ) { $ dirs = $ this -> getOption ( 'module_dirs' ) ; $ modules = array ( ) ; foreach ( $ dirs as $ dir ) { $ iterator = new DirectoryIterator ( $ dir ) ; foreach ( $ iterator as $ file ) { if ( ( $ file -> isDir ( ) && substr ( $ file -> getBasename ( ) , 0 , 1 ) !== '.' ) || ( $ file -> i... | Find all modules installed in module directories |
235,214 | public function whichModule ( $ object ) { $ reflection = new \ ReflectionClass ( $ object ) ; $ ns = explode ( '\\' , $ reflection -> getNamespaceName ( ) ) ; if ( class_exists ( $ ns [ 0 ] . '\Module' ) ) { $ reflection = new \ ReflectionClass ( $ ns [ 0 ] . '\Module' ) ; return strtolower ( basename ( dirname ( $ re... | Detect the name of the module based on class |
235,215 | public function getModuleVersion ( $ module ) { $ config = $ this -> getModuleDefinition ( $ module ) ; if ( isset ( $ config [ 'version' ] ) ) { return $ config [ 'version' ] ; } else { return SoftwareVersion :: DEFAULT_UNRESOLVED_VERSION ; } } | Get current version for module |
235,216 | public function getModuleDefinition ( $ module ) { $ module = strtolower ( $ module ) ; if ( ! array_key_exists ( $ module , $ this -> definitions ) ) { $ path = $ this -> locateModule ( $ module ) ; $ config = array ( ) ; if ( $ path ) { $ definition = $ path . DIRECTORY_SEPARATOR . $ this -> getOption ( 'definition_f... | Get module definition as an array |
235,217 | public function getModuleDeps ( $ module ) { $ module = strtolower ( $ module ) ; if ( ! isset ( $ this -> deps [ $ module ] ) ) { $ map = array ( ) ; $ deps = array ( ) ; $ modules = $ this -> findModules ( ) ; foreach ( $ modules as $ name ) { $ config = $ this -> getModuleDefinition ( $ name ) ; $ map [ $ name ] = i... | Retrieve list of module dependencies |
235,218 | public function setConfig ( $ config ) { if ( is_string ( $ config ) && file_exists ( $ config ) ) { $ options = \ Zend \ Config \ Factory :: fromFile ( $ config ) ; $ this -> setOptions ( $ options ) ; } elseif ( ! is_array ( $ config ) && ! ( $ config instanceof \ Traversable ) ) { throw new \ InvalidArgumentExceptio... | Set service options |
235,219 | public static function getInstance ( Config $ config = null ) { if ( is_null ( self :: $ instance ) ) { if ( is_null ( $ config ) ) { throw new ApplicationException ( 'No configuration object provided. Cannot instantiate application.' ) ; } self :: $ instance = new Application ( $ config ) ; } return self :: $ instance... | Get Application instance . |
235,220 | public function registerPlugins ( ) { if ( $ this -> plugins ) { foreach ( $ this -> plugins as $ plugin ) { $ this -> eventDispatcher -> removeSubscriber ( $ plugin ) ; } } $ this -> plugins = array ( ) ; if ( $ this -> config -> plugins ) { foreach ( array_keys ( $ this -> config -> plugins ) as $ pluginId ) { $ this... | Unregister all previously registered plugins . |
235,221 | public function getDb ( ) { if ( empty ( $ this -> db ) ) { if ( empty ( $ this -> config -> db ) ) { try { return $ this -> getVxPDO ( ) ; } catch ( ApplicationException $ e ) { return null ; } } $ config = $ this -> config -> db ; $ this -> db = DatabaseInterfaceFactory :: create ( isset ( $ config -> type ) ? $ conf... | get default vxPDO instance |
235,222 | public function getVxPDO ( $ name = 'default' ) { if ( ! array_key_exists ( $ name , $ this -> vxPDOInstances ) ) { if ( empty ( $ this -> config -> vxpdo ) || ! array_key_exists ( $ name , $ this -> config -> vxpdo ) ) { throw new ApplicationException ( sprintf ( "vxPDO configuration for '%s' not found." , $ name ) ) ... | get a configured vxPDO instance identified by its datasource name |
235,223 | public function getService ( $ serviceId ) { $ args = func_get_args ( ) ; $ service = $ this -> initializeService ( $ serviceId , array_splice ( $ args , 1 ) ) ; $ this -> services [ ] = $ service ; return $ service ; } | return a service instance service instances are lazily initialized upon first request |
235,224 | public function hasService ( $ serviceId ) { return ! empty ( $ this -> config -> services ) && array_key_exists ( $ serviceId , $ this -> config -> services ) ; } | checks whether a service identified by service id is configured no further checks whether service can be invoked are conducted |
235,225 | public function runsLocally ( ) { if ( is_null ( $ this -> isLocal ) ) { $ remote = isset ( $ _SERVER [ 'HTTP_CLIENT_IP' ] ) || isset ( $ _SERVER [ 'HTTP_X_FORWARDED_FOR' ] ) || ! ( in_array ( @ $ _SERVER [ 'REMOTE_ADDR' ] , [ '127.0.0.1' , 'fe80::1' , '::1' ] ) || PHP_SAPI === 'cli-server' ) ; $ this -> isLocal = PHP_... | returns true when the application was called from the command line or in a localhost environment |
235,226 | public function getSourcePath ( ) { if ( is_null ( $ this -> sourcePath ) ) { $ this -> sourcePath = $ this -> rootPath . 'src' . DIRECTORY_SEPARATOR ; } return $ this -> sourcePath ; } | get absolute path to application source |
235,227 | public function setAbsoluteAssetsPath ( $ path ) { $ path = rtrim ( $ path , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR ; if ( ! is_null ( $ this -> rootPath ) && 0 !== strpos ( $ path , $ this -> rootPath ) ) { throw new ApplicationException ( sprintf ( "'%s' not within application path '%s'." , $ path , $ this -> ro... | set absolute assets path the relative assets path is updated |
235,228 | public function setRootPath ( $ path ) { $ path = rtrim ( $ path , DIRECTORY_SEPARATOR ) . DIRECTORY_SEPARATOR ; if ( ! is_null ( $ this -> absoluteAssetsPath ) && 0 !== strpos ( $ this -> absoluteAssetsPath , $ path ) ) { throw new ApplicationException ( "'$path' not a parent of assets path '{$this->absoluteAssetsPath... | set root path of application if an assetspath is set the relative assets path is updated |
235,229 | public function getAvailableLocales ( ) { foreach ( $ this -> locales as $ id => $ l ) { if ( ! $ l ) { $ this -> locales [ $ id ] = new Locale ( $ id ) ; } } return $ this -> locales ; } | returns an array with available Locale instances because of lazy instantiation missing instances are created now |
235,230 | private function initializeService ( $ serviceId , array $ constructorArguments ) { if ( ! isset ( $ this -> config -> services [ $ serviceId ] ) ) { throw new ApplicationException ( sprintf ( "Service '%s' not configured." , $ serviceId ) ) ; } $ configData = $ this -> config -> services [ $ serviceId ] ; $ class = $ ... | create and initialize a service instance |
235,231 | private function initializePlugin ( $ pluginId ) { $ configData = $ this -> config -> plugins [ $ pluginId ] ; $ class = str_replace ( '/' , '\\' , $ configData [ 'class' ] ) ; $ file = $ this -> rootPath . 'src/' . $ configData [ 'classPath' ] . $ class . '.php' ; if ( ! file_exists ( $ file ) ) { throw new Applicatio... | create initialize and register a plugin instance |
235,232 | public function setFields ( array $ fields ) { $ this -> _fields = array ( ) ; $ this -> _records = array ( ) ; $ prevLevel = null ; foreach ( $ fields as $ field ) { $ level = $ field -> getLevel ( ) ; if ( $ level === 0 ) { $ this -> append ( $ field ) ; } else { if ( $ level === 1 && $ prevLevel !== 1 ) { $ localRec... | Set the record s fields . |
235,233 | public function getLocalRecordByILN ( $ iln ) { foreach ( $ this -> getLocalRecords ( ) as $ localRecord ) { if ( $ localRecord -> getILN ( ) == $ iln ) { return $ localRecord ; } } return null ; } | Return a local record identified by its ILN . |
235,234 | public function getAllPublishablePosts ( ) { $ collection = $ this -> getAll ( ) -> sortByDesc ( 'updated_at' ) ; $ filtered = $ collection -> filter ( function ( $ item ) { if ( $ item -> enabled == 1 ) return true ; } ) ; $ filtered = $ filtered -> filter ( function ( $ item ) { $ todaysDate = DatesHelper :: todaysDa... | Get all the posts |
235,235 | public function getCategoryTitleById ( $ categoryId ) { $ category = DB :: table ( 'categories' ) -> where ( 'id' , '=' , $ categoryId ) -> first ( ) ; return $ category -> title ; } | Find the category title by the category s id |
235,236 | public function getTagTitlesByPostId ( $ postId ) { $ post_tags = DB :: table ( 'post_tag' ) -> where ( 'post_id' , '=' , $ postId ) -> get ( ) ; if ( empty ( $ post_tags ) ) { return $ post_tags ; } $ tagTitles = [ ] ; foreach ( $ post_tags as $ post_tag ) { $ tag = DB :: table ( 'tags' ) -> select ( 'title' ) -> wher... | Find the tag s titles for those tags that are associated with a post . |
235,237 | public static function addHeader ( $ type , $ value , $ code = null ) { if ( false == is_string ( $ type ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ type ) ) , E_USER_ERROR ) ; } if ( false == is_string ( $ value ) && false == is_n... | Sets the response header by type and value |
235,238 | public static function removeHeader ( $ type ) { if ( false == is_string ( $ type ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ type ) ) , E_USER_ERROR ) ; } header_remove ( $ type ) ; } | Remove response header by type |
235,239 | public static function file ( File $ file , $ filename = null , $ mime = null ) { if ( null !== $ filename && false === is_string ( $ filename ) ) { return trigger_error ( sprintf ( 'Argument 2 passed to %s() must be of the type string, "%s" given' , __METHOD__ , gettype ( $ filename ) ) , E_USER_ERROR ) ; } if ( null ... | Give a file for the client to download |
235,240 | public function setPluginManager ( Navigation \ PluginManager $ plugins ) { if ( $ this -> view ) { $ plugins -> setView ( $ this -> view ) ; } $ this -> plugins = $ plugins ; return $ this ; } | Set manager for retrieving navigation helpers |
235,241 | public function getPluginManager ( ) { if ( null === $ this -> plugins ) { $ this -> setPluginManager ( new Navigation \ PluginManager ( ) ) ; } return $ this -> plugins ; } | Retrieve plugin loader for navigation helpers |
235,242 | static public function createFromFile ( $ pathname ) { if ( ! file_exists ( $ pathname ) ) { throw new ImageFileNotFoundException ( $ pathname ) ; } $ ii = getimagesize ( $ pathname ) ; $ width = $ ii [ 0 ] ; $ height = $ ii [ 1 ] ; $ imagetype = $ ii [ 2 ] ; $ last_modified = filemtime ( $ pathname ) ; $ exif = @ exif... | Create an ImageFileInfo from an image file |
235,243 | public function setSingleType ( $ singleType ) { $ allowedTypes = [ self :: SINGLE_TYPE_EXACT , self :: SINGLE_TYPE_GREATER , self :: SINGLE_TYPE_GREATER_OR_EQUAL , self :: SINGLE_TYPE_LESS , self :: SINGLE_TYPE_LESS_OR_EQUAL , ] ; if ( ! is_string ( $ singleType ) || ! in_array ( $ singleType , $ allowedTypes , true )... | Sets type for the filter treated as single . |
235,244 | public function setFromValuePropertyName ( $ fromValuePropertyName ) { if ( ! is_string ( $ fromValuePropertyName ) || empty ( $ fromValuePropertyName ) ) { throw new InvalidArgumentException ( '"From value property name" argument must be string and must not be empty.' ) ; } if ( ! property_exists ( $ this , $ fromValu... | Sets from value property name which contains the from value . |
235,245 | public function setToValuePropertyName ( $ toValuePropertyName ) { if ( ! is_string ( $ toValuePropertyName ) || empty ( $ toValuePropertyName ) ) { throw new InvalidArgumentException ( '"To value property name" argument must be string and must not be empty.' ) ; } if ( ! property_exists ( $ this , $ toValuePropertyNam... | Sets to value property name which contains the to value . |
235,246 | public function setFromPostfix ( $ fromPostfix ) { if ( ! is_string ( $ fromPostfix ) || empty ( $ fromPostfix ) ) { throw new InvalidArgumentException ( '"From postfix" argument must be string and must not be empty.' ) ; } $ this -> fromPostfix = $ fromPostfix ; return $ this ; } | Sets from name postfix . |
235,247 | public function setToPostfix ( $ toPostfix ) { if ( ! is_string ( $ toPostfix ) || empty ( $ toPostfix ) ) { throw new InvalidArgumentException ( '"To postfix" argument must be string and must not be empty.' ) ; } $ this -> toPostfix = $ toPostfix ; return $ this ; } | Sets to name postfix . |
235,248 | public function setRangedFromType ( $ rangedFromType ) { $ allowedTypes = [ self :: RANGED_FROM_TYPE_GREATER , self :: RANGED_FROM_TYPE_GREATER_OR_EQUAL ] ; if ( ! is_string ( $ rangedFromType ) || ! in_array ( $ rangedFromType , $ allowedTypes , true ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid "range... | Sets from type for the filter treated as ranged . |
235,249 | public function setRangedToType ( $ rangedToType ) { $ allowedTypes = [ self :: RANGED_TO_TYPE_LESS , self :: RANGED_TO_TYPE_LESS_OR_EQUAL ] ; if ( ! is_string ( $ rangedToType ) || ! in_array ( $ rangedToType , $ allowedTypes ) ) { throw new InvalidArgumentException ( sprintf ( 'Invalid "ranged to type" argument. Allo... | Sets to type for the filter treated as ranged . |
235,250 | public function setFormFieldTypeRangedFrom ( $ formFieldTypeRangedFrom ) { if ( ! is_string ( $ formFieldTypeRangedFrom ) || empty ( $ formFieldTypeRangedFrom ) ) { throw new InvalidArgumentException ( '"Form field type ranged from" argument must be string and must not be empty.' ) ; } $ this -> formFieldTypeRangedFrom... | Sets form field type for from field . |
235,251 | public function setFormFieldTypeRangedTo ( $ formFieldTypeRangedTo ) { if ( ! is_string ( $ formFieldTypeRangedTo ) || empty ( $ formFieldTypeRangedTo ) ) { throw new InvalidArgumentException ( '"Form field type ranged to" argument must be string and must not be empty.' ) ; } $ this -> formFieldTypeRangedTo = $ formFie... | Sets form field type for to field . |
235,252 | public static function iconIdentifier ( string $ iconKey , string $ separator = '_' ) : string { $ slugify = new Slugify ( [ 'separator' => $ separator ] ) ; $ iconIdentifier = $ slugify -> slugify ( $ iconKey ) ; return $ iconIdentifier ; } | Gets an icon identifier from an icon key . |
235,253 | public static function getIconIdentifier ( string $ iconKey , string $ separator = '_' ) : string { return self :: iconIdentifier ( $ iconKey , $ separator ) ; } | Alias for the iconIdentifier function . |
235,254 | public static function iconSignature ( string $ extensionKey , string $ iconIdentifier , string $ separator = '-' ) : string { $ iconSignature = mb_strtolower ( "${extensionKey}${separator}${iconIdentifier}" ) ; return $ iconSignature ; } | Gets an icon signature from an extension key and icon identifier . |
235,255 | public static function getIconSignature ( string $ extensionKey , string $ iconIdentifier , string $ separator = '-' ) : string { return self :: iconSignature ( $ extensionKey , $ iconIdentifier , $ separator ) ; } | Alias for the iconSignature function . |
235,256 | public function resolveFor ( UserIdInterface $ donorId ) { $ donor = $ this -> donorRepository -> findOneById ( $ donorId ) ; $ donee = $ this -> getResolverHandlerChain ( ) -> resolve ( $ donor ) ; $ this -> eventContext -> dispatch ( FoundDonee :: fromPair ( $ donor , $ donee ) ) ; return $ donee ; } | Resolves a donee for the incoming donor user id |
235,257 | private function getResolverHandlerChain ( ) { $ randomResolver = $ this -> resolverFactory -> create ( Random :: class ) ; $ nonMutualResolver = $ this -> resolverFactory -> create ( NonMutual :: class , $ randomResolver ) ; return $ this -> resolverFactory -> create ( FromExistingPair :: class , $ nonMutualResolver )... | Builds and returns the resolver handler chain |
235,258 | public function register ( EntityDefinition $ builder ) : void { $ this -> defs [ $ builder -> full_name ] = $ builder ; $ this -> unchecked [ ] = $ builder ; $ binding_name = str_replace ( '\\' , '.' , $ builder -> full_name ) ; $ this -> ioc -> bind ( 'bap.remodel.scopes.' . $ binding_name , function ( ) use ( $ buil... | Register an Entity definition . Note this method DOES NOT generate the classes . They are generated when needed . |
235,259 | protected function preSaveChecksPassed ( int $ post_id ) : bool { if ( $ post_id < 1 ) { return false ; } if ( \ defined ( 'DOING_AUTOSAVE' ) && DOING_AUTOSAVE ) { return false ; } if ( ! \ current_user_can ( \ get_post_type_object ( \ get_post_type ( $ post_id ) ) -> cap -> edit_post , $ post_id ) ) { return false ; }... | Checks to perform prior save |
235,260 | public function createTable ( $ name , array $ columns = array ( ) , array $ primaryKey = array ( ) , array $ foreignKeys = array ( ) , array $ indexes = array ( ) , array $ checks = array ( ) ) { $ table = new Table ( $ name ) ; foreach ( $ columns as $ column ) { if ( ! isset ( $ column [ 'options' ] ) ) { $ column [... | Creates and adds a new table . |
235,261 | public function setTables ( array $ tables ) { $ this -> tables = array ( ) ; foreach ( $ tables as $ table ) { $ this -> addTable ( $ table ) ; } } | Sets the schema tables . |
235,262 | public function getTable ( $ name ) { if ( ! $ this -> hasTable ( $ name ) ) { throw SchemaException :: schemaTableDoesNotExist ( $ this -> getName ( ) , $ name ) ; } return $ this -> tables [ $ name ] ; } | Gets a table . |
235,263 | public function addTable ( Table $ table ) { if ( $ this -> hasTable ( $ table -> getName ( ) ) ) { throw SchemaException :: schemaTableAlreadyExists ( $ this -> getName ( ) , $ table -> getName ( ) ) ; } $ this -> tables [ $ table -> getName ( ) ] = $ table ; if ( $ table -> getSchema ( ) !== $ this ) { $ table -> set... | Adds a table to the schema . |
235,264 | public function createSequence ( $ name , $ initialValue = 1 , $ incrementSize = 1 ) { $ sequence = new Sequence ( $ name , $ initialValue , $ incrementSize ) ; $ this -> addSequence ( $ sequence ) ; return $ sequence ; } | Creates and adds a new sequence . |
235,265 | public function setSequences ( array $ sequences ) { $ this -> sequences = array ( ) ; foreach ( $ sequences as $ sequence ) { $ this -> addSequence ( $ sequence ) ; } } | Sets the schema sequences . |
235,266 | public function getSequence ( $ name ) { if ( ! $ this -> hasSequence ( $ name ) ) { throw SchemaException :: schemaSequenceDoesNotExist ( $ this -> getName ( ) , $ name ) ; } return $ this -> sequences [ $ name ] ; } | Gets a sequence . |
235,267 | public function addSequence ( Sequence $ sequence ) { if ( $ this -> hasSequence ( $ sequence -> getName ( ) ) ) { throw SchemaException :: schemaSequenceAlreadyExists ( $ this -> getName ( ) , $ sequence -> getName ( ) ) ; } $ this -> sequences [ $ sequence -> getName ( ) ] = $ sequence ; } | Adds a sequence to the schema . |
235,268 | public function renameSequence ( $ oldName , $ newName ) { if ( ! $ this -> hasSequence ( $ oldName ) ) { throw SchemaException :: schemaSequenceDoesNotExist ( $ this -> getName ( ) , $ oldName ) ; } if ( $ this -> hasSequence ( $ newName ) ) { throw SchemaException :: schemaSequenceAlreadyExists ( $ this -> getName ( ... | Renames a sequence . |
235,269 | public function dropSequence ( $ name ) { if ( ! $ this -> hasSequence ( $ name ) ) { throw SchemaException :: schemaSequenceDoesNotExist ( $ this -> getName ( ) , $ name ) ; } unset ( $ this -> sequences [ $ name ] ) ; } | Drops a sequence . |
235,270 | public function createView ( $ name , $ sql = null ) { $ view = new View ( $ name , $ sql ) ; $ this -> addView ( $ view ) ; return $ view ; } | Creates and adds a new view . |
235,271 | public function setViews ( array $ views ) { $ this -> views = array ( ) ; foreach ( $ views as $ view ) { $ this -> addView ( $ view ) ; } } | Sets the schema views . |
235,272 | public function getView ( $ name ) { if ( ! $ this -> hasView ( $ name ) ) { throw SchemaException :: schemaViewDoesNotExist ( $ this -> getName ( ) , $ name ) ; } return $ this -> views [ $ name ] ; } | Gets a view . |
235,273 | public function addView ( View $ view ) { if ( $ this -> hasView ( $ view -> getName ( ) ) ) { throw SchemaException :: schemaViewAlreadyExists ( $ this -> getName ( ) , $ view -> getName ( ) ) ; } $ this -> views [ $ view -> getName ( ) ] = $ view ; } | Adds a view to the schema . |
235,274 | public function renameView ( $ oldName , $ newName ) { if ( ! $ this -> hasView ( $ oldName ) ) { throw SchemaException :: schemaViewDoesNotExist ( $ this -> getName ( ) , $ oldName ) ; } if ( $ this -> hasView ( $ newName ) ) { throw SchemaException :: schemaViewAlreadyExists ( $ this -> getName ( ) , $ newName ) ; } ... | Renames a view . |
235,275 | public function dropView ( $ name ) { if ( ! $ this -> hasView ( $ name ) ) { throw SchemaException :: schemaViewDoesNotExist ( $ this -> getName ( ) , $ name ) ; } unset ( $ this -> views [ $ name ] ) ; } | Drops a view . |
235,276 | protected function prepareAttributes ( array $ attributes ) { foreach ( $ attributes as $ key => $ value ) { if ( is_numeric ( $ key ) ) { unset ( $ attributes [ $ key ] ) ; $ attributes [ $ value ] = true ; continue ; } } if ( isset ( $ attributes [ 'null' ] ) ) { unset ( $ attributes [ 'null' ] ) ; $ attributes [ 'no... | Prepares attributes changes them into key value pairs |
235,277 | public function table ( $ table = null ) { if ( $ table !== null ) { $ this -> table = $ table ; } return $ this -> table ; } | Returns table owning the field |
235,278 | public function negotiateRequestFormat ( Request $ req ) { $ header = $ req -> headers -> get ( 'Content-Type' ) ; $ exp = explode ( ';' , $ header ) ; $ type = $ exp [ 0 ] ; return isset ( $ this -> inputFormatMap [ $ type ] ) ? $ this -> inputFormatMap [ $ type ] : false ; } | Return the incoming format derived from the Requests content - type header . Generally this is used for determing which format to use during deserialization . |
235,279 | public function negotiateResponseFormat ( Request $ req ) { return $ this -> getFormatNegotiator ( ) -> getBestFormat ( $ req -> headers -> get ( 'Accept' ) , $ this -> formatPriorities ) ; } | Return the response format type derived from a Request s Accept header and configured priorities . |
235,280 | public function negotiateResponseLanguage ( Request $ req ) { return $ this -> getLanguageNegotiator ( ) -> getBest ( $ req -> headers -> get ( 'Accept-Language' ) , $ this -> langPriorities ) -> getValue ( ) ; } | Return preferred language derived from Requests Accept - Language header and configured priorities . |
235,281 | public function http_get ( $ url , $ data_type = 'json' ) { $ cl = curl_init ( ) ; if ( stripos ( $ url , 'https://' ) !== FALSE ) { curl_setopt ( $ cl , CURLOPT_SSL_VERIFYPEER , FALSE ) ; curl_setopt ( $ cl , CURLOPT_SSL_VERIFYHOST , FALSE ) ; curl_setopt ( $ cl , CURLOPT_SSLVERSION , 1 ) ; } curl_setopt ( $ cl , CURL... | http curl get |
235,282 | protected function hasRole ( $ role ) { if ( ! $ this -> container -> has ( 'security.authorization_checker' ) ) { throw new \ LogicException ( 'The SecurityBundle is not registered in your application.' ) ; } return false !== $ this -> get ( 'security.authorization_checker' ) -> isGranted ( $ role ) ; } | Checks whether the current user has the specified role or not |
235,283 | public function button ( $ value , $ name = null ) { Argument :: i ( ) -> test ( 1 , 'string' ) -> test ( 2 , 'string' , 'null' ) -> test ( 3 , 'bool' ) ; $ field = Button :: i ( ) -> setValue ( $ value ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } return $ field ; } | Returns a ui button field |
235,284 | public function checkbox ( $ name = null , $ value = null , $ items = array ( ) ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'array' , 'null' ) -> test ( 3 , 'string' , 'array' ) ; $ field = Checkbox :: i ( ) -> setItems ( $ items ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ... | Returns a checkbox field or fieldset |
235,285 | public function password ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Password :: i ( ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) ) { $ field -> setValue ( $ value ) ; } return $ ... | Returns a password field |
235,286 | public function radio ( $ name = null , $ value = null , array $ items = array ( ) ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Radio :: i ( $ name ) -> setItems ( $ items ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ valu... | Returns a radio fieldset |
235,287 | public function select ( $ name = null , $ value = null , array $ items = array ( ) ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Select :: i ( ) -> setItems ( $ items ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) )... | Returns a select field |
235,288 | public function submit ( $ value , $ name = null , $ image = null ) { Argument :: i ( ) -> test ( 1 , 'string' ) -> test ( 2 , 'string' , 'null' ) ; $ field = Submit :: i ( ) -> setValue ( $ value ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( $ image ) { $ field -> setImage ( $ image ) ; } re... | Returns a submit field |
235,289 | public function mask ( $ pattern , $ placeholder = null , $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' ) -> test ( 2 , 'string' , 'null' ) -> test ( 3 , 'string' , 'null' ) -> test ( 4 , 'scalar' , 'null' ) ; $ field = Mask :: i ( ) -> setPattern ( $ pattern ) ; if ( ! is_null ( $ name ) ... | Returns an input mask |
235,290 | public function text ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Text :: i ( ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) ) { $ field -> setValue ( $ value ) ; } return $ field ; ... | Returns a text field |
235,291 | public function textarea ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Textarea :: i ( ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) ) { $ field -> setValue ( $ value ) ; } return $ ... | Returns a textarea field |
235,292 | public function color ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'string' , 'null' ) ; $ field = Color :: i ( $ name ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) ) { $ field -> setValue ( $ value ) ; } return $... | Returns a color field |
235,293 | public function combobox ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Combobox :: i ( ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) ) { $ field -> setValue ( $ value ) ; } return $ ... | Returns a combobox field |
235,294 | public function datetime ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Datetime :: i ( ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) ) { $ field -> setValue ( $ value ) ; } return $ ... | Returns a datetime field |
235,295 | public function file ( $ name = null , $ multiple = false , array $ accept = array ( ) ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'bool' ) ; $ field = File :: i ( ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( $ multiple ) { $ field -> setAttributes ( 'multiple' , 'm... | Returns a file field |
235,296 | public function image ( $ name = null , $ multiple = false ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'bool' ) ; $ accept = array ( 'image/gif' , 'image/jpg' , 'image/jpeg' , 'image/png' ) ; return $ this -> file ( $ name , $ multiple , $ accept ) ; } | Returns an image upload field |
235,297 | public function markdown ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Markdown :: i ( ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) ) { $ field -> setValue ( $ value ) ; } return $ ... | Returns a Markdown field |
235,298 | public function slider ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Text :: i ( ) -> setType ( 'range' ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ( ! is_null ( $ value ) ) { $ field -> setValue ( $ valu... | Returns a slider field |
235,299 | public function time ( $ name = null , $ value = null ) { Argument :: i ( ) -> test ( 1 , 'string' , 'null' ) -> test ( 2 , 'scalar' , 'null' ) ; $ field = Datetime :: i ( ) -> setOptions ( 'pickDate' , false ) -> setOptions ( 'format' , 'HH:mm PP' ) ; if ( ! is_null ( $ name ) ) { $ field -> setName ( $ name ) ; } if ... | Returns a time field |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.