idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
59,400
private function scheduleForDeletion ( $ object ) { $ oid = spl_object_hash ( $ object ) ; if ( isset ( $ this -> documentInsertions [ $ oid ] ) ) { if ( $ this -> isInIdentityMap ( $ object ) ) { $ this -> removeFromIdentityMap ( $ object ) ; } unset ( $ this -> documentInsertions [ $ oid ] , $ this -> documentStates ...
Schedule a document for deletion .
59,401
private function newInstance ( DocumentMetadata $ class ) { $ document = $ class -> newInstance ( ) ; if ( $ document instanceof ObjectManagerAware ) { $ document -> injectObjectManager ( $ this -> manager , $ class ) ; } return $ document ; }
Creates a new instance of given class and inject object manager if needed .
59,402
private function getCommitOrder ( ) : array { static $ calculator = null ; if ( null === $ calculator ) { $ calculator = new CommitOrderCalculator ( ) ; } $ objects = array_merge ( $ this -> documentInsertions , $ this -> documentUpdates , $ this -> documentDeletions ) ; $ classes = [ ] ; foreach ( $ objects as $ objec...
Calculates the commit order based on associations on document metadata .
59,403
public function signupAction ( ) { $ form = new SignUpForm ( ) ; if ( $ this -> request -> isPost ( ) ) { if ( $ form -> isValid ( $ this -> request -> getPost ( ) ) != false ) { $ user = new Users ( [ 'name' => $ this -> request -> getPost ( 'name' , 'striptags' ) , 'email' => $ this -> request -> getPost ( 'email' ) ...
Allow a user to signup to the system
59,404
public function loginAction ( ) { $ form = new LoginForm ( ) ; try { if ( ! $ this -> request -> isPost ( ) ) { if ( $ this -> auth -> hasRememberMe ( ) ) { return $ this -> auth -> loginWithRememberMe ( ) ; } } else { if ( $ form -> isValid ( $ this -> request -> getPost ( ) ) == false ) { foreach ( $ form -> getMessa...
Starts a session in the admin backend
59,405
public function forgotPasswordAction ( ) { $ form = new ForgotPasswordForm ( ) ; if ( $ this -> request -> isPost ( ) ) { if ( $ this -> getDI ( ) -> get ( 'config' ) -> useMail ) { if ( $ form -> isValid ( $ this -> request -> getPost ( ) ) == false ) { foreach ( $ form -> getMessages ( ) as $ message ) { $ this -> fl...
Shows the forgot password form
59,406
public function registerInstance ( $ name = null ) { if ( $ name === null ) { $ name = 'default' ; } $ this -> instanceName ( $ name ) ; return $ this ; }
This function manually registers an instance of this object with the management routines . Helpful if you have hand - cranked this object by calling construct explicitly .
59,407
public function unregisterInstance ( ) { if ( array_key_exists ( $ this -> instanceName , self :: $ instances ) ) { unset ( self :: $ instances [ $ this -> instanceName ] ) ; unset ( $ this -> instanceName ) ; } return $ this ; }
Unregisters an instance with the manager .
59,408
public function classTask ( Option $ option ) { $ current = $ this -> getRootAppDir ( $ option ) ; $ base_dir = $ current ; foreach ( $ option -> getArgs ( ) as $ class ) { $ path = str_replace ( '\\' , DS , $ class ) ; $ dir = dirname ( $ path ) ; if ( $ dir == '.' ) $ dir = '' ; $ skeleton = $ this -> getSkeleton ( $...
add a class .
59,409
public function componentTask ( Option $ option ) { $ root = $ this -> getRootAppDir ( $ option ) ; $ current = $ this -> getCurrentAppDir ( $ option ) ; $ prefix = trim ( preg_replace ( '/^' . preg_quote ( $ root , '/' ) . '/' , '' , $ current ) , DS ) ; $ option -> setArg ( 0 , $ prefix . DS . 'Component' . DS . $ op...
add a component .
59,410
public function filterTask ( Option $ option ) { $ root = $ this -> getRootAppDir ( $ option ) ; $ current = $ this -> getCurrentAppDir ( $ option ) ; $ prefix = trim ( preg_replace ( '/^' . preg_quote ( $ root , '/' ) . '/' , '' , $ current ) , DS ) ; $ name = $ option -> getArg ( 0 ) ; if ( ! preg_match ( '/Filter$/'...
add a filter .
59,411
public function specTask ( Option $ option ) { $ runner = $ this -> specHelper -> getRunner ( ) ; foreach ( $ option -> getArgs ( ) as $ class ) { $ path = str_replace ( '\\' , DS , $ class ) ; $ dir = dirname ( $ path ) ; if ( $ dir == '.' ) $ dir = '' ; try { $ skeleton = $ this -> getSkeleton ( 'Spec' ) ; $ class_na...
add a spec .
59,412
public function migrationTask ( Option $ option ) { $ database = $ option -> get ( 'database' ) ; $ current = $ this -> getCurrentAppDir ( $ option ) ; $ migration_dir = $ this -> loader -> find ( $ current . DS . $ this -> application -> config ( 'directory.database.migration' ) ) -> first ( ) ; $ migration_dir -> abs...
add a migration
59,413
public function seederTask ( Option $ option ) { $ database = $ option -> get ( 'database' ) ; $ current = $ this -> getCurrentAppDir ( $ option ) ; $ seeder_dir = $ this -> loader -> find ( $ current . DS . $ this -> application -> config ( 'directory.database.seed' ) ) -> first ( ) ; $ seeder_dir -> absolutize ( ) ; ...
add a seeder
59,414
private function getSkeleton ( $ name , $ suffix = 'php' ) { $ file = $ this -> loader -> find ( $ this -> application -> config ( 'directory.skeleton' ) . DS . ucfirst ( $ name ) . 'Skeleton.' . $ suffix . '.twig' ) -> first ( ) ; $ skeleton = new Skeleton ( $ file ) ; return $ skeleton ; }
get skeleton .
59,415
public function getCurrentAppDir ( Option $ option ) { if ( $ dir = $ option -> get ( 'app-dir' ) ) { return $ dir [ 0 ] === '/' ? $ dir : getcwd ( ) . DS . $ dir ; } else { $ current = getcwd ( ) ; $ default = null ; foreach ( $ this -> application -> config ( 'directory.apps' ) as $ app ) { if ( strpos ( $ current , ...
get current dir in application .
59,416
public function getRootAppDir ( Option $ option ) { if ( $ dir = $ option -> get ( 'root-dir' ) ) { return $ dir [ 0 ] === '/' ? $ dir : getcwd ( ) . DS . $ dir ; } else { $ root = getcwd ( ) ; $ default = null ; foreach ( $ this -> application -> config ( 'directory.apps' ) as $ app ) { if ( strpos ( $ root , $ app [ ...
get root dir in application .
59,417
function save ( ) { $ file = $ this -> _getFilePath ( ) ; $ data = $ this -> data ; $ data = $ this -> getDataInterchange ( ) -> makeForward ( $ data ) ; $ dataStr = "<?php\n" . "return " . var_export ( $ data , true ) . ";\n" ; ErrorStack :: handleError ( E_ALL ) ; $ dirPath = dirname ( $ file ) ; if ( ! file_exists (...
Write Data Into Storage
59,418
function _load ( ) { $ file = $ this -> _getFilePath ( ) ; if ( ! file_exists ( $ file ) ) return ; ErrorStack :: handleError ( E_ALL ) ; $ data = include $ file ; $ data = $ this -> getDataInterchange ( ) -> retrieveBackward ( $ data ) ; if ( $ exception = ErrorStack :: handleDone ( ) ) throw new exReadError ( 'Error ...
Import Persist Data Into Entity as Default Values
59,419
protected function _writeDataOnShutdown ( ) { if ( ! isset ( $ this -> _states [ $ this -> getRealm ( ) ] ) || $ this -> _states [ $ this -> getRealm ( ) ] === self :: $ STATE_OK ) return ; $ this -> save ( ) ; }
Write Data To File
59,420
protected function _getFilePath ( ) { $ opt_directory = $ this -> getDirPath ( ) ; $ file = $ opt_directory . DIRECTORY_SEPARATOR . $ this -> getRealm ( ) . '.array.php' ; return $ file ; }
Get Current Storage FilePath Name
59,421
public function equals ( $ value , bool $ strict = false ) : bool { if ( ! ( $ value instanceof Type ) ) { $ value = new Type ( $ value ) ; } $ res = ( $ value -> typeName === $ this -> typeName ) ; if ( ! $ res && $ strict ) { return $ res ; } if ( $ value -> isStringConvertible ) { return ( $ value -> stringValue ===...
Checks if the current instance is equal to defined value . If strict is FALSE only the value is checked . Otherwise also the type is checked .
59,422
public function getLogLevelName ( $ level ) : string { return isset ( self :: $ levels [ $ level ] ) ? self :: $ levels [ $ level ] : '' ; }
Devuelve el nombre del nivel
59,423
public function logDebug ( $ message , $ object = null ) { $ this -> doLog ( LogHelper :: LOG_LEVEL_DEBUG , $ message , $ object ) ; }
log debug message
59,424
public function logInfo ( $ message , $ object = null ) { $ this -> doLog ( LogHelper :: LOG_LEVEL_INFO , $ message , $ object ) ; }
log an informational message
59,425
public function logWarning ( $ message , $ object = null ) { $ this -> doLog ( LogHelper :: LOG_LEVEL_WARNING , $ message , $ object ) ; }
log a message which may need the attention of the developer but may not endager the main purpose of the application
59,426
public function logFatal ( $ message , $ object = null ) { $ this -> doLog ( LogHelper :: LOG_LEVEL_FATAL , $ message , $ object ) ; }
log an error which may be related to a programming mistake and not related to corrupt data
59,427
public function logException ( Exception $ exception , $ message = null ) { $ msg = $ exception -> getMessage ( ) ; if ( $ message != null ) { $ msg = "Message: " . $ message . " Exception: " . $ msg ; } $ this -> doLog ( LogHelper :: LOG_LEVEL_FATAL , $ msg , null ) ; }
log an exception
59,428
public function read ( $ id ) { $ tmp = $ _SESSION ; $ key = $ this -> getKey ( $ id ) ; $ _SESSION = json_decode ( $ this -> mem -> get ( $ key , false , '' ) , true ) ; $ user = $ this -> getUser ( ) ; if ( $ user instanceof UserInterface ) { $ roles = array ( ) ; foreach ( $ user -> getRoles ( ) as $ role ) { $ role...
Read the id
59,429
public function write ( $ id , $ data ) { $ tmp = $ _SESSION ; session_decode ( $ data ) ; $ newData = $ _SESSION ; $ _SESSION = $ tmp ; $ key = $ this -> getKey ( $ id ) ; return $ this -> mem -> set ( $ key , json_encode ( $ newData ) , $ this -> ttl ) ; }
Write the session data convert to json before storing
59,430
public function destroy ( $ id ) { $ key = $ this -> getKey ( $ id ) ; return $ this -> mem -> remove ( $ key ) ; }
Delete object in session
59,431
public function parseRoute ( $ beforeDispatch ) { $ request = $ this -> application -> request ; $ route = $ this -> router -> matchToRoute ( $ request ) ; if ( ! ( $ route instanceof Route ) ) { throw new Exception ( "A valid route could not be determined" ) ; } $ format = "html" ; if ( isset ( $ route -> params [ 'fo...
Recieves the beforeDispatchEvent Routes the applicaition and gets all route params Stores Route params in the beforeDispatch Event results
59,432
public function redirect ( $ url , $ code = HTTP_FOUND , $ message = "Moved Permanently" , $ alerts = [ ] ) { $ response = $ this -> application -> response ; $ uri = $ this -> application -> createInstance ( Uri :: class , [ $ this -> application -> request ] ) ; if ( ! empty ( $ alerts ) ) { $ session = $ this -> app...
Executes post dispatch redirect
59,433
public function render ( $ template , array $ localVariables = array ( ) ) { $ view = $ this -> getView ( ) ; if ( $ view -> getLayout ( ) ) { $ content = $ view -> renderWithLayout ( $ template , $ localVariables ) ; } else { $ content = $ view -> render ( $ template , $ localVariables ) ; } $ this -> getResponse ( ) ...
Appends template content to the body
59,434
protected function getSpecificRoleSuffix ( $ role ) { return ( empty ( $ role ) || 'LIST' === strtoupper ( $ role ) ) ? '' : self :: ROLE_SEPARATOR . strtoupper ( $ role ) ; }
Get a specific role suffix .
59,435
protected function getSpecificRoleFormatted ( $ role ) { return '' . self :: ROLE_PREFIX . self :: ROLE_SEPARATOR . str_replace ( '\\' , '' , strtoupper ( $ this -> getBundleName ( ) ) ) . self :: ROLE_SEPARATOR . strtoupper ( $ this -> getControllerName ( ) ) . $ this -> getSpecificRoleSuffix ( $ role ) ; }
Get a specific role formatted .
59,436
protected function isGranted ( $ specificRole = 'LIST' , $ genericRole = null ) { $ securityContext = $ this -> getSecurityContext ( ) ; if ( $ securityContext -> isGranted ( is_null ( $ genericRole ) ? $ this -> getSecurityRoleAdmin ( ) : $ genericRole ) ) { return true ; } if ( $ securityContext -> isGranted ( $ this...
Checks if the user has permission to perform the action .
59,437
public function add ( InstallTarget $ target ) { $ this -> targets [ $ target -> getName ( ) ] = $ target ; if ( ! $ this -> defaultTarget ) { $ this -> defaultTarget = $ target ; } }
Adds a target to the collection .
59,438
public function get ( $ targetName ) { if ( InstallTarget :: DEFAULT_TARGET === $ targetName ) { return $ this -> getDefaultTarget ( ) ; } if ( ! isset ( $ this -> targets [ $ targetName ] ) ) { throw NoSuchTargetException :: forTargetName ( $ targetName ) ; } return $ this -> targets [ $ targetName ] ; }
Returns the target with the given name .
59,439
public function remove ( $ targetName ) { if ( InstallTarget :: DEFAULT_TARGET === $ targetName && $ this -> defaultTarget ) { $ targetName = $ this -> defaultTarget -> getName ( ) ; } unset ( $ this -> targets [ $ targetName ] ) ; if ( $ this -> defaultTarget && $ targetName === $ this -> defaultTarget -> getName ( ) ...
Removes a target from the collection .
59,440
public function contains ( $ targetName ) { if ( InstallTarget :: DEFAULT_TARGET === $ targetName ) { return null !== $ this -> defaultTarget ; } return isset ( $ this -> targets [ $ targetName ] ) ; }
Returns whether a target exists .
59,441
private function sortFactories ( ) { $ this -> sorted = [ ] ; krsort ( $ this -> factories ) ; $ this -> sorted = call_user_func_array ( 'array_merge' , $ this -> factories ) ; }
Sorts the internal list of factories by priority .
59,442
public function withMethods ( array $ methods ) { foreach ( $ methods as $ method => $ args ) { $ this -> withMethod ( $ method , $ args ) ; } return $ this ; }
Adds multiple method calls to be executed after instantiating .
59,443
public static function fromEnvironment ( ) : RequestInterface { $ headers = [ ] ; foreach ( $ _SERVER as $ name => $ value ) { if ( strpos ( $ name , 'HTTP_' ) === 0 ) { $ name = substr ( $ name , 5 ) ; $ name = str_replace ( '_' , ' ' , $ name ) ; $ name = strtolower ( $ name ) ; $ name = ucwords ( $ name ) ; $ name =...
Construct from environment variables .
59,444
public function intersect ( array $ tags ) { $ result = new self ( ) ; foreach ( $ tags as $ tag ) { if ( $ this -> contains ( $ tag ) ) { $ result -> addTag ( $ tag ) ; } } return $ result ; }
Return intersection with given tags
59,445
function transact ( callable $ callable ) { $ this -> beginTransaction ( ) ; try { call_user_func ( $ callable ) ; $ this -> commit ( ) ; } catch ( Exception $ e ) { $ this -> rollBack ( ) ; throw $ e ; } }
Runs the given callable in a transaction . If the callback throws automatically rollback the transaction and rethrow . If the callback doesn t throw commit the transaction .
59,446
function storeRedirectUrl ( $ url ) { $ sessionManager = $ this -> _getSessionFlashes ( ) ; $ sessionManager -> offsetSet ( 'auth.login.redirect_url' , $ url ) ; $ sessionManager -> setExpirationHops ( 1 , 'auth.login.redirect_url' ) ; }
On UnAuthorized Or Banned Page Usually Guard redirect to login page . here we store redirect url that can be restore on successful login for redirect .
59,447
public function handleRoutes ( $ event ) { $ event -> getRouter ( ) -> prefix ( '/api/attachment' ) -> post ( 'attachment-upload' , '' , UploadController :: class ) -> prefix ( '/api/helper' ) -> get ( 'helper-pinyin' , '/pinyin' , PinyinController :: class ) -> prefix ( '/api/permission' ) -> get ( 'permission-list' ,...
handle RoutesWillBeLoaded event all core api routes will be loaded here
59,448
function onMvcErrorInjectResponse ( $ e ) { $ error = $ e -> getError ( ) ; if ( empty ( $ error ) || ! $ error instanceof \ Exception ) return ; if ( $ e -> getResult ( ) instanceof Response ) $ e -> setResponse ( $ e -> getResult ( ) ) ; $ response = $ e -> getResponse ( ) ; if ( ! $ response ) { $ response = new Res...
Inject Status Response Code related on Exception
59,449
protected function __getExceptionTemplate ( $ e ) { $ config = $ this -> sm -> get ( 'Config' ) ; $ config = isset ( $ config [ 'view_manager' ] ) && ( is_array ( $ config [ 'view_manager' ] ) || $ config [ 'view_manager' ] instanceof \ ArrayAccess ) ? $ config [ 'view_manager' ] : array ( ) ; $ exceptionTemplate = 'sp...
Retrieve the exception template
59,450
public function purge ( $ data ) { $ processPayload = $ this -> process ( __FUNCTION__ , $ data ) ; if ( ! $ processPayload -> isStatus ( Payload :: STATUS_VALID ) ) { return $ processPayload ; } $ identifierPayload = $ this -> aggregate [ IdentifierServiceProvider :: getProviderKey ( ) ] -> get ( [ 'filter' => [ 'uuid...
Purge Entity .
59,451
protected function updateByEntity ( $ data , $ entity ) { return $ this -> aggregate [ $ entity -> getType ( true ) ] -> update ( $ data , $ entity ) ; }
Update a Entity by object .
59,452
protected function updateByIdentifier ( $ identifier , $ data ) { return $ this -> aggregate [ IdentifierServiceProvider :: getProviderKey ( ) ] -> update ( $ identifier -> getEntity ( ) , $ data ) ; }
Update an Entity by Identifier .
59,453
public function getOneByUuid ( $ uuid ) { $ identifierPayload = $ this -> aggregate [ IdentifierServiceProvider :: getProviderKey ( ) ] -> first ( [ 'filter' => [ 'uuid' => $ uuid ] ] ) ; if ( $ identifierPayload -> getStatus ( ) != 'found' ) { return $ identifierPayload ; } return $ this -> aggregate [ $ this -> forma...
Get an Entity by it s UUID .
59,454
protected function getOneByCompoundKey ( $ key ) { $ sanitizedKey = [ ] ; if ( $ this -> isAssociativeArray ( $ key ) ) { if ( array_key_exists ( 'entity_type' , $ key ) && array_key_exists ( 'entity_id' , $ key ) ) { $ sanitizedKey [ 'entity_type' ] = $ key [ 'entity_type' ] ; $ sanitizedKey [ 'entity_id' ] = $ key [ ...
Get an Entity by compound key .
59,455
public function createIdentifier ( $ data ) { switch ( gettype ( $ data ) ) { case 'object' : $ createData = [ 'entity_type' => $ data -> getType ( ) , 'entity_id' => $ data -> getKey ( ) ] ; break ; default : $ createData = $ data ; break ; } return $ this -> aggregate [ IdentifierServiceProvider :: getProviderKey ( )...
Create a new EntityIdentifier for a newly created Entity .
59,456
public function getConfiguration ( $ key = null ) { if ( is_null ( $ key ) ) { return $ this -> configuration + $ this -> core [ 'configuration' ] ; } $ configuration = $ this -> configuration + $ this -> core [ 'configuration' ] ; if ( array_key_exists ( $ key , $ configuration ) ) { return $ configuration [ $ key ] ;...
Get the process configuration .
59,457
protected function process ( $ context , $ data ) { $ context = strtoupper ( $ context ) ; if ( is_null ( $ this -> getConfiguration ( $ context ) ) ) { return new Payload ( null , strtolower ( $ context . '_not_configured' ) ) ; } return $ this -> processor -> process ( $ data , $ this -> getConfiguration ( $ context ...
Process Data for the Given Context .
59,458
public function build ( RootNode & $ root ) { $ parser = new RoutingRuleParser ( $ this -> routing_rule ) ; try { $ section_list_set = $ parser -> parse ( ) ; } catch ( RoutingRuleParseException $ e ) { throw new RouterNodeBuilderException ( $ this -> routing_rule , 'Parse failed' ) ; } $ node = $ root ; foreach ( $ se...
Build router node tree
59,459
private function createCreateForm ( SurveyCategory $ entity ) { $ form = $ this -> createForm ( new SurveyCategoryType ( ) , $ entity , array ( 'action' => $ this -> generateUrl ( 'surveycategory_create' ) , 'method' => 'POST' , ) ) ; $ form -> add ( 'submit' , 'submit' , array ( 'label' => 'Create' ) ) ; return $ form...
Creates a form to create a SurveyCategory entity .
59,460
public function newAction ( ) { $ entity = new SurveyCategory ( ) ; $ form = $ this -> createCreateForm ( $ entity ) ; return array ( 'entity' => $ entity , 'form' => $ form -> createView ( ) , ) ; }
Displays a form to create a new SurveyCategory entity .
59,461
private function createEditForm ( SurveyCategory $ entity ) { $ form = $ this -> createForm ( new SurveyCategoryType ( ) , $ entity , array ( 'action' => $ this -> generateUrl ( 'surveycategory_update' , array ( 'id' => $ entity -> getId ( ) ) ) , 'method' => 'PUT' , ) ) ; $ form -> add ( 'submit' , 'submit' , array ( ...
Creates a form to edit a SurveyCategory entity .
59,462
public function setHiddenColumns ( $ columns ) { $ this -> hiddenColumns = array ( ) ; foreach ( $ columns as $ column ) { $ this -> hiddenColumns [ ] = $ column ; } return $ this ; }
Set hidden - columns
59,463
public function setDefaultSearch ( $ search ) { $ this -> defaultSearch = array ( ) ; foreach ( $ search as $ column => $ spec ) { $ this -> defaultSearch [ $ column ] = $ spec ; } return $ this ; }
Set default search
59,464
public function setDefaultOrders ( $ orders ) { $ this -> defaultOrders = array ( ) ; foreach ( $ orders as $ order => $ dir ) { $ this -> defaultOrders [ $ order ] = $ dir ; } return $ this ; }
Set default orders
59,465
public function getColumnId ( $ column ) { if ( $ this -> getColumnsUseTranslation ( ) ) { $ translatePrefix = $ this -> getColumnTranslatePrefix ( ) ; $ translatePostfix = $ this -> getColumnTranslatePostfix ( ) ; $ column = ( empty ( $ translatePrefix ) ? '' : $ translatePrefix . '.' ) . $ column . ( empty ( $ transl...
Get column s id
59,466
public function getColumnName ( $ column ) { if ( $ this -> getColumnsUseTranslation ( ) ) { $ column = $ this -> view -> translate ( $ this -> getColumnId ( $ column ) , $ this -> getColumnTranslateTextDomain ( ) ) ; } return $ column ; }
Get column s translated name
59,467
public function getId ( ) { if ( empty ( $ this -> id ) ) { if ( $ this -> getColumnsUseTranslation ( ) ) { $ id = trim ( $ this -> getColumnTranslatePrefix ( ) . '.' . $ this -> getColumnTranslatePostfix ( ) , '.' ) ; if ( ! empty ( $ id ) ) { return str_replace ( '.' , '_' , $ id ) ; } } $ this -> id = String :: gene...
Get RowSet s ID
59,468
public function isColumnSearched ( $ column ) { $ store = $ this -> getStore ( ) ; if ( isset ( $ store [ 'search' ] [ $ column ] ) ) { foreach ( $ store [ 'search' ] [ $ column ] as $ search ) { if ( ! empty ( $ search ) ) { return true ; } } } return false ; }
Is column searched
59,469
public function column ( $ type ) { $ classPrefix = __CLASS__ . '\\Type\\' ; if ( is_string ( $ type ) && class_exists ( $ classPrefix . ucfirst ( $ type ) ) ) { $ type = ucfirst ( $ type ) ; $ args = func_get_args ( ) ; array_shift ( $ args ) ; } else if ( is_callable ( $ type ) ) { $ args = func_get_args ( ) ; $ type...
Create a column type
59,470
public function render ( $ bodyOnly = false ) { $ this -> parseRequest ( ) ; $ result = $ this -> view -> render ( 'rowSet/layout' , array ( 'rowSet' => $ this , ) ) ; if ( $ bodyOnly ) { return $ result ; } if ( $ this -> hasFlags ( self :: FLAG_LAYOUT_FILTERING ) ) { $ result = $ this -> view -> render ( 'rowSet/layo...
Render the row - set
59,471
public function init ( $ config = [ ] ) { if ( isset ( $ config [ 'error_callback' ] ) ) { $ this -> errorCallback = $ config [ 'error_callback' ] ; } if ( isset ( $ config [ 'exception_callback' ] ) ) { $ this -> exceptionCallback = $ config [ 'exception_callback' ] ; } if ( isset ( $ config [ 'shutdown_callback' ] ) ...
Initialises the error handler .
59,472
public function handleError ( $ errno , $ message = '' , $ file = '' , $ line = '' , $ context = [ ] ) { restore_error_handler ( ) ; if ( $ errno === NULL ) { $ error = error_get_last ( ) ; $ error = [ 'file' => $ error [ 'file' ] , 'line' => $ error [ 'line' ] , 'message' => $ error [ 'message' ] , 'trace' => $ this -...
Handles PHP errors that may occur .
59,473
public function getBacktrace ( $ trace ) { $ traces = [ ] ; $ i = 1 ; foreach ( $ trace as $ t ) { $ traceString = '' ; if ( ! isset ( $ t [ 'file' ] ) ) { $ t [ 'file' ] = 'unknown' ; } if ( ! isset ( $ t [ 'line' ] ) ) { $ t [ 'line' ] = 0 ; } if ( ! isset ( $ t [ 'function' ] ) ) { $ t [ 'function' ] = 'unknown' ; }...
Returns a list of traces for the error or exception .
59,474
public function format ( $ ex ) { $ this -> inspector = new Inspector ( $ ex ) ; if ( $ ex instanceof ErrorException ) { $ type = $ this -> determineSeverityTextValue ( $ ex -> getSeverity ( ) ) ; } else { $ type = ( $ ex instanceof Exception ? 'Uncaught ' : '' ) . $ this -> inspector -> getExceptionName ( ) ; } return...
Format function required by the FormatterInterface . Will be called by BooBoo . We will use this as our entry point for rendering the error page .
59,475
public function setTheme ( $ theme ) { $ this -> theme = [ ] ; foreach ( ( array ) $ theme as $ path ) { $ this -> theme [ ] = $ path === 'default' ? self :: $ defaultCSS : $ path ; } return $ this ; }
Sets the theme files to use for theming the default template .
59,476
public function isExcerptOnly ( $ excerptOnly = null ) { if ( $ excerptOnly !== null ) { $ this -> excerptOnly = ( bool ) $ excerptOnly ; } return $ this -> excerptOnly ; }
Returns whether excerpt mode is enabled or not .
59,477
public function getExcerptStart ( $ line ) { if ( $ this -> isExcerptOnly ( ) === false ) { return 1 ; } return max ( 1 , $ line - floor ( $ this -> getExcerptSize ( ) / 2 ) ) ; }
Returns the starting line number of an excerpt for a given line number .
59,478
protected function getCaller ( Frame $ frame ) { $ class = $ frame -> getClass ( ) ; $ fn = $ frame -> getFunction ( ) ; $ caller = '' ; if ( $ class ) { $ caller .= $ class ; } if ( $ class && $ fn ) { $ caller .= '::' ; } if ( $ fn ) { $ caller .= $ fn . '(' . $ this -> getArgumentsAsString ( $ frame -> getArgs ( ) )...
Returns the fully qualified name for the called function .
59,479
protected function getArgumentsAsString ( array $ args ) { $ result = [ ] ; $ isNumeric = Jasny \ is_numeric_array ( $ args ) ; $ stringify = function ( $ input ) { return sprintf ( "'%s'" , addcslashes ( $ input , "'" ) ) ; } ; foreach ( $ args as $ key => $ arg ) { switch ( strtolower ( gettype ( $ arg ) ) ) { case '...
Turns an array of arguments into a pretty formatted argument string which can be used to visualize the original function call .
59,480
protected function render ( $ error ) { $ ife = function ( $ condition , $ if , $ else = null ) { return $ condition ? $ if : $ else ; } ; $ classes = function ( ... $ classes ) { return implode ( ' ' , array_filter ( $ classes , 'strlen' ) ) ; } ; $ showCode = $ this -> isExcerptOnly ( ) === false || $ this -> getExce...
Renders the error page with the given error and template file .
59,481
protected function read ( $ file , $ type = 'raw' , array $ data = [ ] ) { $ type = strtolower ( $ type ) ; if ( $ type === 'include' || $ type === 'require' ) { ob_start ( ) ; extract ( $ data ) ; unset ( $ data ) ; if ( $ type === 'include' ) { include $ file ; } else { require $ file ; } return ob_get_clean ( ) ; } ...
Tries to read a given file . May use a specific type of reading .
59,482
public static function concat ( $ items ) { if ( is_string ( $ items ) ) { $ lines = explode ( "\n" , $ items ) ; $ str = '' ; foreach ( $ lines as $ line ) { $ str .= trim ( $ line ) ; } $ items = explode ( '|' , $ str ) ; } $ txt = '' ; foreach ( $ items as $ value ) { if ( ! preg_match ( '/^\{[^}]+\}$/' , $ value ) ...
Transform a string or a tab to an SQL concatenation
59,483
public static function makeSuccess ( CheckerInterface $ checker , $ messages = null ) : Success { return new Success ( $ checker , ... self :: castIntoArray ( $ messages ) ) ; }
Make a success instance with optional message .
59,484
public static function makeDisabled ( CheckerInterface $ checker , $ messages = null ) : Disabled { return new Disabled ( $ checker , ... self :: castIntoArray ( $ messages ) ) ; }
Make a disable instance with optional message .
59,485
protected function setHeader ( $ name , $ value ) { if ( ! is_array ( $ value ) ) { $ value = [ $ value ] ; } $ this -> headers [ $ name ] = $ value ; $ this -> headerKeys [ strtolower ( $ name ) ] = $ name ; }
Set the value of a header .
59,486
private function createFile ( InputInterface $ input , OutputInterface $ output , $ subDir = '' , $ content = '' ) { $ path = $ this -> getFilePath ( $ input , $ subDir ) ; $ this -> writeFile ( $ input , $ output , $ path , $ content ) ; }
Create a new file .
59,487
private function getFilePath ( InputInterface $ input , $ subDir ) { $ path = [ ] ; $ path [ ] = $ this -> getContainer ( ) -> getParameter ( 'sculpin.source_dir' ) ; $ path [ ] = $ subDir ; $ path [ ] = $ input -> getOption ( 'filename' ) ; return implode ( DIRECTORY_SEPARATOR , array_filter ( $ path ) ) ; }
Generate the name and path for the new file .
59,488
private function writeFile ( InputInterface $ input , OutputInterface $ output , $ path , $ content ) { $ shortPath = str_replace ( getcwd ( ) . '/' , '' , $ path ) ; $ filesystem = $ this -> getContainer ( ) -> get ( 'filesystem' ) ; if ( ! $ filesystem -> exists ( $ path ) || $ input -> getOption ( 'force' ) ) { $ fi...
Writes a file to disk .
59,489
protected function _assertSessionRestriction ( ) { $ stat = false ; if ( php_sapi_name ( ) !== 'cli' ) { if ( version_compare ( phpversion ( ) , '5.4.0' , '>=' ) ) { $ stat = ( session_status ( ) !== PHP_SESSION_DISABLED ? true : false ) ; } else { $ stat = ( session_id ( ) === '' ? false : true ) ; } } if ( false === ...
Does a session exist and is it currently active?
59,490
public static function Init ( \ Puzzlout \ Framework \ Controllers \ BaseController $ controller ) { $ viewLoader = new ViewLoader ( ) ; $ viewLoader -> controller = $ controller ; return $ viewLoader ; }
Instantiate the class .
59,491
public function GetView ( ) { $ FrameworkView = $ this -> GetPathForView ( DirectoryManager :: GetFrameworkRootDir ( ) ) ; $ ApplicationView = $ this -> GetPathForView ( DirectoryManager :: GetApplicationRootDir ( ) ) ; if ( file_exists ( $ FrameworkView ) ) { return $ FrameworkView ; } if ( file_exists ( $ Application...
Retrieve the view from either the Framework folder or the current Application folder .
59,492
public function GetPartialView ( $ viewName ) { $ ListOfPathToCheck = array ( DirectoryManager :: GetFrameworkRootDir ( ) . "Modules/" , DirectoryManager :: GetFrameworkRootDir ( ) . $ this -> controller -> module ( ) . "/Modules/" , DirectoryManager :: GetApplicationRootDir ( ) . "/Modules/" , DirectoryManager :: GetA...
Retrieve the partial view from either the Framework folder or the current Application folder .
59,493
public function GetPathForView ( $ rootDir ) { $ path = "APP_ROOT_DIR" . $ rootDir . ucfirst ( $ this -> controller -> module ( ) ) . "/" . ucfirst ( $ this -> controller -> action ( ) ) . self :: VIEWFILEEXTENSION ; return $ path ; }
Computes the path of the view .
59,494
public function useSportQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinSport ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'Sport' , '\gossi\trixionary\model\SportQuery' ) ; }
Use the Sport relation Sport object
59,495
public function useSkillGroupQuery ( $ relationAlias = null , $ joinType = Criteria :: INNER_JOIN ) { return $ this -> joinSkillGroup ( $ relationAlias , $ joinType ) -> useQuery ( $ relationAlias ? $ relationAlias : 'SkillGroup' , '\gossi\trixionary\model\SkillGroupQuery' ) ; }
Use the SkillGroup relation SkillGroup object
59,496
public function filterBySkill ( $ skill , $ comparison = Criteria :: EQUAL ) { return $ this -> useSkillGroupQuery ( ) -> filterBySkill ( $ skill , $ comparison ) -> endUse ( ) ; }
Filter the query by a related Skill object using the kk_trixionary_skill_group table as cross reference
59,497
private function logException ( \ Exception $ e ) { if ( isset ( $ this -> logger ) ) { $ this -> logger -> notice ( $ e -> getMessage ( ) , [ 'code' => $ e -> getCode ( ) , 'line' => $ e -> getLine ( ) , 'file' => $ e -> getFile ( ) , ] ) ; } else { error_log ( sprintf ( '[%s] [%s:%d] %s' , $ e -> getCode ( ) , $ e ->...
Savely wrap the logger .
59,498
public static function exec ( ) : array { self :: $ output = self :: $ input = file_get_contents ( self :: $ filePath ) ; self :: $ arrInput = file ( self :: $ filePath ) ; $ annotationService = ServiceFactory :: getInstance ( AnnotationServiceImpl :: class ) ; $ className = Main :: getClassNameFromFile ( self :: $ inp...
return the result string
59,499
protected static function encodeVarList ( array & $ info ) { foreach ( $ info as $ k => & $ var ) { $ var [ 'annotation' ] [ 'name' ] = self :: aliasMapParse ( $ var [ 'annotation' ] [ 'name' ] ) ; self :: setInput ( $ var ) ; $ info [ $ k ] [ 'buildStr' ] = forward_static_call_array ( [ $ var [ 'annotation' ] [ 'name'...
encode var list