idx int64 0 60.3k | question stringlengths 92 4.62k | target stringlengths 7 635 |
|---|---|---|
500 | public function set ( $ key , $ value = null , $ filter = null ) { is_null ( $ filter ) and $ filter = $ this -> _auto_filter ; $ this -> _view -> set ( $ key , $ value , $ filter ) ; return $ this ; } | Sets a variable on the template |
501 | public function auto_filter ( $ setting = null ) { if ( func_num_args ( ) == 0 ) { return $ this -> _view -> auto_filter ( ) ; } return $ this -> _view -> auto_filter ( $ setting ) ; } | Change auto filter setting |
502 | public function banAction ( ) { $ params = $ this -> params ( ) ; $ locator = $ this -> getServiceLocator ( ) ; $ model = $ locator -> get ( 'Grid\User\Model\User\Model' ) ; $ user = $ model -> find ( $ params -> fromRoute ( 'id' ) ) ; if ( empty ( $ user ) ) { $ this -> getResponse ( ) -> setStatusCode ( 404 ) ; retur... | Ban a user |
503 | protected function getUserModel ( ) { if ( null === $ this -> userModel ) { $ this -> userModel = $ this -> getServiceLocator ( ) -> get ( 'Grid\User\Model\User\Model' ) ; } return $ this -> userModel ; } | Get user model |
504 | public function getIdentity ( ) { $ identity = parent :: getIdentity ( ) ; if ( null !== $ identity && ! $ this -> identityRefreshed ) { $ user = $ this -> getUserModel ( ) -> find ( $ identity -> id ) ; if ( ! empty ( $ user ) ) { $ this -> getStorage ( ) -> write ( $ identity = $ user ) ; $ this -> identityRefreshed ... | Returns the identity from storage or null if no identity is available |
505 | public static function getAll ( $ mapping ) { $ mappingsArray = array ( ) ; foreach ( $ mapping as $ mappedEntity ) { $ instance = new Mapper ( ) ; self :: populateInstance ( $ instance , $ mappedEntity ) ; $ mappingsArray [ ] = $ instance ; } return $ mappingsArray ; } | Get an array of all mappers . |
506 | private function getRandomChoice ( CustomField $ field ) { $ choices = $ field -> getOptions ( ) [ 'choices' ] ; $ multiple = $ field -> getOptions ( ) [ 'multiple' ] ; $ other = $ field -> getOptions ( ) [ 'other' ] ; if ( $ other ) { $ choices [ ] = array ( 'slug' => '_other' ) ; } $ picked = array ( ) ; if ( $ multi... | pick a random choice |
507 | public static function saveMany ( $ datasets ) { $ models = [ ] ; if ( ! is_array ( $ datasets ) ) { $ datasets = [ $ datasets ] ; } foreach ( $ datasets as $ dataset ) { $ class = get_called_class ( ) ; $ model = new $ class ( ) ; foreach ( $ dataset as $ attribute => $ value ) { $ model -> { $ attribute } = $ value ;... | Saves many Models . |
508 | public function getVersions ( ) { $ record = $ this -> getRecord ( ) ; $ return = ArrayList :: create ( ) ; if ( $ record -> hasExtension ( Versioned :: class ) ) { $ versions = $ record -> AllVersions ( ) ; foreach ( $ versions as $ version ) { $ i = $ version -> Version ; $ diff = null ; if ( $ i > 1 ) { $ frm = Vers... | Get a list of versions of the current record . |
509 | private function buildInternal ( array $ arguments ) { $ builder = ProcessBuilder :: create ( $ this -> config -> getPhpCliBinary ( ) ) ; if ( null !== ( $ cliArguments = $ this -> config -> getPhpCliArguments ( ) ) ) { $ builder -> addArguments ( $ cliArguments ) ; } $ builder -> addArguments ( $ arguments ) ; if ( nu... | Build the internal process builder . |
510 | public function prepareSearchParam ( ) { if ( isset ( $ this -> request [ 'searchFields' ] ) and ! empty ( $ this -> request [ 'searchFields' ] ) ) { $ returnSearch = Array ( ) ; $ countSearchFields = 0 ; foreach ( $ this -> request [ 'searchFields' ] as $ key => $ value ) { $ returnSearch [ $ countSearchFields ] [ 'in... | Prepara valores e colunas de filtro |
511 | private function prepareSearchStatus ( $ valueColumn , $ getParamsFieldGrid , $ columNamesSearchSort ) { $ valuesTranslate = explode ( "," , $ this -> translate -> translate ( $ columNamesSearchSort . '_values' ) ) ; $ valuesTranslateFlip = array_flip ( $ valuesTranslate ) ; $ valuesIni = explode ( "," , $ getParamsFie... | Prepara o valor de busca para coluna do tipo Status |
512 | protected function prepareOptions ( ) { $ options = [ ] ; foreach ( $ this -> getSelectOptions ( ) as $ value => $ label ) { $ value = addslashes ( $ value ) ; $ label = addslashes ( $ label ) ; $ options [ ] = [ 'sValue' => $ value , 'sLabel' => $ label , ] ; } return $ options ; } | Formats field options as javascript |
513 | public function add ( $ key , $ message ) { $ fullKey = static :: SESSION_NAME . '.' . $ key ; $ base = Base :: instance ( ) ; if ( $ base -> exists ( $ fullKey ) ) { $ base -> push ( $ fullKey , $ message ) ; } else { $ base -> set ( $ fullKey , [ $ message ] ) ; } return $ this ; } | Add message to flash message |
514 | public function get ( $ key ) { $ fullKey = static :: SESSION_NAME . '.' . $ key ; $ base = Base :: instance ( ) ; $ message = $ base -> get ( $ fullKey ) ; $ base -> clear ( $ fullKey ) ; return $ message ; } | Get message from flash message |
515 | public function all ( ) { $ base = Base :: instance ( ) ; $ messages = $ base -> get ( static :: SESSION_NAME ) ; $ base -> clear ( static :: SESSION_NAME ) ; return $ messages ; } | Get all message |
516 | private function executeRead ( $ statement , array $ parameters ) { if ( $ this -> transactionCount == 0 ) { $ connection = $ this -> pool -> selectReadConnection ( ) ; } else { $ connection = $ this -> transactionConnection ; } try { return $ connection -> execute ( $ this -> expandPlaceholders ( $ statement , $ param... | Executes a statement using a read connection from the pool . |
517 | private function executeWrite ( $ statement , array $ parameters ) { if ( $ this -> transactionCount == 0 ) { $ connection = $ this -> pool -> selectWriteConnection ( ) ; } else { $ connection = $ this -> transactionConnection ; } try { return $ connection -> execute ( $ this -> expandPlaceholders ( $ statement , $ par... | Executes a statement using a write connection from the pool . |
518 | private function expandPlaceholders ( $ statement , array $ parameters ) { $ index = 0 ; return preg_replace_callback ( '/[\.]{3}\?|\?/' , function ( $ match ) use ( & $ index , & $ statement , & $ parameters ) { if ( $ match [ 0 ] != '...?' ) { ++ $ index ; return $ match [ 0 ] ; } if ( ! is_array ( $ parameters [ $ i... | Replaces variable length placeholders with the real number of placeholder . |
519 | public function childelementtypesAction ( Request $ request ) { $ eid = $ request -> get ( 'eid' ) ; $ elementService = $ this -> get ( 'phlexible_element.element_service' ) ; $ iconResolver = $ this -> get ( 'phlexible_element.icon_resolver' ) ; $ element = $ elementService -> findElement ( $ eid ) ; $ elementtype = $... | List all element types . |
520 | public function copyAction ( Request $ request ) { $ parentId = $ request -> get ( 'id' ) ; $ sourceId = $ request -> get ( 'for_tree_id' ) ; $ prevId = $ request -> get ( 'prev_id' ) ; $ elementService = $ this -> get ( 'phlexible_element.element_service' ) ; $ treeManager = $ this -> get ( 'phlexible_tree.tree_manage... | Copy an Element . |
521 | public function moveAction ( Request $ request ) { $ id = $ request -> get ( 'id' ) ; $ targetId = $ request -> get ( 'target' ) ; $ treeManager = $ this -> get ( 'phlexible_tree.tree_manager' ) ; $ tree = $ treeManager -> getByNodeId ( $ id ) ; $ node = $ tree -> get ( $ id ) ; $ targetTree = $ treeManager -> getByNod... | Move an Element . |
522 | public function checkDeleteAction ( Request $ request ) { $ treeId = $ request -> get ( 'id' ) ; $ language = $ request -> get ( 'language' , 'de' ) ; $ treeManager = $ this -> get ( 'phlexible_tree.tree_manager' ) ; $ treeMeditator = $ this -> get ( 'phlexible_tree.mediator' ) ; $ siterootManager = $ this -> get ( 'ph... | predelete action check if element has instances . |
523 | public function deleteAction ( Request $ request ) { $ treeIds = $ request -> get ( 'id' ) ; if ( ! is_array ( $ treeIds ) ) { $ treeIds = [ $ treeIds ] ; } $ treeManager = $ this -> get ( 'phlexible_tree.tree_manager' ) ; foreach ( $ treeIds as $ treeId ) { $ tree = $ treeManager -> getByNodeId ( $ treeId ) ; $ node =... | Delete an Element . |
524 | public function checkStatus ( ) { if ( array_key_exists ( '_status' , $ this -> attributes ) && $ this -> attributes [ '_status' ] == 'new' ) { $ this -> attributes [ '_status' ] = 'old' ; return ; } $ this -> attributes = array ( ) ; $ this -> clear ( ) ; } | Metodo llamado en Kodazzi \ boostrap . php para verificar el estatus de la bolsa . |
525 | public function listJsonAction ( Request $ request ) { $ totalEntities = $ this -> countTotal ( ) ; $ offset = intval ( $ request -> get ( 'iDisplayStart' ) ) ; $ limit = intval ( $ request -> get ( 'iDisplayLength' ) ) ; $ sortColumn = intval ( $ request -> get ( 'iSortCol_0' ) ) ; $ sortDirection = $ request -> get (... | Lists all translation entities . |
526 | public function newAction ( Request $ request ) { $ entity = new Translation ( ) ; $ form = $ this -> createForm ( 'CoreBundle\Form\TranslationType' , $ entity ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ this -> updateTranslation ( $ entity ) ; $ this -> get... | Creates a new translation entity . |
527 | public function showAction ( Request $ request , $ key , $ domain ) { $ deleteForm = $ this -> createDeleteForm ( $ key , $ domain ) ; $ entity = $ this -> get ( 'asm_translation_loader.translation_manager' ) -> findTranslationBy ( array ( 'transKey' => $ key , 'transLocale' => $ request -> getLocale ( ) , 'messageDoma... | Finds and displays a translation entity . |
528 | public function editAction ( Request $ request , $ key , $ domain ) { $ translation = $ this -> get ( 'asm_translation_loader.translation_manager' ) -> findTranslationBy ( array ( 'transKey' => $ key , 'transLocale' => $ request -> getLocale ( ) , 'messageDomain' => $ domain , ) ) ; $ entity = new Translation ( ) ; $ e... | Displays a form to edit an existing translation entity . |
529 | public function deleteAction ( Request $ request , $ key , $ domain ) { $ form = $ this -> createDeleteForm ( $ key , $ domain ) ; $ form -> handleRequest ( $ request ) ; if ( $ form -> isSubmitted ( ) && $ form -> isValid ( ) ) { $ translation = $ this -> get ( 'asm_translation_loader.translation_manager' ) -> findTra... | Deletes a translation entity . |
530 | private function createDeleteForm ( $ key , $ domain ) { return $ this -> createFormBuilder ( ) -> setAction ( $ this -> generateUrl ( 'core_translation_delete' , array ( 'key' => $ key , 'domain' => $ domain ) ) ) -> setMethod ( 'DELETE' ) -> getForm ( ) ; } | Creates a form to delete a translation entity . |
531 | static function createWorkflow ( $ workflow_config ) { self :: validateConfig ( $ workflow_config ) ; self :: validateState ( $ workflow_config [ self :: CONF_HANDLER ] , $ workflow_config [ self :: CONF_INITIAL_STATE ] ) ; if ( ! isset ( $ workflow_config [ "name" ] ) ) { $ workflow_config [ "name" ] = $ workflow_conf... | Function creates and saves the workflow_config . |
532 | static function runFromConfig ( $ workflow_config , $ workflow_state ) { $ workflow_classname = $ workflow_config [ self :: CONF_HANDLER ] ; self :: validateConfig ( $ workflow_config ) ; self :: validateState ( $ workflow_classname , $ workflow_state ) ; $ workflow_params = $ workflow_config [ self :: CONF_PARAMS ] ; ... | This does not do any checks towards the database if there is jobs running . |
533 | static function isWorkflowInErrorState ( $ workflow_key , $ error_ttl ) { $ status = self :: STATUS_FAILED ; $ created_after = "-$error_ttl seconds" ; $ data = DataStore :: retrieveMostCurrentWorkflowJobByAgeAndStatus ( $ workflow_key , $ status , $ created_after ) ; return ( bool ) $ data ; } | Checks if its long since last error . This allows us to not spam apis with error for instance . |
534 | static function getWorkflowState ( $ workflow_key ) { $ status = self :: STATUS_COMPLETED ; $ created_after = "-20 years" ; $ data = DataStore :: retrieveMostCurrentWorkflowJobByAgeAndStatus ( $ workflow_key , $ status , $ created_after ) ; if ( $ data ) { return $ data [ "end_state" ] ; } else { $ workflow = DataStore... | Will check the last successful job and retrive state from it . |
535 | static function isWorkflowRunning ( $ workflow_key ) { $ status = self :: STATUS_RUNNING ; if ( Util :: isDevServer ( ) ) { $ created_after = "-60 seconds" ; } else { $ created_after = "-" . Moment :: ONEHOUR . " seconds" ; } $ data = DataStore :: retrieveMostCurrentWorkflowJobByAgeAndStatus ( $ workflow_key , $ status... | Will check if there is still a job running |
536 | static function startJob ( $ workflow_job_key , $ workflow_job_config , $ start_state ) { $ workflow_key = self :: createWorkflowKeyFromConfig ( $ workflow_job_config ) ; $ workflow_name = $ workflow_job_config [ "name" ] ; if ( self :: isWorkflowRunning ( $ workflow_key ) ) { throw new \ Exception ( "A job for $workfl... | Returns the workflow state from previous job . Performs the check on the previous job . Returns the state form the previous job . |
537 | static function endJob ( $ workflow_job_key , $ workflow_job_config , $ end_state = [ ] ) { $ workflow_job_config = array_merge ( $ workflow_job_config , [ "status" => self :: STATUS_COMPLETED , "end_state" => $ end_state , "finished" => new \ DateTime ( ) ] ) ; DataStore :: saveWorkflowJob ( $ workflow_job_key , $ wor... | Returnes a report . |
538 | static function endpointHandler ( RequestInterface $ request ) { $ get_param = "workflow_key" ; $ query_params = Util :: getParamsFromRequest ( $ request ) ; if ( isset ( $ query_params [ $ get_param ] ) ) { $ result = self :: runFromKey ( $ query_params [ $ get_param ] ) ; return $ result ; } else { $ workflows = Data... | Handler that can be use to as an endpoint to perform various . |
539 | public function renderJs ( ) { $ javascriptType = $ this -> getJavascriptType ( ) ; $ conditionJavascript = $ this -> getCondition ( ) -> renderJs ( ) ; $ fieldName = $ this -> getField ( ) -> getName ( ) ; $ formName = $ this -> getForm ( ) -> getName ( ) ; return sprintf ( "new GFormDependency(GFormDependency.%s, '%s... | Returns javascript part for dependency |
540 | public function getTemplateAccessors ( ) { if ( $ this -> templateAccessors ) return $ this -> templateAccessors ; $ vars = parent :: getTemplateAccessors ( ) ; return $ this -> templateAccessors = array_merge ( $ vars , array ( 'To' , 'Cc' , 'Bcc' , 'From' , 'Subject' , 'Body' , 'BaseURL' , 'IsEmail' ) ) ; } | Gets all the template accessors and caches the result |
541 | public function execute ( \ Sigbits \ RoombaLib \ SCI \ Command $ command ) { $ this -> connection -> write ( $ command ) ; } | Sends a command to the connection |
542 | public function Set ( $ sKey , $ mValue ) { if ( ! empty ( $ this -> sModuleName ) ) Storage :: Set ( "app." . $ this -> sModuleName . "." . $ sKey , $ mValue ) ; return $ this ; } | Function to set module settings |
543 | protected function reconcileNames ( $ item ) { if ( ! property_exists ( $ item , 'title' ) && property_exists ( $ item , 'name' ) ) { $ item -> title = $ item -> name ; } } | Method to reconcile non standard names from components to usage in this class . Typically overriden in the component feed view class . |
544 | public function getAuthenticatedRequest ( $ method , $ url , $ token , array $ options = [ ] ) { $ options [ 'headers' ] [ 'Accept' ] = 'application/vnd.api+json, application/vnd.api+json; net.youthweb.api.version=0.9' ; $ options [ 'headers' ] [ 'Content-Type' ] = 'application/vnd.api+json' ; return parent :: getAuthe... | Returns an authenticated PSR - 7 request instance for Youthweb - API . |
545 | public function logoutAction ( ) { $ this -> getUserService ( ) -> getAuthService ( ) -> getStorage ( ) -> clear ( ) ; $ this -> getUserService ( ) -> getAuthService ( ) -> clearIdentity ( ) ; return $ this -> redirect ( ) -> toRoute ( 'small-user-auth' , [ 'action' => 'logout-page' ] ) ; } | Logout and clear the identity + Redirect to fix the identity |
546 | public function buildCommand ( ) { $ this -> cleanCommand ( ) ; $ framework = new Generator \ Framework ; $ atomicKitten = new Generator \ AtomicKitten ; $ framework -> build ( ) ; $ this -> outputLine ( 'Generation of framework finished.' , [ ] , CommandController :: OK ) ; $ atomicKitten -> build ( ) ; $ this -> outp... | Will generate the static AtomicKitten . |
547 | public function cleanCommand ( ) { if ( is_dir ( $ this -> buildSettings [ 'target' ] ) ) { \ TYPO3 \ Flow \ Utility \ Files :: removeDirectoryRecursively ( $ this -> buildSettings [ 'target' ] ) ; } mkdir ( $ this -> buildSettings [ 'target' ] ) ; $ this -> outputLine ( 'Cleaned target folder.' , [ ] , CommandControll... | Will remove all generated files . |
548 | protected function updateNodeResponse ( Response $ response , ReadNodeInterface $ node , Request $ request ) { $ tagManager = $ this -> get ( 'open_orchestra_base.manager.tag' ) ; $ cacheableManager = $ this -> get ( 'open_orchestra_display.manager.cacheable' ) ; $ cacheTags = array ( $ tagManager -> formatNodeIdTag ( ... | Update response headers |
549 | protected function getMissingEntities ( ) { $ modes = $ this -> getAllModes ( ) ; $ entrySubtypes = $ this -> getEntrySubtypes ( ) ; $ classes = array ( ) ; foreach ( $ entrySubtypes as $ service => $ subtypes ) { foreach ( $ modes as $ mode ) { foreach ( $ subtypes as $ subtype ) { $ classes [ ] = sprintf ( self :: MO... | Checks if each Entry has an Entity for all Modes . |
550 | public function setContentId ( $ id ) { $ this -> contentId = empty ( $ id ) ? null : ( int ) $ id ; $ this -> _uriCache = null ; $ this -> _visible = null ; return $ this ; } | Setter for content - id |
551 | public function setSubdomainId ( $ id ) { $ this -> subdomainId = empty ( $ id ) ? null : ( int ) $ id ; $ this -> _uriCache = null ; return $ this ; } | Setter for subdomain - id |
552 | public function getUriModel ( ) { if ( null === $ this -> _uriModel ) { $ this -> _uriModel = $ this -> getServiceLocator ( ) -> get ( 'Grid\Core\Model\Uri\Model' ) ; } return $ this -> _uriModel ; } | Get the stored uri - mapper |
553 | public function getSubDomainModel ( ) { if ( null === $ this -> _subDomainModel ) { $ this -> _subDomainModel = $ this -> getServiceLocator ( ) -> get ( 'Grid\Core\Model\SubDomain\Model' ) ; } return $ this -> _subDomainModel ; } | Get the stored subdomain - mapper |
554 | public function getParagraphModel ( ) { if ( null === $ this -> _paragraphModel ) { $ this -> _paragraphModel = $ this -> getServiceLocator ( ) -> get ( 'Grid\Paragraph\Model\Paragraph\Model' ) ; } return $ this -> _paragraphModel ; } | Get the stored paragraph - mapper |
555 | public function getUri ( ) { if ( empty ( $ this -> _uriCache ) ) { $ subdomainId = $ this -> getSubdomainId ( ) ; $ info = $ this -> getServiceLocator ( ) -> get ( 'Zork\Db\SiteInfo' ) ; if ( empty ( $ subdomainId ) ) { $ subdomainId = $ info -> getSubdomainId ( ) ; } else if ( $ subdomainId != $ info -> getSubdomainI... | Getter for uri |
556 | public static function listenToContextLoadFactoriesEvent ( sfEvent $ event ) { $ context = $ event -> getSubject ( ) ; if ( sfContext :: getInstance ( ) -> getConfiguration ( ) -> getEnvironment ( ) == 'dev' ) { $ context -> getResponse ( ) -> addStylesheet ( twAdmin :: getProperty ( 'web_dir' ) . '/css/bootstrap.css' ... | After the context has been initiated we can add the required assets |
557 | public function createSubModule ( $ className ) { if ( ! class_exists ( $ className ) || ! is_subclass_of ( $ className , '\LiftKit\Module\Module' ) ) { throw new NonexistentSubModuleException ( 'Class name is not module: ' . $ className ) ; } return new $ className ( $ this -> container ) ; } | This method accepts a fully - qualified class name and creates it . |
558 | public static function getInstance ( $ basepath = null , $ classprefix = 'JInstallerAdapter' , $ adapterfolder = 'adapter' ) { if ( $ basepath === null ) { $ basepath = JPATH_LIBRARIES . '/cms/installer' ; } return parent :: getInstance ( $ basepath , $ classprefix , $ adapterfolder ) ; } | Returns the global Installer object only creating it if it doesn t already exist . |
559 | public function getEdit ( $ id = null ) { $ group = Sentinel :: getRoleRepository ( ) -> find ( $ id ) ; if ( $ group == null ) { $ error = Lang :: get ( 'base.groups.not_found' ) ; return Redirect :: route ( 'groups' ) -> with ( 'error' , $ error ) ; } $ groups = null ; $ groups2 = Sentinel :: getRoleRepository ( ) ->... | Group update . |
560 | public function postEdit ( $ id = null ) { $ group = Sentinel :: getRoleRepository ( ) -> find ( $ id ) ; if ( $ group == null ) { $ error = Lang :: get ( 'base.groups.not_found' ) ; return Redirect :: route ( 'admin.blogs.show' ) -> with ( 'error' , $ error ) ; } unset ( $ this -> validationRules [ 'slug' ] ) ; $ this... | Group update form processing page . |
561 | public function getCreate ( ) { $ groups = null ; $ groups2 = Sentinel :: getRoleRepository ( ) -> all ( [ 'id' , 'name' ] ) ; foreach ( $ groups2 as $ g ) $ groups [ $ g -> id ] = $ g -> name ; return View ( 'admin.groups.create' , compact ( 'groups' ) ) ; } | Create new group |
562 | public function postCreate ( ) { $ slug = str_slug ( Input :: get ( 'name' ) , '_' ) ; $ input = Input :: all ( ) ; $ input [ 'slug' ] = $ slug ; $ validator = Validator :: make ( $ input , $ this -> validationRules ) ; if ( $ validator -> fails ( ) ) { return Redirect :: back ( ) -> withInput ( ) -> withErrors ( $ val... | Group create form processing . |
563 | public function getDelete ( $ id = null ) { $ group = Sentinel :: getRoleRepository ( ) -> find ( $ id ) ; if ( $ group == null ) { $ error = Lang :: get ( 'base.groups.not_found' ) ; return Redirect :: route ( 'groups' ) -> with ( 'error' , $ error ) ; } Base :: Log ( 'Group (' . $ group -> id . ' - ' . $ group -> nam... | Delete the given group . |
564 | public function getClient ( ) { if ( null === $ this -> client ) { $ this -> client = S3Client :: factory ( [ 'version' => 'latest' , 'region' => $ this -> getRegion ( ) ] ) ; } return $ this -> client ; } | Instantiates and returns an S3Client instance |
565 | public function setVisibility ( string $ visibility ) { if ( ! in_array ( $ visibility , VisibilityableInterface :: VISIBILITY_ALLOWED ) ) { throw new \ Exception ( sprintf ( VisibilityableInterface :: ERROR_FORMAT_INVALID_VISIBILITY , $ visibility ) ) ; } $ this -> visibility = $ visibility ; return $ this ; } | Sets the visibility |
566 | public function remove ( ... $ items ) { foreach ( $ items as $ item ) if ( ( $ index = $ this -> indexOf ( $ item ) ) !== null ) unset ( $ this -> items [ $ index ] ) ; return $ this ; } | Remove an item from list |
567 | public function add ( ... $ items ) { foreach ( $ items as & $ item ) $ item = ( array ) $ item ; $ this -> items = array_merge ( $ this -> items , ... $ items ) ; return $ this ; } | Add an item to list |
568 | public function getItems ( $ keys = null ) { if ( $ keys ) return array_intersect_key ( $ this -> items , array_flip ( $ keys ) ) ; return $ this -> items ; } | Retreive list as array |
569 | public function sendPasswordNotification ( $ token , $ request ) { $ this -> notify ( new SetPasswordNotification ( $ token , $ request -> tenant , $ request -> site ) ) ; } | Send the new account notification . |
570 | public function sendResetPasswordNotification ( $ token , $ request ) { $ this -> notify ( new ResetPasswordNotification ( $ token , $ request -> tenant , $ request -> site ) ) ; } | Send the password reset email . |
571 | public function forceLogin ( ) : bool { if ( $ this -> loggedIn ( ) ) { return true ; } $ router = $ this -> di -> get ( 'core.router' ) ; $ router -> setApp ( 'Core' ) ; $ router -> setController ( 'Login' ) ; $ router -> setAction ( 'Login' ) ; return false ; } | Checks login state and overrides the router current data to force display of loginform . |
572 | private function logLogin ( bool $ error_username = false , bool $ error_password = false , bool $ ban = true ) { $ text = sprintf ( 'Login for user "%s"' , $ this -> username ) ; $ state = 0 ; if ( $ error_username || $ error_password ) { $ text .= ' failed because of wrong ' ; if ( $ error_username ) { $ state += 1 ;... | Logs login process |
573 | public function toView ( $ prefix = null , array $ restricted = array ( ) ) { return array ( $ prefix . 'name' => $ this -> name , $ prefix . 'surname' => $ this -> surname , $ prefix . 'socialID' => $ this -> socialID , $ prefix . 'email' => $ this -> email , $ prefix . 'birthday' => $ this -> birthday , $ prefix . 'g... | Transform object for view rendering |
574 | public function initialize ( Application $ app , Renderer $ renderer ) { switch ( $ app -> config ( 'renderer.name' ) ) { case 'twig' : $ this -> initialize4Twig ( $ app , $ renderer ) ; break ; } } | callback on initialize . |
575 | protected function initialize4Twig ( Application $ app , Renderer $ renderer ) { \ Twig_Autoloader :: register ( ) ; $ twig_loader = null ; foreach ( $ app -> loader -> find ( $ app -> config ( 'directory.template' ) ) as $ dir ) { if ( ! $ twig_loader ) { $ twig_loader = new \ Twig_Loader_Filesystem ( $ dir -> getReal... | initialize for twig . |
576 | public function create ( Environment $ environment ) { $ files = $ environment -> getFiles ( ) ; $ parsed = $ this -> parseFiles ( $ files ) ; return $ parsed ; } | Create instances of UploadedFile object from instance of Environment object |
577 | private function parseFiles ( $ files ) { $ parsed = [ ] ; if ( ! empty ( $ files ) ) { foreach ( $ files as $ field => $ file ) { $ parsed [ $ field ] = $ this -> parseFile ( $ file ) ; } } return $ parsed ; } | Parse files data into instances of UploadedFile |
578 | private function parseFile ( $ uploadedFile ) { $ item = [ ] ; if ( is_array ( $ uploadedFile ) ) { if ( ! is_array ( $ uploadedFile [ 'error' ] ) ) { $ item [ ] = new UploadedFile ( $ uploadedFile [ 'tmp_name' ] , isset ( $ uploadedFile [ 'name' ] ) ? $ uploadedFile [ 'name' ] : null , isset ( $ uploadedFile [ 'type' ... | Parse particular fields in files data into instances of UploadedFile |
579 | public static function setUserTags ( ) { self :: fetchUserTags ( ) ; $ namespace = 'App\View\Atomium\UserTag\\' ; foreach ( get_declared_classes ( ) as $ value ) { if ( strpos ( $ value , $ namespace ) !== false ) { self :: $ userTags [ ] = $ value ; } } } | Set User Tags . |
580 | protected static function fetchUserTags ( ) { $ files = Bus :: fetch ( 'resources/tags' , false ) ; if ( ! is_null ( $ files ) ) { foreach ( Bus :: fetch ( 'resources/tags' , false ) as $ file ) { Bus :: need ( $ file ) ; } } } | Fetch User Tags . |
581 | protected static function compileUserTags ( ) { if ( ! is_null ( self :: $ userTags ) ) { foreach ( self :: $ userTags as $ compiler ) { self :: $ output = $ compiler :: run ( self :: $ output ) ; } } } | Compile User Tags . |
582 | protected function outputUri ( $ mtime ) { return Thumbnail :: THUMBNAIL_BASEURI . '/' . $ this -> path . '/' . $ this -> method . '/' . ( empty ( $ this -> crop ) ? '' : $ this -> cropLeft . 'x' . $ this -> cropTop . '-' . $ this -> cropWidth . 'x' . $ this -> cropHeight . '-' ) . $ this -> width . 'x' . $ this -> hei... | Get output uri for settings |
583 | public function execute ( ) { $ action = $ this -> action ( ) ; if ( ! is_callable ( array ( $ this , $ action ) ) ) { $ errorMessage = 'The action <b>' . $ this -> action . '</b> is not defined for the module <b>' . ucfirst ( $ this -> module ) . '</b>' ; throw new \ RuntimeException ( $ errorMessage , MvcErrors :: AC... | Execute the Controller action . |
584 | public function setModule ( $ module ) { if ( ! is_string ( $ module ) || empty ( $ module ) ) { $ errMessage = "The module value must be a string and not be empty" ; throw new \ InvalidArgumentException ( $ errMessage , GeneralErrors :: VALUE_IS_NOT_OF_EXPECTED_TYPE ) ; } $ this -> module = $ module ; } | Save the module in the instance . |
585 | public function setAction ( $ action ) { if ( ! is_string ( $ action ) || empty ( $ action ) ) { $ errMessage = "The action value must be a string and not be empty" ; throw new \ InvalidArgumentException ( $ errMessage , GeneralErrors :: VALUE_IS_NOT_OF_EXPECTED_TYPE ) ; } $ this -> action = $ action ; } | Save the action value in the instance . |
586 | public function setView ( ) { if ( ! is_string ( $ this -> action ) || empty ( $ this -> action ) ) { $ errMessage = 'The action value must be a string and not be empty' ; throw new \ InvalidArgumentException ( $ errMessage , GeneralErrors :: VALUE_IS_NOT_OF_EXPECTED_TYPE ) ; } if ( \ Puzzlout \ Framework \ Core \ Requ... | Set the view filename for the current request . |
587 | public function AddGlobalAppVariables ( ) { $ context = new Context ( $ this -> app ) ; $ culture = $ context -> GetCultureLang ( ) . "_" . $ context -> GetCultureRegion ( ) ; $ this -> page ( ) -> addVar ( 'culture' , $ culture ) ; $ user = $ this -> app ( ) -> user -> getAttribute ( \ Puzzlout \ Framework \ Enums \ S... | Add the context the variables that are used to generated the output from the Views . |
588 | protected function resolveCallableArguments ( \ ReflectionFunctionAbstract $ reflector , $ args = [ ] ) { return array_map ( function ( \ ReflectionParameter $ parameter ) use ( $ args ) { $ name = $ parameter -> name ; $ class = $ parameter -> getClass ( ) ; if ( array_key_exists ( $ name , $ args ) ) { return $ args ... | Resolves arguments for a callable |
589 | public static function options ( $ key = null , $ value = null ) { $ options = static :: setup ( ) ; if ( ! $ key ) { return $ options ; } if ( ! $ value ) { return $ options [ $ key ] ?? null ; } static :: $ options [ $ key ] = $ value ; return static :: $ options ; } | Management to options of app |
590 | public function chunk ( $ size ) { $ chunks = array_chunk ( $ this -> all ( ) , $ size ) ; $ chunks = array_map ( function ( $ chunk ) { return new static ( $ chunk ) ; } , $ chunks ) ; return $ chunks ; } | Split collection into chunks |
591 | public function column ( $ key ) { $ result = array_column ( $ this -> all ( ) , $ key ) ; if ( empty ( $ result ) ) { $ this -> each ( function ( $ item ) use ( & $ result , $ key ) { array_push ( $ result , $ item -> { $ key } ) ; } ) ; } return new static ( $ result ) ; } | Retrieves the values from a single column in collection |
592 | public function filter ( \ Closure $ callback ) { $ results = array_filter ( $ this -> all ( ) , $ callback , ARRAY_FILTER_USE_BOTH ) ; return new static ( $ results ) ; } | Filters items of collection using a callback function |
593 | public function intersect ( ) { $ arrays = func_get_args ( ) ; $ arrays = array_map ( function ( $ array ) { return $ this -> getAvailableArray ( $ array ) ; } , $ arrays ) ; array_unshift ( $ arrays , $ this -> all ( ) ) ; $ arrays = call_user_func_array ( 'array_intersect' , $ arrays ) ; return new static ( $ arrays ... | Computes the intersection of collection |
594 | public function join ( $ key , $ glue = null ) { if ( $ glue !== null ) { return $ this -> column ( $ key ) -> join ( $ glue ) ; } return implode ( $ key , $ this -> all ( ) ) ; } | Join collection items with a string you should pass the key of the attributes you wish to join |
595 | public function sum ( $ column ) { return $ this -> column ( $ column ) -> reduce ( function ( $ carry , $ item ) { $ carry += $ item ; return $ carry ; } ) ; } | Sum of all items in the collection by column |
596 | public static function all ( ) { $ paths = \ Config :: get ( 'module_paths' , array ( ) ) ; $ modules = array ( ) ; foreach ( $ paths as $ path ) { $ modules += array_map ( 'basename' , glob ( $ path . '*' , GLOB_ONLYDIR ) ) ; } sort ( $ modules ) ; return $ modules ; } | Lists all possible modules in all module paths |
597 | protected static function load_routes ( $ module , $ path ) { if ( is_file ( $ path .= 'config/routes.php' ) ) { $ module_routes = \ Fuel :: load ( $ path ) ; $ prefix = static :: get_prefix ( $ module ) ; $ prepped_routes = array ( ) ; foreach ( $ module_routes as $ name => $ _route ) { if ( $ name === '_root_' ) { $ ... | Loads the routes for the module |
598 | public static function addViewPath ( $ path ) { self :: $ _viewPaths = array_merge ( Option :: clean ( self :: $ _viewPaths ) , array ( $ path ) ) ; self :: $ _twigLoader = new \ Twig_Loader_Filesystem ( self :: $ _viewPaths ) ; self :: $ _twigEnvironment = new \ Twig_Environment ( self :: $ _twigLoader ) ; } | Adds a path to the view path |
599 | public static function twigView ( $ viewFile , $ payload = array ( ) , $ returnString = false ) { if ( null !== self :: $ _twigEnvironment ) { $ _output = self :: $ _twigEnvironment -> render ( $ viewFile , self :: _getBaseRenderPayload ( $ viewFile , $ payload ) ) ; if ( false !== $ returnString ) { return $ _output ;... | Renders a Twig template view |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.