idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
49,000 | public function namedForm ( $ name , $ data = null , array $ options = array ( ) , $ type = null ) { return $ this [ 'form.factory' ] -> createNamedBuilder ( $ name , $ type ? : FormType :: class , $ data , $ options ) ; } | Creates and returns a named form builder instance . |
49,001 | private function getExportCommand ( array $ parameter , $ file , $ hidePassword = false ) { $ username = $ parameter [ 'username' ] ; $ password = $ parameter [ 'password' ] ; $ database = $ parameter [ 'database' ] ; $ host = $ parameter [ 'host' ] ; $ port = $ parameter [ 'port' ] ; return sprintf ( 'mysqldump -u%s%s... | Returns command to export database . |
49,002 | private function getImportCommand ( array $ parameter , $ file , $ hidePassword = false ) { $ username = $ parameter [ 'username' ] ; $ password = $ parameter [ 'password' ] ; $ database = $ parameter [ 'database' ] ; $ host = $ parameter [ 'host' ] ; $ port = $ parameter [ 'port' ] ; return sprintf ( 'mysql -u%s%s%s%s... | Returns command to import database . |
49,003 | public function setProperties ( array $ properties ) { if ( ! isset ( $ properties [ self :: DATA_PROPERTY_REQUIRED ] ) ) { $ properties [ self :: DATA_PROPERTY_REQUIRED ] = array ( ) ; } if ( ! isset ( $ properties [ self :: DATA_PROPERTY_DEFAULTS ] ) ) { $ properties [ self :: DATA_PROPERTY_DEFAULTS ] = array ( ) ; }... | Set properties for data |
49,004 | protected function configureDefaultData ( ) { if ( isset ( $ this -> properties [ 'defaults' ] ) && is_array ( $ this -> properties [ 'defaults' ] ) ) { foreach ( $ this -> properties [ 'defaults' ] as $ data => $ value ) { if ( ! isset ( $ this -> data [ $ data ] ) ) { $ this -> data [ $ data ] = $ value ; } } } retur... | Configures Data with defaults based on properties array |
49,005 | protected function verifyRequiredData ( ) { $ errors = array ( 'missing' => array ( ) , 'invalid' => array ( ) ) ; $ error = FALSE ; if ( ! empty ( $ this -> properties [ 'required' ] ) ) { foreach ( $ this -> properties [ 'required' ] as $ property => $ type ) { if ( ! isset ( $ this -> data [ $ property ] ) ) { $ err... | Validate Required Data for the Endpoint |
49,006 | public function preCacheTranslateObject ( ModelObject $ obj ) { $ aspectSlugs = $ obj -> getAspectSlugs ( ) ; $ schema = new NodeSchema ( ) ; if ( ! empty ( $ aspectSlugs ) ) { $ aspects = $ this -> AspectDAO -> multiGetBySlug ( $ aspectSlugs ) ; $ newAspects = array ( ) ; foreach ( $ aspects as $ aspect ) { $ aspectSc... | Sets the schema for the element |
49,007 | public function findAll ( DTO $ dto ) { if ( $ dto -> hasParameter ( $ this -> getModel ( ) -> getPrimaryKey ( ) ) || $ dto -> hasParameter ( 'Slug' ) || $ dto -> hasParameter ( 'PluginID' ) || $ dto -> getLimit ( ) != null || $ dto -> getOffset ( ) != null || $ dto -> getOrderBys ( ) != null ) { $ sd = __CLASS__ . ( s... | Finds matching elements |
49,008 | public function cd ( $ directory = null ) { if ( \ ftp_chdir ( $ this -> _stream , $ directory ) ) { return true ; } $ this -> error = "Failed to change directory to \"{$directory}\"" ; return false ; } | Change current directory on FTP server |
49,009 | public function delete ( $ remote_file = null ) { if ( \ ftp_delete ( $ this -> _stream , $ remote_file ) ) { return true ; } $ this -> error = 'Failed to delete file "' . $ remote_file . '"' ; return false ; } | Delete file on FTP server |
49,010 | public function mkdir ( $ directory = null ) { if ( \ ftp_mkdir ( $ this -> _stream , $ directory ) ) { return true ; } $ this -> error = 'Failed to create directory "' . $ directory . '"' ; return false ; } | Create directory on FTP server |
49,011 | public function rmdir ( $ directory = null ) { if ( \ ftp_rmdir ( $ this -> _stream , $ directory ) ) { return true ; } $ this -> error = 'Failed to remove directory "' . $ directory . '"' ; return false ; } | Remove directory on FTP server |
49,012 | public function execute ( ) { $ results = array ( ) ; foreach ( $ this -> benchmarks as $ benchmark ) { $ results += $ benchmark -> execute ( ) ; } return $ results ; } | Execute the registered tests and return the results |
49,013 | public function authorizedAs ( string $ user , string $ password ) : self { $ this -> headers -> putAuthorization ( $ user , $ password ) ; return $ this ; } | authorize with given credentials |
49,014 | public function usingHeader ( string $ key , $ value ) : self { $ this -> headers -> put ( $ key , $ value ) ; return $ this ; } | adds any arbitrary header |
49,015 | public function put ( string $ body , string $ version = HttpVersion :: HTTP_1_1 ) : HttpResponse { return HttpRequest :: create ( $ this -> httpUri , $ this -> headers ) -> put ( $ body , $ this -> timeout , $ version ) ; } | returns response object for given URI after PUT request |
49,016 | public function delete ( string $ version = HttpVersion :: HTTP_1_1 ) : HttpResponse { return HttpRequest :: create ( $ this -> httpUri , $ this -> headers ) -> delete ( $ this -> timeout , $ version ) ; } | returns response object for given URI after DELETE request |
49,017 | protected function registerGuest ( ) { $ this -> app -> bind ( 'guest.roles' , function ( $ app ) { return [ 'guest' ] ; } ) ; $ this -> app -> bind ( 'guest.abilities' , function ( $ app ) { return [ '*.show' ] ; } ) ; $ this -> app -> bind ( 'guest' , function ( $ app ) { return new Guest ( $ app [ 'guest.roles' ] , ... | Register a guest representing user entity which is not persistable . |
49,018 | public function flushTo ( OutputWriter $ outputWriter ) { if ( $ outputWriter === $ this ) { throw new LogicException ( 'Operation not allowed' ) ; } $ minLevel = $ outputWriter -> getLevel ( ) ; while ( ! empty ( $ this -> buffer ) ) { $ item = array_shift ( $ this -> buffer ) ; if ( $ item [ 'level' ] < $ minLevel ) ... | Send all buffered messages to another OutputWriter . Be aware that messages are removed during this process . |
49,019 | public function validateSeedProducerCode ( ErrorElement $ errorElement , $ object ) { $ code = $ object -> getSeedProducerCode ( ) ; $ container = $ this -> getConfigurationPool ( ) -> getContainer ( ) ; $ is_new = empty ( $ object -> getId ( ) ) ; if ( empty ( $ code ) ) { $ app_circles = $ container -> get ( 'librinf... | Seed producer code validator . |
49,020 | public function contains ( $ e ) { if ( ! EnumUtil :: isEnum ( $ e , $ this -> class ) ) throw new InvalidArgumentException ( sprintf ( 'Element must be an instance of %s.' , $ this -> class ) ) ; return ( $ this -> entries & $ this -> universe [ $ e -> ordinal ( ) ] ) !== 0 ; } | Returns true if this set contains the given element . |
49,021 | public function remove ( $ e ) { if ( ! EnumUtil :: isEnum ( $ e , $ this -> class ) ) throw new InvalidArgumentException ( sprintf ( 'Element must be an instance of %s.' , $ this -> class ) ) ; if ( ! $ this -> contains ( $ e ) ) return false ; $ this -> entries &= ~ $ this -> universe [ $ e -> ordinal ( ) ] ; return ... | Removes a single instance of an object from this set if it is present . |
49,022 | public static function complementOf ( EnumSet $ set ) { $ values = array ( ) ; foreach ( call_user_func ( array ( $ set -> class , 'values' ) ) as $ v ) if ( ! $ set -> contains ( $ v ) ) $ values [ ] = $ v ; return new EnumSet ( $ set -> class , $ values ) ; } | Creates a new EnumSet that is the complement of the given EnumSet . Or in other words creates an EnumSet containing all enum values that are not present in the given EnumSet . |
49,023 | public static function of ( $ class ) { if ( ! EnumUtil :: isEnumClass ( $ class ) ) throw new InvalidArgumentException ( $ class . ' is not loaded or does not extend DaybreakStudios\Common\Enum\Enum.' ) ; $ values = func_get_args ( ) ; array_shift ( $ values ) ; return new EnumSet ( $ class , $ values ) ; } | Creates a new EnumSet that contains all of the elements passed to this method after the first . |
49,024 | public static function range ( $ class , Enum $ from , Enum $ to ) { if ( ! EnumUtil :: isEnumClass ( $ class ) ) throw new InvalidArgumentException ( $ class . ' is not loaded or does not extend DaybreakStudios\Common\Enum\Enum.' ) ; else if ( ! EnumUtil :: isEnum ( $ from , $ class ) || ! EnumUtil :: isEnum ( $ to , ... | Creates an EnumSet that initially contains all of the elements between two endpoints . |
49,025 | public function get ( callable $ codeBlock = null ) { $ getValue = function ( Maybe $ value ) { return $ value -> get ( ) ; } ; return array_map ( $ getValue , parent :: get ( $ codeBlock ) ) ; } | Returns the contained collection and applies an optional code - block to each element before returning it . |
49,026 | protected static function loadFilters ( $ filters , $ options = [ ] ) { $ queue = array ( ) ; if ( ! is_array ( $ filters ) ) { $ filters = [ $ filters ] ; $ options = [ $ options ] ; } foreach ( $ filters as $ idx => $ filtername ) { $ classname = __NAMESPACE__ . "\\Types\\" . preg_replace ( "/[^A-z0-9]/" , "" , ucfir... | load needed filters |
49,027 | protected static function execFilterQueue ( $ value , array $ queue , $ type ) { foreach ( $ queue as $ filter ) { $ value = self :: executeValueMethod ( $ value , $ filter , $ type , "filter" ) ; if ( $ value === self :: ERR_INVALID ) return false ; } return $ value ; } | execute filter queue on a value |
49,028 | public function prepareParams ( $ params ) { $ values [ 'street' ] = isset ( $ params [ 'street' ] ) ? trim ( ( string ) $ params [ 'street' ] ) : null ; $ values [ 'number' ] = isset ( $ params [ 'number' ] ) ? trim ( ( string ) $ params [ 'number' ] ) : null ; $ values [ 'latitude' ] = isset ( $ params [ 'latitude' ]... | Prepare parameters . |
49,029 | public function collect ( Table $ table ) { $ this -> createTableQueries = array_merge ( $ this -> createTableQueries , $ this -> platform -> getCreateTableSQLQueries ( $ table , array ( 'foreign_key' => false ) ) ) ; foreach ( $ table -> getForeignKeys ( ) as $ foreignKey ) { $ this -> createForeignKeyQueries = array_... | Collects queries to create tables . |
49,030 | public function categories ( $ blogId , $ includeCount = true , $ onlyPopulated = true ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> select ( 'c.id,c.blog_id,c.slug,c.label' ) ; if ( $ includeCount ) { $ sql = '(SELECT COUNT(DISTINCT bpc.post_id) FROM ' . NAILS_DB_PREFIX . 'blog_post_category bpc JOIN ' ; $ ... | Returns an array of a blog s categories |
49,031 | public function tags ( $ blogId , $ includeCount = true , $ onlyPopulated = true ) { $ oDb = Factory :: service ( 'Database' ) ; $ oDb -> select ( 't.id,t.blog_id,t.slug,t.label' ) ; if ( $ includeCount ) { $ sql = '(SELECT COUNT(DISTINCT bpt.post_id) FROM ' . NAILS_DB_PREFIX . 'blog_post_tag bpt JOIN ' ; $ sql .= NAIL... | Returns an array of a blog s tags |
49,032 | public function withArgument ( $ name , $ description , array $ choices = [ ] ) { $ this -> choices [ $ name ] = $ choices ; return $ this -> addArgument ( $ name , InputArgument :: REQUIRED , $ description ) ; } | With mandatory argument |
49,033 | public function withOption ( $ name , $ description , $ default = '' , array $ choices = [ ] ) { $ this -> choices [ $ name ] = $ choices ; return $ this -> addOption ( $ name , null , InputOption :: VALUE_OPTIONAL , $ description , $ default ) ; } | With optional option |
49,034 | public function exec ( string $ command , array $ remote = [ ] , $ color = 'note-inverted' ) { if ( $ remote ) { $ path = $ remote [ 'path' ] ? $ remote [ 'path' ] : '~' ; $ command = "ssh -t -p {$remote['port']} {$remote['auth']} \"cd {$path} && {$command}\"" ; } $ this -> out -> writeln ( "\n<{$color}> {$command} </{... | Execute an command and display output |
49,035 | public function initialize ( InputInterface $ input , OutputInterface $ output ) { $ this -> in = $ input ; $ this -> out = $ output ; } | Initializes the command after the input has been bound and before the input is validated . |
49,036 | public function filter ( $ sizes ) { $ sizes = apply_filters ( Config :: KATANA_FILTER , $ sizes , $ this -> request_id ( ) ) ; return $ sizes ; } | WP default filter that runs before the images are being generated then appplies the custom filter from Katana . |
49,037 | public function setEmail ( $ email ) { if ( filter_var ( $ email , FILTER_VALIDATE_EMAIL ) ) { $ this -> _options [ 'email' ] = $ email ; $ this -> _options [ 'hash' ] = strtolower ( md5 ( trim ( $ this -> _options [ 'email' ] ) ) ) ; } else { throw new \ Exception ( 'The email is in an invalid format!' ) ; } return $ ... | Sets the email you want to use for image generation . |
49,038 | public function generateUrl ( $ type , $ email , array $ attr = [ ] ) { if ( ! empty ( $ email ) ) { $ this -> setEmail ( $ email ) ; } if ( isset ( $ attr [ 'size' ] ) ) { $ this -> setSize ( $ attr [ 'size' ] ) ; } if ( isset ( $ attr [ 'imgset' ] ) ) { $ this -> setImageSet ( $ attr [ 'imgset' ] ) ; } if ( isset ( $... | Generates the Gravatar URL . |
49,039 | public static function chmod ( $ path , $ mode = null ) { if ( $ mode ) { return chmod ( $ path , $ mode ) ; } return substr ( sprintf ( '%o' , fileperms ( $ path ) ) , - 4 ) ; } | Get or set UNIX mode of a file or directory . |
49,040 | public static function copy ( string $ source , string $ destination ) { if ( is_dir ( $ source ) ) { @ mkdir ( $ destination ) ; $ directory = dir ( $ source ) ; while ( false !== ( $ readdirectory = $ directory -> read ( ) ) ) { if ( $ readdirectory == '.' || $ readdirectory == '..' ) { continue ; } $ PathDir = $ sou... | Copy file or folder |
49,041 | public function sendRecoveryMessage ( $ user , $ token ) { $ mailVars = [ '{token}' => $ token -> url ] ; $ mailTemplate = \ Yii :: $ app -> get ( 'emailTemplates' ) -> getTemplate ( 'recovery' , Language :: getCurrent ( ) -> id ) ; $ mailTemplate -> parseSubject ( $ mailVars ) ; $ mailTemplate -> parseBody ( $ mailVar... | Sends an email to a user with recovery link . |
49,042 | public function getNodeContent ( $ xPath ) { if ( $ this -> content -> xpath ( $ xPath ) !== null ) { return ( string ) trim ( end ( $ this -> content -> xpath ( $ xPath ) ) ) ; } return false ; } | get the content or false of node . in case of fasle there is no node exists |
49,043 | public function getNodeAttribute ( $ xPath , $ atrName ) { $ res = $ this -> content -> xpath ( $ xPath ) ; if ( $ res !== null ) { foreach ( $ res as $ set ) { return ( string ) $ set [ $ atrName ] ; } } return NULL ; } | reads an spcific attribute from node |
49,044 | public function getNodeAttributeBool ( $ xPath , $ atrName , $ failReturn = false ) { $ val = $ this -> getNodeAttribute ( $ xPath , $ atrName ) ; if ( strtolower ( $ val ) === 'false' ) { return false ; } if ( strtolower ( $ val ) === 'true' ) { return true ; } if ( $ val === NULL || ! is_bool ( $ val ) ) { return $ f... | return node attribut value in boolean |
49,045 | protected function getLinks ( ) { $ html = '' ; if ( is_array ( $ this -> window [ 'first' ] ) ) { $ html .= $ this -> getUrlLinks ( $ this -> window [ 'first' ] ) ; } if ( is_array ( $ this -> window [ 'slider' ] ) ) { $ html .= $ this -> getDots ( ) ; $ html .= $ this -> getUrlLinks ( $ this -> window [ 'slider' ] ) ... | Render the actual link slider . |
49,046 | public function index ( ) : View { $ config = [ 'title' => trans ( 'HCResource::resource_grab_property.page_title' ) , 'url' => route ( 'admin.api.resource.grab.property' ) , 'form' => route ( 'admin.api.form-manager' , [ 'resource.grab.property' ] ) , 'headers' => $ this -> getTableColumns ( ) , 'actions' => [ 'search... | Admin panel page view |
49,047 | public function getOptions ( HCResourceGrabPropertyRequest $ request ) : JsonResponse { return response ( ) -> json ( $ this -> service -> getRepository ( ) -> getOptions ( $ request ) ) ; } | Create data list |
49,048 | public function addTypeExtensions ( array $ typeExtensions ) { foreach ( $ typeExtensions as $ typeExtension ) { $ this -> typeExtensions [ $ typeExtension -> getExtendedType ( ) ] [ ] = $ typeExtension ; } return $ this ; } | Adds a list of field type extension to the factory . |
49,049 | public function getSearchFactory ( ) : SearchFactory { $ extensions = $ this -> extensions ; if ( \ count ( $ this -> types ) > 0 || \ count ( $ this -> typeExtensions ) > 0 ) { $ extensions [ ] = new PreloadedExtension ( $ this -> types , $ this -> typeExtensions ) ; } $ resolvedTypeFactory = $ this -> resolvedTypeFac... | Builds and returns the factory . |
49,050 | public function watermark ( ) { $ args = func_get_args ( ) ; if ( ! count ( $ args ) ) { throw new ImageModifierException ( 'Insufficient arguments for watermarking.' ) ; } if ( ! file_exists ( realpath ( $ args [ 0 ] ) ) ) { throw new ImageModifierException ( 'Watermark file not found.' ) ; } $ todo = new \ stdClass (... | adds a watermark - command to queue |
49,051 | protected function getVarcharSQLDeclarationSnippet ( $ length , $ fixed ) { if ( ! is_int ( $ length ) || ( is_int ( $ length ) && ( $ length <= 0 ) ) ) { throw PlatformException :: invalidVarcharLength ( ) ; } if ( ! is_bool ( $ fixed ) ) { throw PlatformException :: invalidVarcharFixedFlag ( ) ; } if ( $ fixed ) { re... | Gets the varchar SQL declaration snippet . |
49,052 | protected function getTransactionIsolationSQLDeclaration ( $ isolation ) { if ( ! $ this -> supportTransactionIsolations ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } $ availableIsolations = array ( Connection :: TRANSACTION_READ_COMMITTED , Connection :: TRANSACTION_READ_UNCOMMITTED , Connec... | Gets the transaction isolation SQL declaration . |
49,053 | protected function getColumnsSQLDeclaration ( array $ columns ) { $ columnsDeclaration = array ( ) ; foreach ( $ columns as $ column ) { $ columnsDeclaration [ ] = $ this -> getColumnSQLDeclaration ( $ column ) ; } return implode ( ', ' , $ columnsDeclaration ) ; } | Gets the columns SQL declaration . |
49,054 | protected function getColumnSQLDeclaration ( Column $ column ) { $ columnDeclaration = $ column -> getName ( ) . ' ' . $ column -> getType ( ) -> getSQLDeclaration ( $ this , $ column -> toArray ( ) ) ; if ( $ column -> isNotNull ( ) ) { $ columnDeclaration .= ' NOT NULL' ; } if ( $ column -> getDefault ( ) !== null ) ... | Gets the column SQL declaration . |
49,055 | protected function getPrimaryKeySQLDeclaration ( PrimaryKey $ primaryKey ) { if ( ! $ this -> supportPrimaryKeys ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } return 'CONSTRAINT ' . $ primaryKey -> getName ( ) . ' PRIMARY KEY (' . implode ( ', ' , $ primaryKey -> getColumnNames ( ) ) . ')' ; ... | Gets the primary key SQL declaration . |
49,056 | protected function getForeignKeySQLDeclaration ( ForeignKey $ foreignKey ) { if ( ! $ this -> supportForeignKeys ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } return 'CONSTRAINT ' . $ foreignKey -> getName ( ) . ' FOREIGN KEY' . ' (' . implode ( ', ' , $ foreignKey -> getLocalColumnNames ( ) ... | Gets the foreign key SQL declaration . |
49,057 | protected function getIndexSQLDeclaration ( Index $ index ) { if ( ! $ this -> supportIndexes ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } if ( ! $ index -> isUnique ( ) ) { return 'INDEX ' . $ index -> getName ( ) . ' (' . implode ( ', ' , $ index -> getColumnNames ( ) ) . ')' ; } return 'C... | Gets the index SQL declaration . |
49,058 | protected function getCheckSQLDeclaration ( Check $ check ) { if ( ! $ this -> supportChecks ( ) ) { throw PlatformException :: methodNotSupported ( __METHOD__ ) ; } return 'CONSTRAINT ' . $ check -> getName ( ) . ' CHECK (' . $ check -> getDefinition ( ) . ')' ; } | Gets the check constraint SQL declaration . |
49,059 | protected function getCreateColumnCommentsSQLQueries ( array $ columns , $ table ) { $ queries = array ( ) ; foreach ( $ columns as $ column ) { if ( $ this -> hasCustomType ( $ column -> getType ( ) -> getName ( ) ) || ( $ column -> getComment ( ) !== null ) ) { $ queries [ ] = $ this -> getCreateColumnCommentSQLQuery... | Gets the create column comments SQL queries . |
49,060 | protected function getCreateColumnCommentSQLQuery ( Column $ column , $ table ) { return 'COMMENT ON COLUMN ' . $ table . '.' . $ column -> getName ( ) . ' IS ' . $ this -> getColumnCommentSQLDeclaration ( $ column ) ; } | Gets the create column comment SQL query . |
49,061 | protected function getColumnCommentSQLDeclaration ( Column $ column ) { $ comment = $ column -> getComment ( ) ; if ( $ this -> hasCustomType ( $ column -> getType ( ) -> getName ( ) ) ) { $ comment .= '(FridgeType::' . strtoupper ( $ column -> getType ( ) -> getName ( ) ) . ')' ; } return $ this -> quote ( $ comment )... | Gets the column comment SQL declaration . |
49,062 | protected function getAlterTableSQLQuery ( $ table , $ action , $ expression = null ) { $ alterTable = 'ALTER TABLE ' . $ table . ' ' . $ action ; return $ expression !== null ? $ alterTable . ' ' . $ expression : $ alterTable ; } | Gets an alter table SQL query . |
49,063 | public function rollback ( Node $ node , Application $ application , Deployment $ deployment , array $ options = [ ] ) { $ this -> removeFile ( rtrim ( $ application -> getReleasesPath ( ) , '/' ) . '/' . $ this -> getTargetPath ( $ options ) , $ node , $ deployment , $ options ) ; $ this -> removeFile ( rtrim ( $ depl... | Rollback this task . |
49,064 | private function createMedia ( Media $ media ) { $ request = $ this -> getRequest ( ) ; $ thumbSizes = $ this -> container -> getParameter ( 'fulgurio_light_cms.thumbs' ) ; $ form = $ this -> createForm ( new AdminMediaType ( $ this -> container ) , $ media ) ; $ formHandler = new AdminMediaHandler ( ) ; $ formHandler ... | Create form for media entity use for edit or add a media |
49,065 | public function removeAction ( $ mediaId ) { $ media = $ this -> getMedia ( $ mediaId ) ; $ request = $ this -> getRequest ( ) ; if ( $ request -> request -> get ( 'confirm' ) === 'yes' || $ request -> get ( 'confirm' ) === 'yes' ) { $ this -> get ( 'fulgurio_light_cms.media_library' ) -> remove ( $ media ) ; $ em = $ ... | Remove media with confirm form |
49,066 | public function wysiwygMediaAction ( ) { $ form = $ this -> createForm ( new AdminMediaType ( $ this -> container ) , new Media ( ) ) ; return $ this -> render ( 'FulgurioLightCMSBundle:AdminMedia:wysiwygAdd.html.twig' , array ( 'form' => $ form -> createView ( ) , 'wysiwyg' => $ this -> getWysiwyg ( ) ) ) ; } | Wysiwyg media popup |
49,067 | public function wysiwygLinkAction ( ) { $ form = $ this -> createForm ( new AdminMediaType ( $ this -> container ) , new Media ( ) ) ; return $ this -> render ( 'FulgurioLightCMSBundle:AdminMedia:wysiwygAdd.html.twig' , array ( 'form' => $ form -> createView ( ) , 'wysiwyg' => $ this -> getWysiwyg ( ) , 'isLink' => TRU... | Wysiwyg link popup |
49,068 | private function getWysiwyg ( ) { $ wysiwygName = $ this -> container -> getParameter ( 'fulgurio_light_cms.wysiwyg' ) ; if ( $ wysiwygName && $ this -> container -> hasParameter ( $ wysiwygName ) ) { return $ this -> container -> getParameter ( $ wysiwygName ) ; } else { return NULL ; } } | Get specified wysiwig with configuration if set |
49,069 | private function jsonResponse ( $ data ) { $ response = new Response ( json_encode ( $ data ) ) ; $ response -> headers -> set ( 'Content-Type' , 'application/json' ) ; return $ response ; } | Return a JSON response |
49,070 | public function getPopularTags ( ) { $ question = $ this -> findAll ( ) ; $ tagsMultiArray = array_map ( function ( $ question ) { return explode ( ',' , $ question -> tags ) ; } , $ question ) ; $ tagArr = array_count_values ( call_user_func_array ( "array_merge" , $ tagsMultiArray ) ) ; arsort ( $ tagArr ) ; return $... | Returns array of tags keys are name value is the integer of how many . |
49,071 | private function getKey ( $ key = NULL ) { if ( $ key === NULL ) { $ key = $ this -> __keyName ; return $ this -> getClassKey ( ) . '_' . $ this -> $ key ; } return $ this -> getClassKey ( ) . '_' . $ key ; } | returns the key for scope cache |
49,072 | public function applyData ( $ data = NULL ) { parent :: applyData ( $ data ) ; if ( $ data != null ) { self :: $ propData [ $ this -> getKey ( ) ] = $ this ; self :: $ keyCache [ $ this -> getClassKey ( ) ] = $ this -> __keyName ; $ key = $ this -> __keyName ; self :: $ __ids [ $ this -> getClassKey ( ) ] [ $ this -> $... | ovewrite parent becasue of catching all props |
49,073 | public function getProps ( $ id ) { if ( isset ( self :: $ propData [ $ this -> getKey ( $ id ) ] ) ) { return self :: $ propData [ $ this -> getKey ( $ id ) ] ; } return NULL ; } | returns the content by the id if these already builded . if not is returns NULL |
49,074 | public function fetch ( $ id ) { if ( isset ( self :: $ propData [ $ this -> getKey ( $ id ) ] ) ) { return self :: $ propData [ $ this -> getKey ( $ id ) ] ; } return false ; } | fetch data if exists so the current object is exchanges |
49,075 | private function copyProps ( self $ source ) { foreach ( $ source as $ keyName => $ data ) { if ( substr ( $ keyName , 0 , 2 ) !== '__' ) { $ this -> $ keyName = $ data ; } } } | copy propertie to self |
49,076 | public function preprocess ( $ pSaxReferenceString , array $ pSaxAnalysisStrings ) { $ this -> referenceSuffixTree = new SuffixTree ( $ pSaxReferenceString ) ; foreach ( $ pSaxAnalysisStrings as $ anaString ) { $ anaTree = new SuffixTree ( $ anaString ) ; $ this -> annotateSurpriseValues ( $ this -> referenceSuffixTree... | Creates the suffix trees for the given reference string and the strings under analysis . Annotates the occurences of each substring in the corresponding node of the tree . |
49,077 | public function computeStatistics ( array $ pTimeSeries ) { $ statistics = array ( 'min' => 0 , 'max' => 0 , 'stdDev' => 0 , 'mean' => 0 , 'sum' => 0 , 'size' => count ( $ pTimeSeries ) ) ; foreach ( $ pTimeSeries as $ entry ) { if ( $ entry [ 'count' ] < $ statistics [ 'min' ] ) { $ statistics [ 'min' ] = $ entry [ 'c... | Calculates the minimum maximum standard deviation mean sum and the size of the given time series . It must contain the key count for each entry . |
49,078 | public function discretizeTimeSeries ( array $ pTimeSeries , $ pFeatureWindowLength = 1 ) { $ nrOfBreakpoints = $ this -> alphabetSize - 1 ; $ breakpoints = $ this -> breakpoints [ $ nrOfBreakpoints ] ; $ saxWord = "" ; for ( $ i = 0 ; $ i < count ( $ pTimeSeries ) ; $ i += $ pFeatureWindowLength ) { $ datapoint = $ pT... | Discretizes a given time series to a sax word i . e . a sequence of characters indicating the amplitude of the time series . |
49,079 | public function annotateSurpriseValues ( & $ pReferenceTree , & $ pAnalysisTree ) { $ this -> annotateNode ( $ pReferenceTree , $ pAnalysisTree , $ pAnalysisTree -> nodes [ $ pAnalysisTree -> root ] , "" ) ; } | Annotates surprise values at each node of the analysis tree in context of the reference tree |
49,080 | public static function init ( $ args = null ) { if ( is_null ( self :: $ instance ) ) { self :: $ instance = new ErrorClass ( $ args ) ; } return self :: $ instance ; } | args can be array|object . noEmailErrs development noHtml noOutput errType |
49,081 | public static function createQuery ( $ modelClass , $ ignore = [ ] ) { $ model = $ modelClass :: find ( ) ; $ wheres = [ 'and' ] ; $ filter_fields = self :: getQueryParams ( $ ignore ) ; $ condition_transform_functions = self :: conditionTransformFunctions ( ) ; foreach ( $ filter_fields as $ key => $ value ) { if ( $ ... | Create the query to check for relations and filtering |
49,082 | public static function addOrderSort ( $ sort , $ table , & $ query ) { if ( ! empty ( $ sort ) ) { $ sorts = explode ( ',' , $ sort ) ; foreach ( $ sorts as $ sort ) { if ( ! strpos ( $ sort , '.' ) ) { preg_match ( '/\w+\s+(DESC|ASC)/' , $ sort , $ sort_field ) ; $ type = ! empty ( $ sort_field ) ? trim ( $ sort_field... | Add a sort if there is a sort oder requested . |
49,083 | public static function addGroup ( $ group , $ table , & $ query ) { if ( ! empty ( $ group ) ) { $ groups = explode ( ',' , $ group ) ; foreach ( $ groups as $ group ) { if ( ! strpos ( $ group , '.' ) ) { $ query -> groupBy ( $ table . '.' . $ group ) ; } else { $ query -> groupBy ( $ group ) ; } } } } | Add a group by functionality to the query builder |
49,084 | public function save ( Model \ EnvironmentInterface $ environment , Model \ EnvironmentInterface $ cloneFrom = null ) { $ content = $ this -> getEnvironmentHydrator ( ) -> extract ( $ environment ) ; if ( $ cloneFrom != null ) { $ content [ 'cloneFrom' ] = strval ( $ cloneFrom -> getNormalizedName ( ) ) ; } $ this -> p... | Create or update an environment on the Puppet Master |
49,085 | public function remove ( Model \ EnvironmentInterface $ environment ) { $ this -> pmProxyClient -> delete ( '/environments/' . $ environment -> getNormalizedName ( ) ) ; if ( $ environment -> hasChildren ( ) ) { foreach ( $ environment -> getChildren ( ) as $ child ) { $ this -> remove ( $ child ) ; } } return $ this ;... | Remove an environment on the Puppet Master |
49,086 | public function findIdUrl ( $ id , $ url ) { return $ this -> getModel ( ) -> where ( 'id' , $ id ) -> where ( 'slug_url' , $ url ) -> first ( ) ; } | BUSCAR POR ID Y URL |
49,087 | public function orderByPagination ( $ field , $ order , $ value ) { return $ this -> getModel ( ) -> orderBy ( $ field , $ order ) -> paginate ( $ value ) ; } | ORDERNAR Y PAGINAR |
49,088 | public function findAndPaginateDeletes ( Request $ request ) { return $ this -> getModel ( ) -> onlyTrashed ( ) -> titulo ( $ request -> get ( 'titulo' ) ) -> orderBy ( 'deleted_at' , 'desc' ) -> paginate ( ) ; } | BUSQUEDAS DE REGISTROS ELIMINADOS |
49,089 | static function construct ( ) { $ aniDbTitles = new AniDbTitles ( ) ; $ aniDbTitles -> db = Registry :: getDatabase ( ) ; $ aniDbTitles -> model = $ aniDbTitles -> db -> factory ( '@' . $ aniDbTitles -> table ) ; return $ aniDbTitles ; } | Creates a new AniDbTitles instance |
49,090 | public function syncDatabase ( ) { $ tmpname = '/tmp/odango.php.cache' ; if ( ! file_exists ( $ tmpname ) ) { $ curl = new Curl ( ) ; $ curl -> setOpt ( CURLOPT_ENCODING , "gzip" ) ; $ curl -> download ( $ this -> titleDumpUrl , $ tmpname ) ; $ curl -> close ( ) ; } $ this -> db -> exec ( 'START TRANSACTION' ) ; $ this... | Syncs the database with the up - to - date anidb title dump |
49,091 | public function getAlternativeTitles ( $ title ) { $ builder = $ this -> db -> builder ( ) ; return $ builder -> select ( 'search.title' ) -> from ( [ $ this -> table . ' as main' ] ) -> join ( $ this -> table . ' as search' , 'main."aniDbId" = search."aniDbId"' ) -> where ( 'main.title = :title' ) -> queryColumn ( [ '... | Gets all alternative titles for the title given |
49,092 | public function add ( $ name , $ value = null ) { if ( empty ( $ name ) ) { return $ this ; } $ params = ( ! is_array ( $ name ) ? array ( $ name => $ value ) : $ name ) ; $ query = $ this -> query ( true ) ; foreach ( $ params as $ key => $ val ) { if ( empty ( $ val ) ) { unset ( $ query [ $ key ] ) ; } elseif ( ! em... | Add replace or remove parameters from query url . |
49,093 | public function init ( $ url = null ) { $ url = ( empty ( $ url ) ? Server :: getInstance ( ) -> getCurrentUri ( ) : $ url ) ; $ this -> url = parse_url ( $ url ) ; return $ this ; } | Initialize object properties . |
49,094 | public function query ( $ array = false ) { $ query = ( ! empty ( $ this -> url [ 'query' ] ) ? $ this -> url [ 'query' ] : '' ) ; if ( $ array ) { parse_str ( $ query , $ query ) ; return $ query ; } else { return $ query ; } } | Return query url . |
49,095 | public function setPath ( $ path , $ type = 'replace' , $ replace = '' ) { $ oldPath = ( ! empty ( $ this -> url [ 'path' ] ) ? $ this -> url [ 'path' ] : '' ) ; switch ( $ type ) { case 'add' : $ path = $ oldPath . $ path ; break ; case 'remove' : $ path = str_replace ( $ path , '' , $ oldPath ) ; break ; case 'replac... | Add or replace path |
49,096 | public function uri ( ) { $ uri = ( ! empty ( $ this -> url [ 'scheme' ] ) ? $ this -> url [ 'scheme' ] . '://' : Server :: getInstance ( ) -> get ( 'scheme' , '' ) ) ; $ uri .= ( ! empty ( $ this -> url [ 'user' ] ) ? $ this -> url [ 'user' ] . ':' . $ this -> url [ 'pass' ] . '@' : '' ) ; $ uri .= ( ! empty ( $ this ... | Get formatted uri . |
49,097 | public function getUrlPK ( ) { if ( $ this -> urlPK == null ) { $ this -> urlPK = $ this -> getPrimaryKey ( ) ; } return $ this -> urlPK ; } | The name of the field used as a foreign key in other tables |
49,098 | protected function loadConfiguration ( array $ config , ContainerBuilder $ container ) { $ routeConfigurationChain = $ container -> findDefinition ( 'lp_factory.route_configuration.chain' ) ; foreach ( $ config [ 'routes' ] as $ alias => $ routeConfiguration ) { $ routeConfigurationChain -> addMethodCall ( 'add' , arra... | Load configuration in container |
49,099 | public function filterByLanguagePresets ( $ queryResult , array $ presets ) { $ result = $ queryResult ; if ( ! empty ( $ presets ) ) { $ sysLanguageUid = $ this -> languageService -> getSysLanguageUid ( ) ; $ preset = intval ( $ presets [ $ sysLanguageUid ] ) ; if ( isset ( $ preset ) ) { $ result = [ ] ; foreach ( $ ... | Filters a query result by language presets . |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.