idx int64 0 60.3k | question stringlengths 99 4.85k | target stringlengths 5 718 |
|---|---|---|
8,100 | public function withTablePrefix ( string $ prefix ) : self { return new static ( $ this -> connection , $ this -> grammar , new TablePrefixer ( $ prefix ) ) ; } | Makes a self copy with the same dependencies instances but with another table prefix . |
8,101 | public function withTablesPrefixed ( string $ prefix ) : self { return new static ( $ this -> connection , $ this -> grammar , new TablePrefixer ( $ prefix . $ this -> tablePrefixer -> tablePrefix ) ) ; } | Makes a self copy with the same dependencies instances but with added table prefix . |
8,102 | public function isDisabled ( \ n2n \ log4php \ LoggerLevel $ level ) { return ( $ this -> threshold -> toInt ( ) > $ level -> toInt ( ) ) ; } | Returns true if the hierarchy is disabled for given log level and false otherwise . |
8,103 | public function resetConfiguration ( ) { $ root = $ this -> getRootLogger ( ) ; $ root -> setLevel ( \ n2n \ log4php \ LoggerLevel :: getLevelDebug ( ) ) ; $ this -> setThreshold ( \ n2n \ log4php \ LoggerLevel :: getLevelAll ( ) ) ; $ this -> shutDown ( ) ; foreach ( $ this -> loggers as $ logger ) { $ logger -> setLe... | Reset all values contained in this hierarchy instance to their default . |
8,104 | protected function hashKey ( $ key ) { if ( $ key instanceof \ DateTime ) { return md5 ( '_' . $ key -> format ( 'c' ) ) ; } elseif ( is_object ( $ key ) ) { return spl_object_hash ( $ key ) ; } elseif ( false === $ key ) { return md5 ( '_false' ) ; } elseif ( true === $ key ) { return md5 ( '_true' ) ; } elseif ( null... | Hash a key . |
8,105 | public static function buildQuery ( $ queryData ) { $ query = '' ; foreach ( $ queryData as $ key => $ value ) { if ( is_array ( $ value ) ) { foreach ( $ value as $ value2 ) { if ( $ query !== '' ) { $ query .= '&' ; } $ query .= self :: buildQuery ( array ( $ key => $ value2 ) ) ; } } else { if ( $ query !== '' ) { $... | Build a query string from query data |
8,106 | protected function process ( ) { $ this -> result = $ this -> getRequest ( ) -> getResponse ( ) ; $ contentType = $ this -> result -> getContentType ( ) ; if ( stripos ( $ contentType , 'xml' ) === false ) { throw new \ Exception ( 'The Response is not in a valid XML Content Type.' ) ; } $ body = trim ( $ this -> resul... | Create the result of the command after the request has been completed . We expect the response to be an XML so this method converts the repons to a SimpleXMLElement object . Also exceptions are thrown accordingly . |
8,107 | protected function build ( ) { $ this -> rawXml = $ this -> buildXML ( ) ; $ this -> client -> setDefaultOption ( 'headers' , array ( 'Content-Type' => 'application/x-www-form-urlencoded' ) ) ; $ this -> request = $ this -> client -> post ( null , null , array ( "xml" => ( $ this -> rawXml -> saveXML ( ) ) ) ) ; } | Prepares the request to the API . |
8,108 | public function buildXML ( ) { $ xml = new EncodingRequest ( ) ; $ request = $ xml -> setDomQuery ( $ this -> client -> getConfig ( 'userid' ) , $ this -> client -> getConfig ( 'userkey' ) , $ this -> getName ( ) ) ; foreach ( $ this -> getOperation ( ) -> getParams ( ) as $ name => $ arg ) { if ( $ this -> get ( $ nam... | Builds the XML for the request body . |
8,109 | public function getResponseBody ( $ encodeEntities = true ) { $ body = ( string ) $ this -> getResponse ( ) -> getBody ( ) ; if ( $ encodeEntities ) { return htmlentities ( $ body ) ; } return $ body ; } | Returns the response body by default with encoded HTML entities as string . |
8,110 | protected function setBoolean ( $ property , $ value ) { try { $ this -> $ property = \ n2n \ log4php \ option \ OptionConverter :: toBooleanEx ( $ value ) ; } catch ( \ Exception $ ex ) { $ value = var_export ( $ value , true ) ; $ this -> warn ( "Invalid value given for '$property' property: [$value]. Expected a bool... | Setter function for boolean type . |
8,111 | protected function setLevel ( $ property , $ value ) { try { $ this -> $ property = \ n2n \ log4php \ option \ OptionConverter :: toLevelEx ( $ value ) ; } catch ( \ Exception $ ex ) { $ value = var_export ( $ value , true ) ; $ this -> warn ( "Invalid value given for '$property' property: [$value]. Expected a level va... | Setter function for LoggerLevel values . |
8,112 | protected function setFileSize ( $ property , $ value ) { try { $ this -> $ property = \ n2n \ log4php \ option \ OptionConverter :: toFileSizeEx ( $ value ) ; } catch ( \ Exception $ ex ) { $ value = var_export ( $ value , true ) ; $ this -> warn ( "Invalid value given for '$property' property: [$value]. Expected a fi... | Setter for file size . |
8,113 | protected function setNumeric ( $ property , $ value ) { try { $ this -> $ property = \ n2n \ log4php \ option \ OptionConverter :: toNumericEx ( $ value ) ; } catch ( \ Exception $ ex ) { $ value = var_export ( $ value , true ) ; $ this -> warn ( "Invalid value given for '$property' property: [$value]. Expected a numb... | Setter function for numeric type . |
8,114 | protected function setString ( $ property , $ value , $ nullable = false ) { if ( $ value === null ) { if ( $ nullable ) { $ this -> $ property = null ; } else { $ this -> warn ( "Null value given for '$property' property. Expected a string. Property not changed." ) ; } } else { try { $ value = \ n2n \ log4php \ option... | Setter function for string type . |
8,115 | public function processFormSubmit ( $ form ) { $ date = DateUtil :: getDateTime ( ) ; $ attributes = parent :: getFormAttributes ( ) ; $ fields = $ attributes [ 'fields' ] ; $ attribs = [ ] ; $ user = Yii :: $ app -> user -> getIdentity ( ) ; $ formSubmit = new FormSubmit ( ) ; $ formSubmit -> formId = $ form -> id ; $... | Process the submitted form and save all the form fields except captcha field . |
8,116 | public static function filterLike ( QueryBuilder $ queryBuilder , & $ criteria , $ field , $ alias = 'o' ) { if ( isset ( $ criteria [ $ field ] ) ) { if ( ! empty ( $ criteria [ $ field ] ) ) { $ queryBuilder -> andWhere ( sprintf ( '%s.%s LIKE :%s' , $ alias , $ field , $ field ) ) -> setParameter ( $ field , '%' . $... | Filter a field with LIKE sql function |
8,117 | public static function filterEnumByName ( QueryBuilder $ queryBuilder , & $ criteria , $ field , $ enumTypeName , $ isJoined = false , $ alias = 'o' ) { if ( isset ( $ criteria [ $ field ] ) ) { if ( ! empty ( $ criteria [ $ field ] ) ) { if ( ! $ isJoined ) { $ queryBuilder -> join ( sprintf ( '%s.%s' , $ alias , $ fi... | Filter an enumerator field from PositibeEnumBundle |
8,118 | public static function filterRangeDate ( QueryBuilder $ queryBuilder , & $ criteria , $ field , $ fieldFrom , $ fieldTo , $ alias = 'o' ) { if ( isset ( $ criteria [ $ fieldFrom ] ) || isset ( $ criteria [ $ fieldTo ] ) && $ criteria [ $ fieldTo ] != '' ) { if ( ! empty ( $ criteria [ $ fieldFrom ] ) ) { $ from = $ cri... | Filter a datetime field by a range |
8,119 | public static function filterToOneField ( QueryBuilder $ queryBuilder , & $ criteria , $ field , $ toOneField , $ isJoined = false , $ alias = 'o' , $ aliasField = null ) { if ( isset ( $ criteria [ $ field ] ) ) { if ( ! empty ( $ criteria [ $ field ] ) ) { if ( ! $ isJoined ) { $ queryBuilder -> join ( sprintf ( '%s.... | Filter a field thar has its to one relation with LIKE %x% |
8,120 | public function mergeValuesBase ( array $ values ) : void { if ( array_key_exists ( $ this -> name , $ values ) ) { $ this -> setValuesBase ( $ values ) ; } } | Sets the value of the checked radio button . |
8,121 | private function labelAttributes ( array $ option ) : array { $ attributes = [ ] ; if ( is_array ( $ this -> labelAttributesMap ) ) { foreach ( $ this -> labelAttributesMap as $ key => $ name ) { if ( isset ( $ option [ $ key ] ) ) $ attributes [ $ name ] = $ option [ $ key ] ; } } return $ attributes ; } | Returns the attributes for the label element . |
8,122 | public static function addRow ( DetailTable $ table , $ header , ? string $ value , ? string $ format = null ) : void { $ date = \ DateTime :: createFromFormat ( 'Y-m-d H:i:s' , $ value ) ; if ( $ date ) { $ table -> addRow ( $ header , [ 'class' => 'date' , 'data-value' => $ date -> format ( 'Y-m-d H:i:s' ) ] , $ date... | Adds a row with a datetime value to a detail table . |
8,123 | public function call ( $ webServiceName , $ inputData = null , $ version = null ) { if ( is_null ( $ version ) ) { $ version = $ this -> getVersion ( ) ; } $ token = uniqid ( "CALL_" ) ; if ( $ this -> isSymfony ( ) ) { $ eventDispatcher = $ this -> symfonyContainer -> get ( "event_dispatcher" ) ; } if ( ( $ inputData ... | Call a webService |
8,124 | protected function checkType ( $ value , $ type , $ allowedClassNames , $ errorCode ) { if ( $ type && $ value && gettype ( $ value ) != $ type ) throw new WebServiceException ( "Should be a $type" . ", but it's a " . gettype ( $ value ) , $ errorCode ) ; if ( ! $ value && count ( $ allowedClassNames ) > 0 ) { throw ne... | Check json schema type validity using symfony2 Validation system return the error message if any or false |
8,125 | protected function translateException ( $ store ) { if ( ! $ this -> isSymfony ( ) || ! $ this -> symfonyContainer ) return null ; $ translator = $ this -> getSymfonyTranslator ( ) ; $ translatedMessage = $ translator -> trans ( $ store -> getCode ( ) , array ( ) , 'messages' , $ translator -> getLocale ( ) ) ; if ( $ ... | Uses the exception code to try to found a translation for the exception if found will override the message on the exception if not found will leave the message as it it |
8,126 | public static function add ( \ n2n \ log4php \ LoggerAppender $ appender ) { $ name = $ appender -> getName ( ) ; if ( empty ( $ name ) ) { throw new \ n2n \ log4php \ LoggerException ( 'log4php: Cannot add unnamed appender to pool.' , E_USER_WARNING ) ; return ; } if ( isset ( self :: $ appenders [ $ name ] ) ) { thro... | Adds an appender to the pool . The appender must be named for this operation . |
8,127 | public function upload ( $ id , Request $ request ) { $ entity = $ this -> getQuery ( ) -> where ( 'id' , $ id ) -> first ( ) ; if ( ! $ entity ) { return $ this -> response ( [ ] , Response :: HTTP_NOT_FOUND ) ; } $ manager = $ this -> getManager ( ) ; if ( $ request -> file ( 'file' ) === null ) { return $ this -> er... | The attributes that are fillable . |
8,128 | protected function error ( $ error , array $ details = [ ] ) : array { $ error = ParamError :: fromData ( $ error , $ details ) ; return [ null , [ $ error -> id ( ) => $ error ] ] ; } | helper function to return null and one error |
8,129 | public function migrateToVersion ( $ version , $ up = true ) { $ this -> createIfNotExists ( ) ; $ currentVersion = $ this -> getCurrentVersion ( ) ; if ( $ up ) { $ this -> up ( $ version ) ; } else { $ this -> down ( $ version ) ; } } | Migrare to given version . |
8,130 | public function getVersions ( ) { $ this -> createIfNotExists ( ) ; $ sql = 'SELECT version FROM schema_migration ORDER BY version DESC' ; $ versions = array ( ) ; foreach ( $ this -> connection -> query ( $ sql ) as $ row ) { $ versions [ ] = $ row [ 'version' ] ; } return $ versions ; } | Get all versions of migrations . |
8,131 | private function createIfNotExists ( ) { $ table = new Table ( 'schema_migration' ) ; if ( $ this -> info -> isTableExists ( $ table ) ) { return ; } $ primaryKey = new PrimaryKey ( array ( 'version' ) ) ; $ primaryKey -> disableAutoIncrement ( ) ; $ table -> addConstraint ( $ primaryKey ) ; $ table -> addColumn ( new ... | Create schema table if not exists . |
8,132 | private function reportError ( string $ errorId = null ) { $ reportError = $ this -> reportError ; $ reportError ( ( null === $ errorId ) ? ( $ this -> defaultErrorId ) : ( $ errorId ) ) ; } | reports the error |
8,133 | public function offsetSet ( $ element , $ value ) { $ map = $ this -> getMap ( ) ; if ( $ value ) { $ map [ $ element ] = true ; } else { unset ( $ map [ $ element ] ) ; } } | Set the value for an element |
8,134 | public function containsAll ( $ elements ) { foreach ( $ elements as $ element ) { if ( false === $ this -> contains ( $ element ) ) { return false ; } } return true ; } | Returns true if the set contains all of the specified elements . |
8,135 | public function retainAll ( $ elements ) { if ( $ elements instanceof CollectionInterface ) { $ elements = $ elements -> toArray ( ) ; } $ this -> clear ( ) -> addAll ( $ elements ) ; return $ this ; } | Retains only the elements in the set that are contained in the specified collection . |
8,136 | public function getViolations ( $ ignoredVioltations = null ) { if ( ! $ this -> isValidated ( ) ) throw new StoreException ( "You must call validate() method before." , StoreException :: STORE_002 ) ; if ( ! is_array ( $ ignoredVioltations ) ) { return $ this -> violations ; } $ violations = array ( ) ; foreach ( $ th... | Return validation violations |
8,137 | public function serialize ( $ includePrivate = false , $ includeInternal = true , $ removeNullValues = false , $ dateAsISO8601 = false ) { $ answer = array ( ) ; $ schema = $ this -> _jsonSchema ; foreach ( $ schema [ 'definition' ] as $ property => $ definition ) { $ method = 'get' . ucfirst ( $ property ) ; if ( $ de... | Serilize the Store |
8,138 | public function getFullUrl ( string $ name = '' ) { if ( ! isset ( $ this -> media [ 0 ] ) ) { return null ; } return $ this -> media [ 0 ] -> disk === 's3' ? $ this -> media [ 0 ] -> getTemporaryUrl ( new \ DateTime ( '+1 hour' ) ) : $ this -> media [ 0 ] -> getFullUrl ( $ name ) ; } | Get the full url to a original media file . |
8,139 | public function downloadable ( ) { $ media = $ this -> media [ 0 ] ; if ( $ media -> disk === 's3' ) { return $ media -> getTemporaryUrl ( new \ DateTime ( '+1 hour' ) ) ; } if ( in_array ( $ media -> disk , [ 'local' , 'public' ] , true ) ) { return $ media -> getPath ( ) ; } return $ media -> getFullUrl ( ) ; } | Get url downloadable . |
8,140 | public function value ( string $ paramName ) : Value { return Value :: of ( $ this -> params [ $ paramName ] ?? null ) ; } | returns raw value of parameter or null if not set |
8,141 | public function errors ( ) : ParamErrors { if ( null === $ this -> errors ) { $ this -> errors = new ParamErrors ( ) ; } return $ this -> errors ; } | returns error collection for request parameters |
8,142 | public function validate ( Control $ control ) : bool { $ value = $ control -> getSubmittedValue ( ) ; if ( $ value === '' || $ value === null || $ value === false ) { return true ; } if ( ! is_scalar ( $ value ) ) { return false ; } $ url = filter_var ( $ value , FILTER_VALIDATE_URL ) ; if ( $ url !== $ value ) { retu... | Returns true if the value of the form control is a valid http URL . |
8,143 | public function dispatch ( Message $ message ) : void { $ this -> messages [ ] = $ message ; $ context = $ message -> context ?? [ ] ; $ this -> logger -> debug ( $ message -> message , $ context ) ; } | Dispatches a Message to the Message Bus . |
8,144 | public function getAuthorizationUrl ( $ scopes = [ ] ) { $ this -> provider ; $ authorizationUrl = $ this -> provider -> getAuthorizationUrl ( [ 'scope' => join ( ' ' , $ scopes ) ] ) ; $ _SESSION [ 'oauth2_lockme_state' ] = $ this -> provider -> getState ( ) ; return $ authorizationUrl ; } | Generate authorization URL |
8,145 | public function getTokenForCode ( $ code , $ state ) { if ( $ state != $ _SESSION [ 'oauth2_lockme_state' ] ) { unset ( $ _SESSION [ 'oauth2_lockme_state' ] ) ; throw new \ Exception ( "Wrong state" ) ; } unset ( $ _SESSION [ 'oauth2_lockme_state' ] ) ; $ this -> accessToken = $ this -> provider -> getAccessToken ( 'au... | Get Access token from AuthCode |
8,146 | public function refreshToken ( $ accessToken = null ) { $ accessToken = $ accessToken ? : $ this -> accessToken ; $ this -> accessToken = $ this -> provider -> getAccessToken ( 'refresh_token' , [ 'refresh_token' => $ accessToken -> getRefreshToken ( ) ] ) ; return $ this -> accessToken ; } | Refresh access token |
8,147 | public function setDefaultAccessToken ( $ token ) { if ( is_string ( $ token ) ) { $ this -> accessToken = new AccessToken ( json_decode ( $ token , true ) ) ; } elseif ( $ token instanceof AccessToken ) { $ this -> accessToken = $ token ; } else { throw new \ Exception ( "Incorrect access token" ) ; } if ( $ this -> a... | Create default access token |
8,148 | public function Reservation ( $ roomId , $ id , $ accessToken = null ) { return $ this -> provider -> executeRequest ( "GET" , "/room/{$roomId}/reservation/{$id}" , $ accessToken ? : $ this -> accessToken ) ; } | Get reservation data |
8,149 | public function AddReservation ( $ data , $ accessToken = null ) { if ( ! $ data [ 'roomid' ] ) { throw new \ Exception ( "No room ID" ) ; } if ( ! $ data [ "date" ] ) { throw new \ Exception ( "No date" ) ; } if ( ! $ data [ "hour" ] ) { throw new \ Exception ( "No hour" ) ; } return $ this -> provider -> executeReque... | Add new reservation |
8,150 | public function GetMessage ( $ messageId , $ accessToken = null ) { return $ this -> provider -> executeRequest ( "GET" , "/message/{$messageId}" , $ accessToken ? : $ this -> accessToken ) ; } | Get callback message details |
8,151 | public function MarkMessageRead ( $ messageId , $ accessToken = null ) { return $ this -> provider -> executeRequest ( "POST" , "/message/{$messageId}" , $ accessToken ? : $ this -> accessToken ) ; } | Mark callback message as read |
8,152 | public function sortOrder1 ( int $ sortOrder , bool $ descendingFlag = false ) : void { $ this -> sortDirection = ( $ descendingFlag ) ? 'desc' : 'asc' ; $ this -> sortOrder = $ sortOrder ; } | Sets the sorting order of the first table column . |
8,153 | public function sortOrder2 ( int $ sortOrder , bool $ descendingFlag = false ) : void { $ this -> sortDirection2 = ( $ descendingFlag ) ? 'desc' : 'asc' ; $ this -> sortOrder2 = $ sortOrder ; } | Sets the sorting order of second table column . |
8,154 | public function dispatch ( CommandInterface $ command , bool $ qeueEvents = false ) : void { try { if ( $ command instanceof CommandInterface ) { $ this -> aggregates = [ ] ; $ handlerClass = $ command -> getHandlerClass ( ) ; $ handler = new $ handlerClass ( $ this -> messageBus , $ this -> aggregateFactory ) ; if ( $... | This function is used to dispatch a provided Command . |
8,155 | public function getDevices ( ) { $ devices = array ( ) ; foreach ( $ this -> getChatMembers ( ) as $ chatMember ) { $ devicesObject = $ chatMember -> getDevices ( ) ; foreach ( $ devicesObject as $ do ) { $ devices [ ] = $ do ; } } return $ devices ; } | Devuelve los dispositivos de todos los usuarios vinculados al Chat |
8,156 | public static function verify ( string $ hash , string $ password ) : bool { return \ hash_equals ( $ hash , \ crypt ( $ password , $ hash ) ) ; } | this will be used to compare a password against a hash |
8,157 | public function info ( $ message , $ throwable = null ) { $ this -> log ( \ n2n \ log4php \ LoggerLevel :: getLevelInfo ( ) , $ message , $ throwable ) ; } | Log a message object with the INFO Level . |
8,158 | public function error ( $ message , $ throwable = null ) { $ this -> log ( \ n2n \ log4php \ LoggerLevel :: getLevelError ( ) , $ message , $ throwable ) ; } | Log a message object with the ERROR level . |
8,159 | public function fatal ( $ message , $ throwable = null ) { $ this -> log ( \ n2n \ log4php \ LoggerLevel :: getLevelFatal ( ) , $ message , $ throwable ) ; } | Log a message object with the FATAL level . |
8,160 | public function log ( \ n2n \ log4php \ LoggerLevel $ level , $ message , $ throwable = null ) { if ( $ this -> isEnabledFor ( $ level ) ) { $ event = new \ n2n \ log4php \ logging \ LoggingEvent ( $ this -> fqcn , $ this , $ level , $ message , null , $ throwable ) ; $ this -> callAppenders ( $ event ) ; } if ( isset ... | Log a message using the provided logging level . |
8,161 | public function logEvent ( \ n2n \ log4php \ logging \ LoggingEvent $ event ) { if ( $ this -> isEnabledFor ( $ event -> getLevel ( ) ) ) { $ this -> callAppenders ( $ event ) ; } if ( isset ( $ this -> parent ) && $ this -> getAdditivity ( ) ) { $ this -> parent -> logEvent ( $ event ) ; } } | Logs an already prepared logging event object . |
8,162 | public function forcedLog ( $ fqcn , $ throwable , \ n2n \ log4php \ LoggerLevel $ level , $ message ) { $ event = new \ n2n \ log4php \ logging \ LoggingEvent ( $ fqcn , $ this , $ level , $ message , null , $ throwable ) ; $ this -> callAppenders ( $ event ) ; if ( isset ( $ this -> parent ) && $ this -> getAdditivit... | This method creates a new logging event and logs the event without further checks . |
8,163 | public function isAttached ( \ n2n \ log4php \ LoggerAppender $ appender ) { return isset ( $ this -> appenders [ $ appender -> getName ( ) ] ) ; } | Checks whether an appender is attached to this logger instance . |
8,164 | public static function getHierarchy ( ) { if ( ! isset ( self :: $ hierarchy ) ) { self :: $ hierarchy = new \ n2n \ log4php \ LoggerHierarchy ( new LoggerRoot ( ) ) ; } return self :: $ hierarchy ; } | Returns the hierarchy used by this Logger . |
8,165 | private static function getConfigurator ( $ configurator = null ) { if ( $ configurator === null ) { return new \ n2n \ log4php \ configurator \ ConfiguratorDefault ( ) ; } if ( is_object ( $ configurator ) ) { if ( $ configurator instanceof \ n2n \ log4php \ LoggerConfigurator ) { return $ configurator ; } else { thro... | Creates a logger configurator instance based on the provided configurator class . If no class is given returns an instance of the default configurator . |
8,166 | public final function initQueryBuilder ( string $ stack = null , bool $ isSub = false ) : QueryBuilder { $ stack = $ stack ?? $ this -> getStack ( ) ; if ( $ stack == null ) { throw new DatabaseException ( sprintf ( "Null \$stack, set it in '%s' class" , static :: class ) ) ; } return new QueryBuilder ( $ this -> vendo... | Init query builder . |
8,167 | public function getValue ( array $ array , string $ path ) { if ( $ this -> isRoot ( $ path ) ) { return $ array ; } return $ this -> pa -> getValue ( $ array , $ path ) ; } | Get the value of the given path from the array graph . |
8,168 | public function getValueByPartialKey ( array $ array , string $ searchingKey ) : ? string { foreach ( $ array as $ key => $ value ) { if ( false !== stripos ( $ key , $ searchingKey ) ) { return $ value ; } } return null ; } | This just searches in the first level not in deeper ones . |
8,169 | public function isReadable ( array $ array , string $ path ) : bool { try { return $ this -> pa -> isReadable ( $ array , $ path ) ; } catch ( \ Exception $ e ) { return false ; } } | Checks if a path exists in the given array . |
8,170 | public function add ( array & $ array , string $ toPath , $ value , string $ propertyForNewValue = '' , string $ propertyForOldValue = '' ) : void { $ currentValue = $ this -> getValue ( $ array , $ toPath ) ; if ( false === is_array ( $ currentValue ) ) { $ currentValue = '' === $ propertyForOldValue ? [ $ currentValu... | Adds a value to a node . |
8,171 | public function edit ( array & $ array , string $ path , $ value ) : void { if ( false === $ this -> isRoot ( $ path ) && false === $ this -> pa -> isReadable ( $ array , $ path ) ) { throw new AccessException ( sprintf ( 'The path "%s" you are trying to edit isn\'t readable and so cannot be edited.' , $ path ) ) ; } i... | Edits the value at the given path . |
8,172 | public function mvUp ( array & $ array , string $ path ) : void { $ pathObject = new PropertyPath ( $ path ) ; $ values = $ this -> pa -> getValue ( $ array , $ path ) ; $ this -> rm ( $ array , $ path ) ; $ parentPath = null === $ pathObject -> getParent ( ) ? '[]' : $ pathObject -> getParent ( ) ; $ parentValues = $ ... | Moves a value one level up in the array . |
8,173 | public function rm ( array & $ array , string $ path ) : void { $ node = null ; $ path = new PropertyPathBuilder ( $ path ) ; $ nodes = $ path -> getPropertyPath ( ) -> getElements ( ) ; $ parentLevel = null ; $ currentLevel = & $ array ; foreach ( $ nodes as & $ node ) { $ parentLevel = & $ currentLevel ; $ currentLev... | Removes an element from the array . |
8,174 | public function wrap ( array & $ array , string $ path , string $ wrapperName ) : void { $ value = ( empty ( $ path ) || '[]' === $ path ) ? $ array : $ this -> pa -> getValue ( $ array , $ path ) ; $ wrapperName = $ this -> unpathize ( $ wrapperName ) ; $ value = [ $ wrapperName => $ value ] ; if ( empty ( $ path ) ) ... | Adds a parent key to the current array . |
8,175 | public function getEventSubscriberInformation ( $ class ) { $ events = array ( ) ; $ reflectionClass = new \ ReflectionClass ( $ class ) ; $ interfaces = $ reflectionClass -> getInterfaceNames ( ) ; foreach ( $ interfaces as $ interface ) { if ( $ interface == 'Symfony\\Component\\EventDispatcher\\EventSubscriberInterf... | Obtains the information available from class if it is defined as an EventSubscriber |
8,176 | protected function initModelManager ( ) { $ managerClass = $ this -> getModel ( ) ; $ modelManager = $ this -> newModelManagerInstance ( $ this -> getModel ( ) ) ; if ( $ modelManager instanceof RecordManager ) { $ this -> modelManager = $ this -> newModelManagerInstance ( $ this -> getModel ( ) ) ; } else { throw new ... | Init the Model Manager |
8,177 | protected function generateModelName ( ) { $ name = str_replace ( [ "async-" , "modal-" ] , '' , $ this -> getName ( ) ) ; $ manager = ModelLocator :: get ( $ name ) ; return get_class ( $ manager ) ; } | Generate the model name from controller name |
8,178 | public static function fromData ( $ error , array $ details = [ ] ) : self { if ( $ error instanceof self ) { return $ error ; } if ( ! is_string ( $ error ) ) { throw new \ InvalidArgumentException ( 'Given error must either be an error id or an instance of ' . __CLASS__ ) ; } return new self ( $ error , $ details ) ;... | creates an instance from given error id and details |
8,179 | public function fillMessages ( array $ templates ) : array { $ messages = [ ] ; foreach ( $ templates as $ locale => $ message ) { $ messages [ ] = $ this -> fillMessage ( $ message , $ locale ) ; } return $ messages ; } | fills given list of messages with details |
8,180 | public function fillMessage ( string $ message , string $ locale ) : LocalizedMessage { foreach ( $ this -> details as $ key => $ detail ) { $ message = str_replace ( '{' . $ key . '}' , $ this -> flattenDetail ( $ detail ) , $ message ) ; } return new LocalizedMessage ( $ locale , $ message ) ; } | fills given message with details |
8,181 | private function flattenDetail ( $ detail ) : string { if ( is_array ( $ detail ) ) { return join ( ', ' , $ detail ) ; } elseif ( is_object ( $ detail ) && ! method_exists ( $ detail , '__toString' ) ) { return get_class ( $ detail ) ; } return ( string ) $ detail ; } | flattens the given detail to be used within a message |
8,182 | public final function setStackPrimaryValue ( $ value ) : void { if ( $ this -> stackPrimary != null ) { $ this -> set ( $ this -> stackPrimary , $ value ) ; } } | Set stack primary value . |
8,183 | public final function getPager ( int $ totalRecords = null , string $ startKey = null , string $ stopKey = null ) : Pager { if ( $ totalRecords !== null ) { $ this -> pager -> run ( $ totalRecords , $ startKey , $ stopKey ) ; } return $ this -> pager ; } | Get pager . |
8,184 | public final function getPagerResults ( int $ totalRecords , string $ startKey = null , string $ stopKey = null ) : array { return $ this -> pager -> run ( $ totalRecords , $ startKey , $ stopKey ) ; } | Get pager results . |
8,185 | public final function setFail ( \ Throwable $ fail ) : void { if ( $ this -> failOption ) { if ( $ this -> failOption == 'log' ) { $ logger = clone $ this -> service -> getApp ( ) -> getLogger ( ) ; $ logger -> setDirectory ( $ this -> failLogDirectory ) ; $ logger -> logFail ( $ fail ) ; } elseif ( $ this -> failOptio... | Set fail . |
8,186 | public function urlServe ( $ sObject , $ sBucket , $ bForceDownload = false ) { $ sUrl = $ this -> urlServeScheme ( $ bForceDownload ) ; $ sFilename = strtolower ( substr ( $ sObject , 0 , strrpos ( $ sObject , '.' ) ) ) ; $ sExtension = strtolower ( substr ( $ sObject , strrpos ( $ sObject , '.' ) ) ) ; $ sUrl = str_r... | Generates the correct URL for serving a file |
8,187 | public function urlServeRaw ( $ sObject , $ sBucket ) { $ sUrl = 'assets/uploads/' . $ sBucket . '/' . $ sObject ; return $ this -> urlMakeSecure ( $ sUrl , false ) ; } | Generate the correct URL for serving a file direct from the file system |
8,188 | public function urlServeScheme ( $ bForceDownload = false ) { $ sUrl = $ this -> getUri ( 'serve' ) . '/serve/{{bucket}}/{{filename}}{{extension}}' ; if ( $ bForceDownload ) { $ sUrl .= '?dl=1' ; } return $ this -> urlMakeSecure ( $ sUrl , false ) ; } | Returns the scheme of serve URLs |
8,189 | public function urlServeZipped ( $ sObjectIds , $ sHash , $ sFilename ) { $ sUrl = $ this -> urlServeZippedScheme ( ) ; $ sUrl = str_replace ( '{{ids}}' , $ sObjectIds , $ sUrl ) ; $ sUrl = str_replace ( '{{hash}}' , $ sHash , $ sUrl ) ; $ sUrl = str_replace ( '{{filename}}' , urlencode ( $ sFilename ) , $ sUrl ) ; ret... | Generates a URL for serving zipped objects |
8,190 | public function urlCrop ( $ sObject , $ sBucket , $ iWidth , $ iHeight ) { $ sUrl = $ this -> urlCropScheme ( ) ; $ sFilename = strtolower ( substr ( $ sObject , 0 , strrpos ( $ sObject , '.' ) ) ) ; $ sExtension = strtolower ( substr ( $ sObject , strrpos ( $ sObject , '.' ) ) ) ; $ sUrl = str_replace ( '{{width}}' , ... | Generates the correct URL for using the crop utility |
8,191 | public function urlScale ( $ sObject , $ sBucket , $ iWidth , $ iHeight ) { $ sUrl = $ this -> urlScaleScheme ( ) ; $ sFilename = strtolower ( substr ( $ sObject , 0 , strrpos ( $ sObject , '.' ) ) ) ; $ sExtension = strtolower ( substr ( $ sObject , strrpos ( $ sObject , '.' ) ) ) ; $ sUrl = str_replace ( '{{width}}' ... | Generates the correct URL for using the scale utility |
8,192 | public function urlPlaceholder ( $ iWidth , $ iHeight , $ iBorder = 0 ) { $ sUrl = $ this -> urlPlaceholderScheme ( ) ; $ sUrl = str_replace ( '{{width}}' , $ iWidth , $ sUrl ) ; $ sUrl = str_replace ( '{{height}}' , $ iHeight , $ sUrl ) ; $ sUrl = str_replace ( '{{border}}' , $ iBorder , $ sUrl ) ; return $ sUrl ; } | Generates the correct URL for using the placeholder utility |
8,193 | public function urlBlankAvatar ( $ iWidth , $ iHeight , $ mSex = '' ) { $ sUrl = $ this -> urlBlankAvatarScheme ( ) ; $ sUrl = str_replace ( '{{width}}' , $ iWidth , $ sUrl ) ; $ sUrl = str_replace ( '{{height}}' , $ iHeight , $ sUrl ) ; $ sUrl = str_replace ( '{{sex}}' , $ mSex , $ sUrl ) ; return $ sUrl ; } | Generates the correct URL for a blank avatar |
8,194 | protected function urlMakeSecure ( $ sUrl , $ bIsProcessing = true ) { if ( Functions :: isPageSecure ( ) ) { if ( $ bIsProcessing ) { $ sSearch = $ this -> getUri ( 'process' ) ; $ sReplace = $ this -> getUri ( 'process_secure' ) ; } else { $ sSearch = $ this -> getUri ( 'serve' ) ; $ sReplace = $ this -> getUri ( 'se... | Formats a URL and makes it secure if needed |
8,195 | public static function addRow ( DetailTable $ table , $ header , ? string $ htmlSnippet ) : void { if ( $ htmlSnippet !== null && $ htmlSnippet !== '' ) { $ table -> addRow ( $ header , [ 'class' => 'html' ] , $ htmlSnippet , true ) ; } else { $ table -> addRow ( $ header ) ; } } | Adds a row with a HTML snippet to a detail table . |
8,196 | protected function setSubmitName ( string $ parentSubmitName ) : void { $ submitKey = $ this -> submitKey ( ) ; if ( $ parentSubmitName !== '' ) { if ( $ submitKey !== '' ) $ this -> submitName = $ parentSubmitName . '[' . $ submitKey . ']' ; else $ this -> submitName = $ parentSubmitName ; } else { $ this -> submitNam... | Sets the name this will be used for this form control when the form is submitted . |
8,197 | protected function submitKey ( ) : string { return ( $ this -> obfuscator ) ? $ this -> obfuscator -> encode ( Cast :: toOptInt ( $ this -> name ) ) : $ this -> name ; } | Returns the key under which the control is submitted in the submitted values . |
8,198 | public function check ( Secret $ proposedPassword ) : array { $ errors = [ ] ; if ( $ proposedPassword -> length ( ) < $ this -> minLength ) { $ errors [ 'PASSWORD_TOO_SHORT' ] = [ 'minLength' => $ this -> minLength ] ; } if ( in_array ( $ proposedPassword -> unveil ( ) , $ this -> disallowedValues ) ) { $ errors [ 'PA... | checks given password |
8,199 | public function run ( $ args ) { $ this -> setup ( $ args ) ; Index :: info ( 'Downloading files..' ) ; $ this ( 'curl' ) -> setUrl ( 'https://github.com/Eve-PHP/Shade/archive/master.zip' ) -> setFile ( $ this -> file ) -> setFollowLocation ( true ) -> setSslVerifyPeer ( false ) -> send ( ) ; fclose ( $ this -> file ) ... | Runs the CLI Install process |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.