idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
57,400
public function deepMerge ( array $ mergee , array $ merger ) { $ merged = $ mergee ; foreach ( $ merger as $ key => & $ value ) { if ( array_key_exists ( $ key , $ merged ) && is_array ( $ value ) && is_array ( $ merged [ $ key ] ) ) { $ merged [ $ key ] = $ this -> deepMerge ( $ merged [ $ key ] , $ value ) ; } else ...
Performs an array merge but when both values for a key are arrays a deep merge will occur retaining the unique keys of both without changing the value types .
57,401
protected function changeOptions ( $ category ) { $ thumbnails = $ category -> ancestorsAndSelf ( ) -> with ( 'thumbnails' ) -> get ( ) -> map ( function ( $ item ) { return $ item -> thumbnails -> keyBy ( 'slug' ) -> map ( function ( $ item ) { return [ 'width' => $ item -> photo_width , 'height' => $ item -> photo_he...
change options with model category
57,402
public static function saveFile ( $ file , string $ uploadsFolderPath ) { if ( ! empty ( $ file ) && is_array ( $ file ) && ! empty ( $ uploadsFolderPath ) ) { $ fileName = $ file [ 'name' ] ; $ temporaryFileName = $ file [ 'tmp_name' ] ; if ( GeneralUtility :: verifyFilenameAgainstDenyPattern ( $ fileName ) ) { $ uplo...
Saves a file to an uploads folder .
57,403
public static function cleanFileName ( string $ fileName , array $ rulesets = self :: FILE_NAME_RULESETS , string $ separator = '-' ) : string { $ slugify = new Slugify ( [ 'rulesets' => $ rulesets , 'separator' => $ separator ] ) ; $ name = $ slugify -> slugify ( pathinfo ( $ fileName , PATHINFO_FILENAME ) ) ; $ exten...
Cleans a file name .
57,404
public static function normalizeFileName ( string $ fileName , array $ rulesets = self :: FILE_NAME_RULESETS , string $ separator = '-' ) : string { return self :: cleanFileName ( $ fileName , $ rulesets , $ separator ) ; }
Normalizes a file name alias for cleanFileName .
57,405
public static function getUniqueFileName ( string $ fileName , string $ directory ) : string { $ basicFileUtility = GeneralUtility :: makeInstance ( BasicFileUtility :: class ) ; return $ basicFileUtility -> getUniqueName ( $ fileName , $ directory ) ; }
Gets an unique file name .
57,406
public function addGenus ( \ Librinfo \ VarietiesBundle \ Entity \ Genus $ genus ) { $ genus -> setFamily ( $ this ) ; $ this -> genuses -> add ( $ genus ) ; return $ this ; }
Add genus .
57,407
public function removeGenus ( \ Librinfo \ VarietiesBundle \ Entity \ Genus $ genus ) { return $ this -> genuses -> removeElement ( $ genus ) ; }
Remove genus .
57,408
protected function execute ( InputInterface $ input , OutputInterface $ output ) { $ logger = $ this -> getContainer ( ) -> get ( 'ringo_php_redmon.instance_logger' ) ; $ manager = $ this -> getContainer ( ) -> get ( 'ringo_php_redmon.instance_manager' ) ; $ instances = $ manager -> findAll ( ) ; if ( is_array ( $ inst...
Execute task Get all redis instances and log some of infos
57,409
public static function createWorkingDirectory ( ) { $ workdir = sys_get_temp_dir ( ) . '/tmp-' . session_id ( ) . '/' ; self :: recursiveMkdir ( $ workdir , 0777 ) ; if ( ! is_dir ( $ workdir ) ) { throw new Exception ( "cannot create directory: " . $ workdir ) ; } return $ workdir ; }
Creates a unique temporary directory and returns the absolute path
57,410
public static function recursiveRmdir ( $ path , $ removeParent = true ) { if ( ! file_exists ( $ path ) ) return true ; if ( ! is_dir ( $ path ) ) return @ unlink ( $ path ) ; $ objects = new RecursiveIteratorIterator ( new RecursiveDirectoryIterator ( $ path ) , RecursiveIteratorIterator :: CHILD_FIRST ) ; foreach ( ...
Recursively remove a directory and its contents .
57,411
public static function secureTmpname ( $ dir = null , $ prefix = 'tmp' , $ postfix = '.tmp' ) { if ( ! ( isset ( $ postfix ) && is_string ( $ postfix ) ) ) return false ; if ( ! ( isset ( $ prefix ) && is_string ( $ prefix ) ) ) return false ; if ( ! isset ( $ dir ) ) $ dir = getcwd ( ) ; $ tries = 1 ; do { $ sysFileNa...
Creates a temp file with a specific extension .
57,412
public function registerStream ( StreamInterface $ stream , $ replaceWrapper = false ) { $ protocol = $ stream -> getProtocol ( ) ; if ( $ replaceWrapper === true && in_array ( $ protocol , stream_get_wrappers ( ) ) ) { stream_wrapper_unregister ( $ protocol ) ; } if ( stream_wrapper_register ( $ protocol , $ stream ->...
Registers stream instance for a protocol .
57,413
public function unregisterStream ( $ protocol ) { if ( isset ( self :: $ streams [ $ protocol ] ) ) { $ result = stream_wrapper_unregister ( $ protocol ) ; if ( $ result === true ) { unset ( self :: $ streams [ $ protocol ] ) ; } } return $ this ; }
Unregisters a stream instance by protocol .
57,414
public static function ImageOverlayLinkBegin ( $ dummy , \ Title $ target , & $ text , & $ customAttribs , & $ query , & $ options , & $ ret ) { global $ wgDIQAImageOverlayWhitelist ; global $ wgDIQADownloadWhitelist ; if ( ! self :: isImage ( $ target -> mNamespace ) ) { return true ; } $ file = wfFindFile ( $ target ...
Rewrites links to images in order to open them into a overlay
57,415
public function generateCommandProxy ( $ className ) { $ classMeta = $ this -> reflectionService -> getClassMetaReflection ( $ className ) ; $ proxies = [ ] ; $ cachePath = $ this -> getRaptorCachePath ( ) ; $ this -> createDirectory ( $ cachePath ) ; $ thisNode = new Variable ( 'this' ) ; foreach ( $ classMeta -> getM...
Entry point to create proxies of a bonefish command class
57,416
protected function getCommandName ( $ methodMeta , $ classMeta ) { $ nameSpaceParts = explode ( '\\' , $ classMeta -> getNamespace ( ) ) ; $ vendor = $ nameSpaceParts [ 0 ] ; $ package = $ nameSpaceParts [ 1 ] ; return strtolower ( $ vendor . ':' . $ package . ':' . str_replace ( self :: COMMAND_SUFFIX , '' , $ methodM...
Create a unique command name
57,417
public function next ( ) { $ this -> _itemValid = true ; if ( ! prev ( $ this -> _items ) ) { $ this -> _itemValid = false ; } else { $ this -> _itemPosition -- ; } }
set next item to current item
57,418
private function fetchAccessToken ( ) { $ params = [ 'client_id' => $ this -> clientID , 'client_secret' => $ this -> secret , 'grant_type' => 'authorization_code' , 'code' => $ this -> requestToken ] ; if ( isset ( $ this -> redirectURI ) ) { $ params [ 'redirect_uri' ] = $ this -> redirectURI ; } $ this -> parseAcces...
Does a cURL to request a new access token
57,419
private function refreshAccessToken ( ) { $ params = [ 'client_id' => $ this -> clientID , 'client_secret' => $ this -> secret , 'grant_type' => 'refresh_token' , 'refresh_token' => $ this -> refreshToken ] ; $ this -> parseAccessToken ( CURL :: post ( $ this -> url , $ params ) ) ; }
Refreshes the access token
57,420
public function processRequestToken ( $ token ) { $ params = [ 'client_id' => $ this -> clientID , 'client_secret' => $ this -> secret , 'code' => $ token , 'grant_type' => 'authorization_code' , 'redirect_uri' => $ this -> redirectURI ] ; return CURL :: post ( $ this -> url , $ params ) ; }
Convert a request token to an access token
57,421
public function setCallbacks ( array $ callbacks ) { foreach ( $ callbacks as $ attribute => $ callback ) { if ( ! is_callable ( $ callback ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The given callback for attribute "%s" is not callable.' , $ attribute ) ) ; } } $ this -> callbacks = $ callbacks ; }
Set normalization callbacks
57,422
protected function formatAttribute ( $ attributeName ) { if ( in_array ( $ attributeName , $ this -> camelizedAttributes ) ) { return preg_replace_callback ( '/(^|_|\.)+(.)/' , function ( $ match ) { return ( '.' === $ match [ 1 ] ? '_' : '' ) . strtoupper ( $ match [ 2 ] ) ; } , $ attributeName ) ; } return $ attribut...
Format attribute name to access parameters or methods As option if attribute name is found on camelizedAttributes array returns attribute name in camelcase format
57,423
public function getServerVersion ( ) { $ di = new DBInstance ( $ this -> rawConfig ) ; $ version = $ di -> getServerVersion ( ) ; unset ( $ di ) ; return array ( 'version' => $ version , ) ; }
Get DBInstance database version .
57,424
public function message ( $ type , $ message ) { if ( $ this -> session -> has ( 'flashMessages' ) ) { $ flashMessages = $ this -> session -> get ( 'flashMessages' ) ; $ flashMessages [ ] = [ 'type' => $ type , 'message' => $ message ] ; $ this -> session -> set ( 'flashMessages' , $ flashMessages ) ; } else { $ this -...
Saves the message in the session .
57,425
public function output ( ) { if ( $ this -> session -> has ( 'flashMessages' ) ) { $ flashMessages = $ this -> session -> get ( 'flashMessages' ) ; $ this -> session -> set ( 'flashMessages' , [ ] ) ; $ html = null ; foreach ( $ flashMessages as $ message ) { $ html .= "<div class='" . $ message [ 'type' ] . "'>" . $ m...
Gets and resets the flash messages from session and building html .
57,426
public function elapsedTime ( ) { $ currentTime = microtime ( true ) ; if ( $ this -> startTime === null ) { $ this -> startTime = $ currentTime ; $ this -> finishTime = $ currentTime ; } else { $ this -> finishTime = $ currentTime ; $ this -> elapsedTimeFromStart = $ currentTime - $ this -> startTime ; } }
Calculated the different time of the log line .
57,427
public function store ( $ id , $ data , $ maxLifetimeSeconds = null ) { $ creationTimestamp = time ( ) ; if ( null === $ maxLifetimeSeconds ) { $ expirationTimestamp = null ; } else { $ expirationTimestamp = ( $ creationTimestamp + ( int ) $ maxLifetimeSeconds ) ; } $ entry = new CacheEntry ( $ id , $ data , $ creation...
Attempts to store provided content into cache . Cache file will hold creation and expiration timestamps and provided content .
57,428
public function tryFetch ( $ id , $ maxLifetimeSeconds = null ) { $ entry = $ this -> storage -> tryFetch ( $ id ) ; if ( null === $ entry ) { return null ; } if ( null !== $ maxLifetimeSeconds ) { if ( ( $ this -> nowTimestamp - $ entry -> creationTimestamp ( ) ) > $ maxLifetimeSeconds ) { return null ; } } if ( null ...
Attempts to retrieve data from cache .
57,429
public function getDependsInfo ( ) { $ dependsInfo = $ this -> getCachedValue ( 'dependsInfo' ) ; if ( $ dependsInfo === false ) { $ data = $ this -> dataProvider -> getData ( ) ; $ dependsInfo = array ( ) ; foreach ( $ this -> getPackageSortOrder ( ) as $ packageId => $ order ) { if ( ! isset ( $ data [ $ packageId ] ...
Gets a flat list of file dependencies for each file
57,430
static function instance ( $ syspath , $ conf ) { $ i = new static ; $ i -> env = $ i -> environementInstance ( $ syspath , $ conf ) ; return $ i ; }
You may set debugMode to true to use debug modules otherwise if modules with a debug type in the autoload rules section are found they will be ignored .
57,431
function exists ( $ symbol , $ autoload = false ) { return class_exists ( $ symbol , $ autoload ) || interface_exists ( $ symbol , $ autoload ) || trait_exists ( $ symbol , $ autoload ) ; }
Maintained for backwards comaptibility .
57,432
function load ( $ symbol ) { if ( $ this -> env -> knownUnknown ( $ symbol ) ) { return false ; } if ( $ this -> env -> autoresolve ( $ symbol ) ) { return true ; } $ ns_pos = \ strripos ( $ symbol , '\\' ) ; if ( $ ns_pos !== false && $ ns_pos != 0 ) { $ ns = \ substr ( $ symbol , 0 , $ ns_pos + 1 ) ; $ mainsegment = ...
Load given symbol
57,433
public function setExpireDate ( DateTimeInterface $ dt ) { $ this -> expire_time = ( int ) $ dt -> format ( 'U' ) - time ( ) ; return $ this ; }
Set the exact moment when the cache should expire .
57,434
public function setExpiresIn ( DateInterval $ interval ) { $ now = new DateTimeImmutable ( ) ; $ expire = $ now -> add ( $ interval ) ; $ this -> setExpiresInSeconds ( $ expire -> getTimestamp ( ) - $ now -> getTimestamp ( ) ) ; return $ this ; }
Set the time until the cache should expire .
57,435
public function setExpires ( $ period ) { if ( is_int ( $ period ) ) return $ this -> setExpiresInSeconds ( $ period ) ; if ( $ period instanceof DateTimeInterface ) return $ this -> setExpireDate ( $ period ) ; if ( $ period instanceof DateInterval ) return $ this -> setExpiresIn ( $ period ) ; throw new \ InvalidArgu...
Set the when the cache should expire . Wrapper for setExpiresIn setExpiresInSeconds and setExpireDate with type detection .
57,436
public function setCachePolicy ( string $ policy ) { if ( $ policy !== self :: CACHE_DISABLE && $ policy !== self :: CACHE_PUBLIC && $ policy !== self :: CACHE_PRIVATE ) throw new \ InvalidArgumentException ( "Invalid cache policy: " . $ policy ) ; $ this -> cache_policy = $ policy ; return $ this ; }
Set the cache policy for this response .
57,437
public function setAttribute ( $ attr , $ value ) { $ attr = strtolower ( $ attr ) ; if ( is_null ( $ value ) ) { unset ( $ this -> attributes [ $ attr ] ) ; } else { $ this -> attributes [ $ attr ] = $ value ; } return $ this ; }
sets attributes of form label
57,438
public function render ( ) { $ attr = [ ] ; foreach ( $ this -> attributes as $ k => $ v ) { $ attr [ ] = sprintf ( '%s="%s"' , $ k , $ v ) ; } return sprintf ( '<label %s>%s</label>' , implode ( ' ' , $ attr ) , trim ( $ this -> labelText ) ) ; }
render the label element if a form element was assigned a matching for attribute can be generated
57,439
public function translit ( $ string ) { $ string = \ strtr ( $ string , $ this -> transliterationTable ) ; return \ iconv ( \ mb_internal_encoding ( ) , 'ASCII//TRANSLIT' , $ string ) ; }
transliteration cyr - > lat
57,440
public function end ( $ name , $ append = true ) { $ content = trim ( ob_get_contents ( ) ) ; ob_end_clean ( ) ; $ hash = md5 ( $ content ) ; if ( isset ( $ this -> hashCache [ $ hash ] ) ) { return ; } $ this -> hashCache [ $ hash ] = true ; if ( isset ( $ this -> blocks [ $ name ] ) && $ append ) { $ this -> blocks [...
End to catch block and save it .
57,441
public function beforeDispatch ( \ Magento \ Framework \ App \ FrontControllerInterface $ subject , \ Magento \ Framework \ App \ RequestInterface $ request ) { $ code = $ request -> getParam ( static :: REQ_REFERRAL ) ; if ( ! empty ( $ code ) ) { $ this -> session -> logout ( ) ; } $ this -> hlpRefCode -> processHttp...
Extract referral code from GET - variable or cookie and save it into registry .
57,442
static function fuse ( & $ opt1 , $ opt2 ) { return isset ( $ opt1 ) ? $ opt1 : ( isset ( $ opt2 ) ? $ opt2 : null ) ; }
Alternate a value to undefined variable
57,443
public function includeFile ( $ templateFilename ) { $ tpl = $ this ; eval ( '?>' . file_get_contents ( Application :: getInstance ( ) -> getRootPath ( ) . ( defined ( 'TPL_PATH' ) ? str_replace ( '/' , DIRECTORY_SEPARATOR , ltrim ( TPL_PATH , '/' ) ) : '' ) . $ templateFilename ) ) ; }
include another template file does only path handling included files are within the same scope as the including file
57,444
public function createFile ( $ perm ) { if ( $ this -> isFile ( ) ) return false ; IoUtils :: touch ( $ this -> path ) ; IoUtils :: chmod ( $ this -> path , $ perm ) ; return true ; }
Atomically creates a new empty file named by this abstract path if and only if a file with this name does not yet exist .
57,445
public function tpl ( string $ tpl , ? array $ params = [ ] , ? string $ dir = null ) { try { $ this -> message = App :: $ View -> render ( $ tpl , $ params , $ dir ) ; } catch ( SyntaxException $ e ) { } return $ this ; }
Set tpl file
57,446
public function send ( string $ address , string $ subject , ? string $ message = null ) : bool { if ( $ message === null ) { $ message = $ this -> message ; } try { if ( $ message === null ) { throw new \ Exception ( 'Message body is empty!' ) ; } $ message = ( new \ Swift_Message ( $ subject ) ) -> setFrom ( $ this -...
Set mail to address
57,447
protected function Init ( ) { $ this -> layout = new Layout ( Request :: GetData ( 'layout' ) ) ; $ this -> layoutRights = new LayoutRights ( $ this -> layout -> GetUserGroupRights ( ) ) ; $ this -> InitAreas ( ) ; $ this -> AddNameField ( ) ; $ this -> AddAreasField ( ) ; $ this -> AddUserGroupField ( ) ; $ this -> Ad...
Initializes the layout form
57,448
private function AddAreasField ( ) { $ name = 'Areas' ; $ field = Input :: Text ( $ name , join ( ', ' , $ this -> areaNames ) ) ; $ this -> AddField ( $ field ) ; if ( $ this -> layout -> Exists ( ) ) { $ field -> SetHtmlAttribute ( 'readonly' , 'readonly' ) ; } else { $ this -> SetTransAttribute ( $ name , 'placehold...
Adds the server path field to the form
57,449
protected function OnSuccess ( ) { $ action = Action :: Update ( ) ; $ isNew = ! $ this -> layout -> Exists ( ) ; if ( $ isNew ) { $ action = Action :: Create ( ) ; $ this -> layout -> SetUser ( self :: Guard ( ) -> GetUser ( ) ) ; } $ oldFile = $ isNew ? '' : PathUtil :: LayoutTemplate ( $ this -> layout ) ; $ this ->...
Saves the layout
57,450
public function getById ( $ id ) { if ( isset ( $ this -> elements [ $ id ] ) ) { return $ this -> elements [ $ id ] ; } throw new \ InvalidArgumentException ( sprintf ( 'Element for id %s does not exist' , $ id ) ) ; }
Get an entity by its ID
57,451
public function buildConfigField ( FormEvent $ event ) { $ data = $ event -> getData ( ) ; if ( is_null ( $ data ) ) { return ; } $ propertyPath = is_array ( $ data ) ? '[factoryName]' : 'factoryName' ; $ factoryName = PropertyAccess :: createPropertyAccessor ( ) -> getValue ( $ data , $ propertyPath ) ; if ( empty ( $...
Builds the config field .
57,452
public function innerJoin ( $ table , ... $ criterion ) : self { $ this -> join [ ] = $ this -> joinArgumentsToJoinObject ( 'INNER' , $ table , $ criterion ) ; return $ this ; }
Adds a table joined with the inner rule .
57,453
public function outerJoin ( $ table , ... $ criterion ) : self { $ this -> join [ ] = $ this -> joinArgumentsToJoinObject ( 'OUTER' , $ table , $ criterion ) ; return $ this ; }
Adds a table joined with the outer rule .
57,454
public function leftJoin ( $ table , ... $ criterion ) : self { $ this -> join [ ] = $ this -> joinArgumentsToJoinObject ( 'LEFT' , $ table , $ criterion ) ; return $ this ; }
Adds a table joined with the left rule .
57,455
public function rightJoin ( $ table , ... $ criterion ) : self { $ this -> join [ ] = $ this -> joinArgumentsToJoinObject ( 'RIGHT' , $ table , $ criterion ) ; return $ this ; }
Adds a table joined with the right rule .
57,456
protected function joinArgumentsToJoinObject ( string $ type , $ table , array $ criterion = [ ] ) : Join { if ( is_array ( $ table ) ) { $ tableName = $ table [ 0 ] ?? null ; $ tableAlias = $ table [ 1 ] ?? null ; } else { $ tableName = $ table ; $ tableAlias = null ; } $ tableName = $ this -> checkStringValue ( 'Argu...
Converts join method arguments to a join object
57,457
protected function passthruParameter ( & $ dto , $ variableName ) { $ reqName = str_replace ( '.' , '_' , $ variableName ) ; if ( $ this -> Request -> getParameter ( $ reqName ) !== null && $ this -> Request -> getParameter ( $ reqName ) != '' ) $ dto -> setParameter ( $ variableName , $ this -> Request -> getParameter...
copied from AbstractController
57,458
public function matchWhen ( $ url = null ) { if ( null !== $ url ) { $ this -> setMatchUrl ( $ url ) ; } return strpos ( $ this -> getRequestedUrl ( ) , $ this -> getMatchUrl ( ) ) === 0 ; }
match uri for when ( method
57,459
public function apply ( $ value ) { $ modified = false ; foreach ( $ this -> filters as $ filter ) { $ result = $ filter -> apply ( $ value ) ; if ( $ result === false ) { return false ; } elseif ( $ result === true ) { } else { $ modified = true ; $ value = $ result ; } } return $ modified ? $ value : true ; }
Returns true if all filters allow the value
57,460
public function setData ( array $ data ) { $ reservedDataKeys = array ( 'from' , 'notification' , 'to' , 'registration_ids' , 'collapse_key' , 'priority' , 'restricted_package_name' , 'content_available' , 'delay_while_idle' , 'dry_run' , 'time_to_live' , 'data' , ) ; foreach ( $ data as $ key => $ value ) { if ( ! is_...
Set the value of Data .
57,461
public function addFilterToQueryBuilder ( QueryBuilder $ qb ) { $ filters = $ this -> dm -> getFilterCollection ( ) -> getFilterCriteria ( $ this -> class ) ; foreach ( $ filters as $ filter ) { $ qb -> addCriteria ( $ filter ) ; } }
Adds filter criteria to a QueryBuilder instance .
57,462
private function createDocument ( $ data , $ document = null , $ refresh = false ) { if ( $ this -> class -> isLockable ) { $ lockAttribute = $ this -> class -> getLockMetadata ( ) -> attributeName ; if ( isset ( $ result [ $ lockAttribute ] ) && $ data [ $ lockAttribute ] === LockMode :: PESSIMISTIC_WRITE ) { throw Lo...
Creates or fills a single document object from a query result .
57,463
public function createReferenceInverseSideQuery ( PropertyMetadata $ mapping , $ owner ) { $ targetClass = $ this -> dm -> getClassMetadata ( $ mapping -> targetDocument ) ; $ mappedBy = $ targetClass -> getPropertyMetadata ( $ mapping -> mappedBy ) ; $ qb = $ this -> dm -> createQueryBuilder ( $ mapping -> targetDocum...
Build and return a query capable of populating the given inverse - side reference .
57,464
public function delete ( $ document ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; $ identifier = $ this -> uow -> getDocumentIdentifier ( $ document ) ; $ qb -> delete ( ) ; $ qb -> setIdentifier ( $ identifier ) ; if ( $ this -> class -> isLockable ) { $ qb -> attr ( $ this -> class -> lo...
Removes a document from DynamoDB
57,465
public function insert ( $ document ) { $ class = $ this -> dm -> getClassMetadata ( get_class ( $ document ) ) ; $ changeset = $ this -> uow -> getDocumentChangeSet ( $ document ) ; $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; foreach ( $ class -> propertyMetadata as $ mapping ) { $ new = is...
Insert the provided document .
57,466
public function load ( Identifier $ identifier , $ document = null , $ lockMode = LockMode :: NONE ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; $ query = $ qb -> get ( ) -> setIdentifier ( $ identifier ) -> getQuery ( ) ; $ result = $ query -> getSingleMarshalledResult ( ) ; return $ resu...
Find a document by Identifier instance .
57,467
public function loadAll ( array $ criteria = [ ] , $ limit = null ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) -> addCriteria ( $ criteria ) ; return $ qb -> getQuery ( ) -> limit ( $ limit ) -> execute ( ) ; }
Load all documents from a table optionally limited by the provided criteria .
57,468
private function loadReferenceManyCollectionInverseSide ( PersistentCollectionInterface $ collection ) { $ query = $ this -> createReferenceInverseSideQuery ( $ collection -> getMapping ( ) , $ collection -> getOwner ( ) ) ; $ documents = $ query -> execute ( ) -> toArray ( ) ; foreach ( $ documents as $ key => $ docum...
Populate an inverse - side ReferenceMany association .
57,469
private function loadReferenceManyCollectionOwningSide ( PersistentCollectionInterface $ collection ) { $ mapping = $ collection -> getMapping ( ) ; $ identifiers = array_map ( function ( $ referenceData ) use ( $ mapping ) { return $ this -> ap -> loadReference ( $ mapping , $ referenceData ) ; } , $ collection -> get...
Populate an owning - side ReferenceMany association .
57,470
private function loadReferenceManyWithRepositoryMethod ( PersistentCollectionInterface $ collection ) { $ iterator = $ this -> createReferenceManyWithRepositoryMethodIterator ( $ collection ) ; $ mapping = $ collection -> getMapping ( ) ; $ documents = $ iterator -> toArray ( ) ; foreach ( $ documents as $ key => $ obj...
Populate a ReferenceMany association with a custom repository method .
57,471
public function lock ( $ document , $ lockMode ) { $ qb = $ this -> dm -> createQueryBuilder ( $ this -> class -> name ) ; $ identifier = $ this -> uow -> getDocumentIdentifier ( $ document ) ; $ lockMapping = $ this -> class -> lockMetadata ; $ qb -> update ( ) ; $ qb -> setIdentifier ( $ identifier ) ; $ qb -> attr (...
Locks document by storing the lock mode on the mapped lock attribute .
57,472
public function upsert ( $ document , $ parentPath = null ) { $ class = $ this -> dm -> getClassMetadata ( get_class ( $ document ) ) ; $ changeset = $ this -> uow -> getDocumentChangeSet ( $ document ) ; if ( ! $ class -> isEmbeddedDocument ) { $ qb = $ this -> dm -> createQueryBuilder ( $ class -> name ) ; $ identifi...
Update a document if it already exists in DynamoDB or insert if it does not .
57,473
public function addToQueryCondition ( Expr $ expr ) { $ expr -> attr ( $ this -> getHashKey ( ) -> getPropertyMetadata ( ) -> name ) -> equals ( $ this -> getHashValue ( ) ) ; }
Add a conditon for this identifer s values to the provided query expression .
57,474
public function getDocument ( DocumentManager $ dm ) { $ document = $ dm -> getUnitOfWork ( ) -> tryGetByIdentifier ( $ this ) ; if ( $ document !== false ) { return $ document ; } $ document = $ dm -> getProxyFactory ( ) -> getProxy ( $ this -> class -> getName ( ) , $ this -> getArray ( ) ) ; $ dm -> getUnitOfWork ( ...
Gets a reference to the target document without actually loading it .
57,475
public function getDocumentPartial ( DocumentManager $ dm ) { $ document = $ dm -> getUnitOfWork ( ) -> tryGetByIdentifier ( $ this ) ; if ( $ document !== false ) { return $ document ; } $ document = $ this -> class -> newInstance ( ) ; $ this -> addToDocument ( $ document ) ; $ dm -> getUnitOfWork ( ) -> registerMana...
Gets a partial reference to the target document without actually loading it if the document is not yet loaded .
57,476
protected function isMetadataMethod ( string & $ subject , int $ key , string $ pattern ) { unset ( $ key ) ; if ( ! preg_match ( $ pattern , $ subject ) ) { $ subject = false ; } return ; }
Is metadata method
57,477
final protected function _nodeBuilder ( $ key , $ value = null , \ DOMNode & $ parent = null ) { if ( is_null ( $ parent ) ) { $ parent = $ this ; } if ( is_string ( $ key ) ) { if ( substr ( $ key , 0 , 1 ) === '@' and ( is_string ( $ value ) or is_numeric ( $ value ) ) ) { $ parent -> setAttribute ( substr ( $ key , ...
Dynamically and seemingly magically build nodes and append to parent
57,478
public static function fromNative ( ) { $ array = \ func_get_arg ( 0 ) ; $ items = array ( ) ; foreach ( $ array as $ item ) { if ( $ item instanceof \ Traversable || \ is_array ( $ item ) ) { $ items [ ] = static :: fromNative ( $ item ) ; } else { $ items [ ] = new StringLiteral ( \ strval ( $ item ) ) ; } } $ fixedA...
Returns a new Collection object
57,479
public function contains ( ValueObjectInterface $ object ) { foreach ( $ this -> items as $ item ) { if ( $ item -> sameValueAs ( $ object ) ) { return true ; } } return false ; }
Tells whether the Collection contains an object
57,480
private function getShieldHolding ( ) : ItemHoldingCode { if ( $ this -> weaponlikeHolding -> holdsByMainHand ( ) ) { return ItemHoldingCode :: getIt ( ItemHoldingCode :: OFFHAND ) ; } if ( $ this -> weaponlikeHolding -> holdsByOffhand ( ) ) { return ItemHoldingCode :: getIt ( ItemHoldingCode :: MAIN_HAND ) ; } if ( $ ...
Gives holding opposite to given weapon holding .
57,481
private function getFightNumberModifier ( ) : int { $ fightNumberModifier = 0 ; $ fightNumberModifier += $ this -> getFightNumberMalusByStrength ( ) ; $ fightNumberModifier += $ this -> getFightNumberMalusBySkills ( ) ; $ fightNumberModifier += $ this -> combatActions -> getFightNumberModifier ( ) ; return $ fightNumbe...
Fight number update according to a missing strength missing skill and by a combat action
57,482
private static function generateKey ( $ outputLog ) { try { Artisan :: call ( 'key:generate' , [ "--force" => true ] , $ outputLog ) ; } catch ( Exception $ e ) { return $ this -> response ( $ e -> getMessage ( ) ) ; } return $ outputLog ; }
Generate New Application Key .
57,483
public function toSQL ( Parameters $ params , bool $ inner_clause ) { $ field = $ this -> getField ( ) ; $ table = $ this -> getTable ( ) ; if ( empty ( $ table ) ) $ table = $ params -> getDefaultTable ( ) ; $ drv = $ params -> getDriver ( ) ; if ( ! empty ( $ table ) ) { list ( $ table , $ alias ) = $ params -> resol...
Write a field name as SQL query syntax
57,484
public function setupOrganization ( User $ user ) { $ guestCreateOrganization = false ; $ invitationHash = $ this -> session -> get ( 'newInvitation' , false ) ; if ( $ guestCreateOrganization || $ invitationHash == false ) { $ organization = $ this -> createOrganization ( $ user ) ; } if ( $ invitationHash ) { $ organ...
Setup organization from signup . It chekcs if there is an invitationHash in session
57,485
public function createOrganization ( User $ user ) { $ organization = new $ this -> organizationClass ; $ organization -> setOwner ( $ user ) ; $ organization -> addUser ( $ user ) ; $ role = new Role ; $ role -> setRoles ( array ( 'ROLE_ORGANIZATION_OWNER' ) ) ; $ role -> setUser ( $ user ) ; $ role -> setOrganization...
It creates and completes a new Organization
57,486
public function addMember ( OrganizationInterface $ organization , User $ user , array $ roles ) { if ( $ organization -> getOwner ( ) === null ) { $ organization -> setOwner ( $ user ) ; } $ user -> addOrganization ( $ organization ) ; $ organization -> addUser ( $ user ) ; $ role = new Role ( ) ; $ role -> setOrganiz...
Add member to an organization with specifics roles
57,487
public function processInvitationByHash ( User $ user , $ hash ) { $ invitation = $ this -> dm -> getRepository ( 'WobbleCodeUserBundle:Invitation' ) -> findOneBy ( [ 'hash' => $ hash , 'status' => 'pending' ] ) ; if ( ! $ invitation ) { return false ; } $ organization = $ invitation -> getOrganization ( ) ; $ this -> ...
Finds an Invitation by Hash and add member if exists
57,488
public function addMemberByInvitation ( OrganizationInterface $ organization , User $ user , Invitation $ invitation ) { $ this -> addMember ( $ organization , $ user , $ invitation -> getRoles ( ) ) ; $ invitation -> setStatus ( 'accepted' ) ; $ invitation -> setTo ( $ user ) ; $ this -> dm -> persist ( $ invitation )...
Add member to an Organization using settings from invitation
57,489
public function getAdminOwner ( ) { $ repo = $ this -> dm -> getRepository ( $ this -> organizationClass ) ; return $ repo -> findOneBy ( [ 'adminOwner' => true ] ) ; }
Gets the system admin Organization
57,490
function Render ( ) { if ( ! self :: Guard ( ) -> Allow ( Action :: Read ( ) , $ this -> content ) ) { return '' ; } ContentTranslator :: Singleton ( ) -> SetContent ( $ this -> content ) ; $ module = ClassFinder :: CreateFrontendModule ( $ this -> content -> GetType ( ) ) ; $ module -> SetTreeItem ( $ this -> tree , $...
Renders the content
57,491
public function getC2Ms ( Criteria $ criteria = null , ConnectionInterface $ con = null ) { $ partial = $ this -> collC2MsPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collC2Ms || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collC2Ms ) { $ this -> initC2Ms ( ) ; } els...
Gets an array of ChildC2M objects which contain a foreign key that references this object .
57,492
public function countM2Ps ( Criteria $ criteria = null , $ distinct = false , ConnectionInterface $ con = null ) { $ partial = $ this -> collM2PsPartial && ! $ this -> isNew ( ) ; if ( null === $ this -> collM2Ps || null !== $ criteria || $ partial ) { if ( $ this -> isNew ( ) && null === $ this -> collM2Ps ) { return ...
Returns the number of related M2P objects .
57,493
public function getM2PsJoinPage ( Criteria $ criteria = null , ConnectionInterface $ con = null , $ joinBehavior = Criteria :: LEFT_JOIN ) { $ query = ChildM2PQuery :: create ( null , $ criteria ) ; $ query -> joinWith ( 'Page' , $ joinBehavior ) ; return $ this -> getM2Ps ( $ query , $ con ) ; }
If this collection has already been initialized with an identical criteria it returns the collection . Otherwise if this Media is new it will return an empty collection ; or if this Media has previously been saved it will retrieve related M2Ps from storage .
57,494
protected function getCriteria ( $ entity , Constraint $ constraint , ObjectManager $ em ) { $ class = $ em -> getClassMetadata ( ClassUtils :: getClass ( $ entity ) ) ; $ fields = ( array ) $ constraint -> fields ; $ criteria = [ ] ; foreach ( $ fields as $ fieldName ) { $ criteria = $ this -> findFieldCriteria ( $ cr...
Gets criteria .
57,495
private function getResult ( $ entity , Constraint $ constraint , array $ criteria , ObjectManager $ em ) { $ filters = SqlFilterUtil :: findFilters ( $ em , ( array ) $ constraint -> filters , $ constraint -> allFilters ) ; SqlFilterUtil :: disableFilters ( $ em , $ filters ) ; $ repository = $ em -> getRepository ( C...
Get entity result .
57,496
private function isValidResult ( $ result , $ entity ) { return 0 === \ count ( $ result ) || ( 1 === \ count ( $ result ) && $ entity === ( $ result instanceof \ Iterator ? $ result -> current ( ) : current ( $ result ) ) ) ; }
Check if the result is valid .
57,497
private function findFieldCriteriaStep2 ( array & $ criteria , ObjectManager $ em , ClassMetadata $ class , $ fieldName ) : void { if ( null !== $ criteria [ $ fieldName ] && $ class -> hasAssociation ( $ fieldName ) ) { $ em -> initializeObject ( $ criteria [ $ fieldName ] ) ; $ relatedClass = $ em -> getClassMetadata...
Finds the criteria for the entity field .
57,498
protected function handleResult ( ContextInterface $ context , $ result ) { $ validated = $ this -> validateResult ( $ result ) ; if ( is_null ( $ validated ) ) { $ validated = $ result ; } if ( $ validated instanceof ContextInterface ) { $ context = $ validated ; } elseif ( ! is_null ( $ validated ) ) { $ context -> s...
Validate middleware result . Imprementer shall invoke exceptions in this method if result is not valid .
57,499
public function output ( string $ mime ) { if ( $ this -> xsendfile ) return ; $ bytes = readfile ( $ this -> filename ) ; if ( ! empty ( $ this -> length ) && $ bytes != $ this -> length ) { self :: getLogger ( ) -> warning ( "FileResponse promised to send {0} bytes but {1} were actually transfered of file {2}" , [ $ ...
Serve the file to the user