idx int64 0 241k | question stringlengths 64 6.21k | target stringlengths 5 803 |
|---|---|---|
234,800 | public function retrieveCalendarEventsAction ( ) { $ calendarTable = $ this -> getServiceLocator ( ) -> get ( 'MelisCalendarTable' ) ; $ result = $ calendarTable -> retrieveCalendarEvents ( ) ; return new JsonModel ( $ result -> toArray ( ) ) ; } | Retrieve Calendar Event to initialize calender ui |
234,801 | public function saveEventAction ( ) { $ translator = $ this -> getServiceLocator ( ) -> get ( 'translator' ) ; $ request = $ this -> getRequest ( ) ; $ status = 0 ; $ textMessage = '' ; $ errors = array ( ) ; $ textTitle = '' ; $ responseData = array ( ) ; $ melisMelisCoreConfig = $ this -> serviceLocator -> get ( 'Mel... | This action will save an event to the calendar |
234,802 | public function searchCalendarEventAction ( ) { $ translator = $ this -> getServiceLocator ( ) -> get ( 'translator' ) ; $ textMessage = '' ; $ request = $ this -> getRequest ( ) ; $ id = null ; if ( $ request -> isPost ( ) ) { $ postValues = get_object_vars ( $ request -> getPost ( ) ) ; if ( ! empty ( $ postValues ) ... | Retrieving Calendar searched item event data for updating |
234,803 | public function reschedEventAction ( ) { $ translator = $ this -> getServiceLocator ( ) -> get ( 'translator' ) ; $ request = $ this -> getRequest ( ) ; $ id = null ; $ status = 0 ; $ textMessage = '' ; $ errors = array ( ) ; $ textMessage = '' ; $ textTitle = '' ; if ( $ request -> isPost ( ) ) { $ postValues = get_ob... | Updating Calendar Event by resizing Calendar item event |
234,804 | public function deleteEventAction ( ) { $ translator = $ this -> getServiceLocator ( ) -> get ( 'translator' ) ; $ request = $ this -> getRequest ( ) ; $ id = null ; $ status = 0 ; $ textMessage = '' ; $ errors = array ( ) ; $ textMessage = '' ; $ textTitle = '' ; if ( $ request -> isPost ( ) ) { $ postValues = get_obj... | Deleting Calendar item event |
234,805 | public function getEventTitleAction ( ) { $ translator = $ this -> getServiceLocator ( ) -> get ( 'translator' ) ; $ request = $ this -> getRequest ( ) ; $ status = 0 ; $ textMessage = $ translator -> translate ( 'tr_melistoolcalendar_unable_get_event' ) ; $ errors = array ( ) ; $ textTitle = '' ; $ eventData = array (... | Retrieving Calendar item event data for updating |
234,806 | protected function getRefreshToken ( ) { $ refreshToken = $ this -> getConfig ( ) -> getStorage ( ) -> getRefreshToken ( ) ; if ( null !== $ refreshToken ) { return $ refreshToken ; } $ deviceToken = $ this -> getDeviceToken ( ) ; if ( $ deviceToken !== null && $ deviceToken -> canPoll ( ) ) { $ params = array ( 'clien... | Tries to retrieve RefreshToken . |
234,807 | protected function getAccessTokenWithRefreshToken ( RefreshToken $ refreshToken ) { $ params = array ( 'client_id' => $ this -> getConfig ( ) -> getClientId ( ) , 'refresh_token' => $ refreshToken -> getRefreshToken ( ) , 'grant_type' => 'refresh_token' , ) ; $ response = $ this -> sendPostRequest ( "oauth2waitress/oau... | Get new AccessToken using provided RefreshToken |
234,808 | protected function getDeviceToken ( ) { $ deviceToken = $ this -> getConfig ( ) -> getStorage ( ) -> getDeviceToken ( ) ; if ( null !== $ deviceToken && $ deviceToken -> isExpired ( ) ) { $ this -> getConfig ( ) -> getStorage ( ) -> deleteDeviceToken ( ) ; $ deviceToken = null ; } if ( null === $ deviceToken ) { $ para... | Retrieves DeviceToken contianing the UserCode and DeviceCode |
234,809 | protected function sendPostRequest ( $ path , $ params ) { $ url = $ this -> getConfig ( ) -> getAuthUrl ( ) . $ path ; $ ch = curl_init ( $ url ) ; curl_setopt ( $ ch , CURLOPT_POST , true ) ; curl_setopt ( $ ch , CURLOPT_POSTFIELDS , http_build_query ( $ params ) ) ; curl_setopt ( $ ch , CURLOPT_RETURNTRANSFER , 1 ) ... | Sends a POST request to the auth server . Returns array with keys output and code . Output contains the response body code contains the response code . |
234,810 | public function add ( $ element ) : BagInterface { array_unshift ( $ this -> elements , $ element ) ; shuffle ( $ this -> elements ) ; return $ this ; } | Adds a new element to the bag . |
234,811 | public function validate ( $ value ) { if ( ! is_array ( $ value ) ) { return Error :: unit ( [ Error :: NON_ARRAY ] ) ; } $ errors = [ ] ; foreach ( $ value as $ pos => $ item ) { $ result = parent :: validate ( $ item ) ; if ( $ result instanceof Error ) { $ errors [ $ pos ] = $ result -> unwrap ( ) ; } } return empt... | Tells if a given array s items adhere to any of the property s allowed types . |
234,812 | protected static function fmtRep ( $ char , & $ string , $ value ) { if ( preg_match_all ( '/([0-9]{0,1})' . $ char . '/' , $ string , $ m ) ) { for ( $ i = 0 ; $ i < count ( $ m [ 0 ] ) ; $ i ++ ) { $ val = round ( $ value , ( int ) $ m [ 1 ] [ $ i ] ) ; $ string = str_replace ( $ m [ 0 ] [ $ i ] , $ val , $ string ) ... | Performs a decimal regular expression string formatter replace that provides value at a specified decimal precision . |
234,813 | protected static function encode ( $ string , $ key ) { for ( $ i = 0 ; $ i < strlen ( $ key ) ; $ i ++ ) { $ char = $ key [ $ i ] ; $ string = str_replace ( "\\{$char}" , "%{$i}" , $ string ) ; } return $ string ; } | Encodes reserved characters for formatter strings . |
234,814 | protected static function decode ( $ string , $ key ) { for ( $ i = 0 ; $ i < strlen ( $ key ) ; $ i ++ ) { $ char = $ key [ $ i ] ; $ string = str_replace ( "%{$i}" , "{$char}" , $ string ) ; } return $ string ; } | Decodes reserved characters for formatter strings . |
234,815 | protected static function hmsf2sec ( $ h , $ m , $ s , $ f ) { return static :: dmsf2asec ( $ h , $ m , $ s , $ f ) ; } | Composes h m s into seconds . |
234,816 | protected function merge ( array & $ base , array $ overwrite ) { foreach ( $ overwrite as $ key => $ value ) { if ( is_int ( $ key ) ) { if ( ! in_array ( $ overwrite [ $ key ] , $ base ) ) { $ base [ ] = $ overwrite [ $ key ] ; } } else if ( is_array ( $ value ) ) { if ( isset ( $ base [ $ key ] ) && is_array ( $ bas... | Merge configuration arrays . |
234,817 | public function getType ( $ key , $ type ) { if ( is_array ( $ key ) ) { $ args = $ key ; } else { $ args = func_get_args ( ) ; $ type = array_pop ( $ args ) ; } $ val = $ this -> dget ( $ args ) ; if ( $ val === null ) throw new \ OutOfRangeException ( "Key " . implode ( '.' , $ args ) . " does not exist" ) ; $ checke... | Get a value cast to a specific type . |
234,818 | public function getSection ( $ key ) { $ val = $ this -> dget ( func_get_args ( ) ) ; if ( $ val instanceof Dictionary ) return $ val ; $ val = WF :: cast_array ( $ val ) ; return Dictionary :: wrap ( $ val ) ; } | Get the parameter as a Dictionary . |
234,819 | public function set ( $ key , $ value ) { if ( is_array ( $ key ) && $ value === null ) $ args = $ key ; else $ args = func_get_args ( ) ; $ value = array_pop ( $ args ) ; $ parent = null ; $ key = null ; $ ref = & $ this -> values ; foreach ( $ args as $ arg ) { if ( ! is_scalar ( $ arg ) ) throw new \ InvalidArgument... | Set a value in the dictionary |
234,820 | public function addAll ( $ values ) { if ( ! WF :: is_array_like ( $ values ) ) throw new \ DomainException ( "Invalid value to merge: " . WF :: str ( $ values ) ) ; $ this -> addAllRecursive ( $ values , $ this ) ; return $ this ; } | Add all elements in the provided array - like object to the dictionary . |
234,821 | private function addAllRecursive ( $ source , $ target , array $ path = [ ] ) { foreach ( $ source as $ key => $ value ) { if ( ! isset ( $ target [ $ key ] ) ) { $ target [ $ key ] = $ value ; } else { $ tgt = $ target [ $ key ] ; if ( is_array ( $ source ) || $ source instanceof Dictionary ) { if ( $ tgt instanceof D... | Recursive function to merge all values from a source dictionary or array into a target dictionary . |
234,822 | public function clear ( ) { $ keys = array_keys ( $ this -> values ) ; foreach ( $ keys as $ key ) unset ( $ this -> values [ $ key ] ) ; return $ this ; } | Remove all elements from the dictionary |
234,823 | protected function registerServiceProviders ( ) { $ this -> app -> register ( 'Congraph\Core\Bus\BusServiceProvider' ) ; $ this -> app -> register ( 'Congraph\Core\Events\EventsServiceProvider' ) ; $ this -> app -> register ( 'Congraph\Core\Repositories\RepositoriesServiceProvider' ) ; } | Register Service Providers for this package |
234,824 | public function getRaw ( ) { $ url = $ this -> _gravatar -> generateUrl ( 'profile' , $ this -> _gravatar -> getEmail ( ) ) . '.php' ; if ( is_null ( $ this -> _data ) ) { $ h = get_headers ( $ url , 1 ) [ 0 ] ; $ code = substr ( $ h , strrpos ( $ h , '404' ) , strlen ( $ h ) ) ; if ( $ code == '404 Not Found' ) { thro... | Returns raw serialized profile data . |
234,825 | public function convert ( $ type , $ data ) { foreach ( $ data as $ k => $ v ) { if ( is_array ( $ v ) ) { $ data [ $ k ] = $ this -> convert ( $ type , $ v ) ; } } switch ( strtolower ( $ type ) ) { case 'array' : return ( array ) $ data ; break ; case 'object' : return ( object ) $ data ; break ; default : throw new ... | Converts the data into whichever type specified . |
234,826 | public function addSubscriber ( SubscriberInterface $ subscriber ) { foreach ( $ subscriber -> getSubscriberEvents ( ) as $ subscriberEvent => $ params ) { if ( is_string ( $ params ) ) { $ this -> addListener ( $ subscriberEvent , array ( $ subscriber , $ params ) ) ; } if ( is_array ( $ params ) ) { foreach ( $ param... | Added subscriber from event configuration This subscriber allow notified for event |
234,827 | public function removeSubscriber ( SubscriberInterface $ subscriber ) { if ( is_array ( $ subscriber -> getSubscriberEvents ( ) ) ) { foreach ( $ subscriber -> getSubscriberEvents ( ) as $ subscriberEvent => $ params ) { $ this -> removeListener ( $ subscriberEvent , array ( $ subscriber , $ params ) ) ; } } } | Remove all subscriber from event configuration |
234,828 | public static function v3 ( $ namespace , $ name ) { if ( ! self :: is_valid ( $ namespace ) ) return false ; $ nhex = str_replace ( array ( '-' , '{' , '}' ) , '' , $ namespace ) ; $ nstr = '' ; for ( $ i = 0 ; $ i < strlen ( $ nhex ) ; $ i += 2 ) { $ nstr .= chr ( hexdec ( $ nhex [ $ i ] . $ nhex [ $ i + 1 ] ) ) ; } ... | Generate v3 UUID |
234,829 | public static function create ( $ length = 6 , $ numbers = true , $ letters = false , $ capitals = false , $ symbols = false ) { if ( false === ( '-' . intval ( $ length ) == '-' . $ length ) ) { return trigger_error ( sprintf ( 'Argument 1 passed to %s() must be of the type integer, "%s" given' , __METHOD__ , gettype ... | Create random token |
234,830 | public static function Read ( string $ package , string $ file , string $ message = null , int $ code = \ E_USER_ERROR , \ Throwable $ previous = null ) : FileAccessError { return new FileAccessError ( $ package , $ file , static :: ACCESS_READ , $ message , $ code , $ previous ) ; } | Init s a new \ Beluga \ IO \ FileAccessError for file read mode . |
234,831 | public static function Write ( string $ package , string $ file , string $ message = null , int $ code = \ E_USER_ERROR , \ Throwable $ previous = null ) : FileAccessError { return new FileAccessError ( $ package , $ file , static :: ACCESS_WRITE , $ message , $ code , $ previous ) ; } | Init s a new \ Beluga \ IO \ FileAccessError for file write mode . |
234,832 | public function getDiscriminatedClass ( PropertyMetadata $ mapping , $ discriminator = null ) { if ( $ discriminator === null ) { $ discriminator = $ mapping -> discriminatorDefaultValue ; } if ( $ discriminator !== null ) { if ( isset ( $ mapping -> discriminatorMap [ $ discriminator ] ) ) { $ discriminator = $ mappin... | Get the class metadata for an association s target with respect to any discriminator value . |
234,833 | public function setPolicy ( string $ policy ) { if ( ! in_array ( $ policy , [ self :: POLICY_NONE , self :: POLICY_ALLOW , self :: POLICY_DENY ] ) ) { throw new Exception ( 'Unsupported policy type: ' . $ policy ) ; } $ this -> policy = $ policy ; $ this -> init ( ) ; } | Set policy . |
234,834 | public function getIdRoleByName ( string $ name ) : string { if ( isset ( $ this -> role [ $ name ] ) ) { return ( string ) $ this -> role [ $ name ] [ 'id' ] ; } return '' ; } | Get id role by name . |
234,835 | public function getResource ( string $ id = null ) : array { if ( $ id ) { if ( is_numeric ( $ id ) ) { $ filter = array_filter ( $ this -> resource , function ( $ row ) use ( $ id ) { return $ row [ 'id' ] == $ id ; } ) ; return ( array ) array_pop ( $ filter ) ; } return ( array ) ( $ this -> resource [ $ id ] ?? [ ]... | Get resource . |
234,836 | public function getIdResourceByName ( string $ name ) : string { if ( isset ( $ this -> resource [ $ name ] ) ) { return ( string ) $ this -> resource [ $ name ] [ 'id' ] ; } return '' ; } | Get id resource by name . |
234,837 | public function getPrivilege ( string $ id = null ) : array { if ( $ id ) { if ( is_numeric ( $ id ) ) { $ filter = array_filter ( $ this -> privilege , function ( $ row ) use ( $ id ) { return $ row [ 'id' ] == $ id ; } ) ; return ( array ) array_pop ( $ filter ) ; } return ( array ) ( $ this -> privilege [ $ id ] ?? ... | Get privilege . |
234,838 | public function getIdPrivilegeByName ( string $ name ) : string { if ( isset ( $ this -> privilege [ $ name ] ) ) { return ( string ) $ this -> privilege [ $ name ] [ 'id' ] ; } return '' ; } | Get id privilege by name . |
234,839 | public function getAcl ( string $ idRole = null , string $ idResource = null ) : array { if ( $ idRole ) { $ callback = function ( $ row ) use ( $ idRole , $ idResource ) { if ( $ idRole && $ idResource ) { return $ row [ 'id_role' ] == $ idRole && $ row [ 'id_resource' ] == $ idResource ; } if ( $ idRole ) { return $ ... | Get acl . |
234,840 | public function getAclForm ( string $ idRole ) : array { $ result = [ ] ; foreach ( $ this -> resource as $ item ) { $ acl = $ this -> getAcl ( $ idRole , ( string ) $ item [ 'id' ] ) ; if ( $ this -> isAll ( $ idRole , ( string ) $ item [ 'id' ] ) ) { $ result [ $ item [ 'id' ] ] = 'all' ; } else { $ result [ $ item [... | Get acl form . |
234,841 | public function isAll ( string $ idRole , string $ idResource = null ) : bool { $ acl = $ this -> getAcl ( $ idRole ) ; if ( $ idResource ) { $ callback = function ( $ row ) use ( $ idResource ) { if ( $ idResource ) { return $ row [ 'id_resource' ] == $ idResource ; } return true ; } ; $ res = array_values ( array_fil... | Is all . |
234,842 | public function setAllowed ( $ role = self :: ALL , $ resource = self :: ALL , $ privilege = self :: ALL ) { if ( $ this -> policy == self :: POLICY_ALLOW ) { $ this -> permission -> allow ( $ role , $ resource , $ privilege ) ; } else { $ this -> permission -> deny ( $ role , $ resource , $ privilege ) ; } } | Set allowed . |
234,843 | private function getPathListCurrentAcl ( ) : string { return sprintf ( self :: PATH_LIST_CURRENT_ACL , $ this -> appDir , explode ( '\\' , get_class ( $ this ) ) [ 3 ] ) ; } | Get path list current acl . |
234,844 | public function saveListCurrentAcl ( ) : int { $ separate = $ last = $ this -> loadListCurrentAcl ( ) ; foreach ( $ this -> listCurrentAcl as $ item ) { if ( ! isset ( $ separate [ $ item [ 'resource' ] ] ) ) { $ separate [ $ item [ 'resource' ] ] = [ ] ; } if ( ! in_array ( $ item [ 'privilege' ] , $ separate [ $ item... | Save list current acl . |
234,845 | public function loadListCurrentAcl ( ) : array { $ path = $ this -> getPathListCurrentAcl ( ) ; if ( file_exists ( $ path ) ) { return Neon :: decode ( file_get_contents ( $ path ) ) ; } return [ ] ; } | Load list current acl . |
234,846 | public static function merge ( $ array1 , $ array2 , $ recursive = false ) { if ( ! self :: isValid ( $ array1 ) || ! self :: isValid ( $ array2 ) ) { return false ; } if ( $ recursive ) { return array_merge_recursive ( $ array1 , $ array2 ) ; } else { return array_merge ( $ array1 , $ array2 ) ; } } | Merge 2 arrays |
234,847 | public static function existsValue ( $ array , $ value ) { if ( ! self :: isValid ( $ array ) ) { return false ; } $ returnValue = false ; $ length = self :: length ( $ array ) ; for ( $ i = 0 ; $ i < $ length ; $ i ++ ) { if ( $ value === $ array [ $ i ] ) { $ returnValue = true ; break ; } } return $ returnValue ; } | Check if a value exists in an array |
234,848 | public static function explode ( $ string , $ delimiter ) { if ( ! String :: isValid ( $ string ) || String :: isEmpty ( $ string ) ) { return false ; } return explode ( $ delimiter , $ string ) ; } | Convert a string to an array |
234,849 | public static function getLogger ( ) { if ( self :: $ logger === null ) { try { $ result = Hook :: execute ( "Wedeto.Util.GetLogger" , [ "logger" => null , "class" => static :: class ] ) ; } catch ( RecursionException $ e ) { $ result = [ 'logger' => new EmergencyLogger ] ; } self :: $ logger = $ result [ 'logger' ] ??... | Get a logger . If not available yet it will be created using a Hook or a NullLogger is instantiated . |
234,850 | public function addValue ( $ value , $ q = 1.0 ) { $ val = $ this -> parseValue ( $ value ) ; $ q = floatval ( $ q ) ; if ( $ q > 1 ) { $ q = 1.0 ; } if ( $ q < 0 ) { $ q = 0.0 ; } foreach ( $ this -> values as $ index => $ tmp ) { if ( $ tmp [ self :: KEY_VAL ] == $ val ) { array_splice ( $ this -> values , $ index , ... | Add a value to the header uses a modified version of insertion sort . |
234,851 | protected function getConfig ( ServiceLocatorInterface $ serviceLocator ) { if ( $ this -> config !== null ) { return $ this -> config ; } $ services = $ serviceLocator -> getServiceLocator ( ) ; if ( ! $ services -> has ( 'Config' ) ) { $ this -> config = array ( ) ; return $ this -> config ; } $ config = $ services -... | Get amqp configuration if any |
234,852 | public function setAI ( $ arg ) { $ this -> aiBegin = max ( $ this -> aiBegin , intval ( $ arg ) ) ; return $ this ; } | SET AUTO_INCREMENT BEGIN |
234,853 | public function fk ( $ name , $ field , $ table , $ fkField , $ delete = 'NO ACTION' , $ update = 'NO ACTION' ) { $ this -> foreignKey [ $ name ] = [ $ field , $ table , $ fkField , $ delete , $ update ] ; return $ this ; } | SET FOREIGN KEY |
234,854 | public function getAlertSql ( ) { $ sql = [ ] ; foreach ( $ this -> _data as $ item ) { $ sql [ ] = $ item -> getAlterSql ( ) ; } return sprintf ( 'ALTER TABLE %s %s;' , $ this -> getTable ( ) , implode ( ',' , $ sql ) ) ; } | GET ALERT TABLE SQL |
234,855 | public function getSql ( ) { $ sql = "CREATE TABLE IF NOT EXISTS {$this->getTable()} (" ; $ column = $ this -> _data ; if ( ! empty ( $ this -> primaryKey ) ) { $ column [ ] = "PRIMARY KEY (`{$this->primaryKey}`)" ; } foreach ( $ this -> checks as $ key => $ item ) { $ column [ ] = ( ! is_integer ( $ key ) ? "CONSTRAIN... | GET CREATE TABLE SQL |
234,856 | public function getForeignKey ( ) { if ( $ this -> foreignKey !== null ) { return $ this -> foreignKey ; } $ this -> init ( ) ; switch ( $ this -> type ) { case self :: HAS_MANY : case self :: HAS_ONE : return $ this -> owner -> getTableName ( ) . '_' . $ this -> owner -> getPrimaryKey ( ) ; case self :: BELONGS_TO : r... | Returns the name of the column that will be filtered on |
234,857 | public static function create ( $ format = self :: FORMAT_JSON , $ engine = self :: ENGINE_API ) { $ response = '\Eureka\Component\Response' ; switch ( $ format ) { case self :: FORMAT_JSON : $ responseFormat = '\Json' ; break ; case self :: FORMAT_HTML : $ responseFormat = '\Html' ; break ; case self :: FORMAT_XML : c... | Create response object . |
234,858 | private function filterPath ( $ path ) { if ( $ path != null && substr ( $ path , 0 , 1 ) !== '/' ) { $ path = '/' . $ path ; } return preg_replace_callback ( '/(?:[^' . self :: $ charUnreserved . ':@&=\+\$,\/;%]+|%(?![A-Fa-f0-9]{2}))/' , function ( $ match ) { return rawurlencode ( $ match [ 0 ] ) ; } , $ path ) ; } | Filters the path of a URI |
234,859 | function reset ( ) { foreach ( $ this -> vars as $ key => $ val ) { unset ( $ this -> env [ $ key ] ) ; } $ this -> vars = array ( ) ; } | Resets evaluator s variables |
234,860 | public function map ( $ prefix , $ paths ) { $ prefix = ltrim ( $ prefix , '\\' ) ; $ paths = ( array ) $ paths ; if ( ! isset ( $ this -> map [ $ prefix ] ) ) { $ this -> map [ $ prefix ] = array ( ) ; } foreach ( $ paths as $ path ) { $ this -> map [ $ prefix ] [ ] = rtrim ( $ path , '\\/' ) . DIRECTORY_SEPARATOR ; }... | Maps a namespace prefix to one or more base directory paths . |
234,861 | protected function getPath ( $ class ) { foreach ( $ this -> map as $ prefix => $ paths ) { if ( 0 !== strpos ( $ class , $ prefix ) ) { continue ; } foreach ( $ paths as $ path ) { $ relative = ltrim ( substr ( $ class , strlen ( $ prefix ) ) , '\\' ) ; $ relative = preg_replace ( '/\\\\+/' , DIRECTORY_SEPARATOR , $ r... | Returns the file path for the class name . |
234,862 | public function passes ( $ input , $ rules ) { foreach ( $ rules as $ field => $ rule ) { $ this -> callValidator ( $ input [ $ field ] , $ field , $ rule ) ; } return ! $ this -> failed ; } | Loops through the rules and checks the current input . |
234,863 | protected function unique ( $ input , $ table , $ column ) { $ email = $ this -> db -> get ( $ table , $ column , [ $ column => $ input ] ) ; if ( $ email ) { var_dump ( "error: {$column} not unique" ) ; $ this -> failed = true ; } } | Check if the given input is unique in the given database table and column . |
234,864 | protected function multiple ( $ value ) { $ arguments = explode ( ':' , $ value ) ; if ( count ( $ arguments ) > 1 ) { $ rule = $ arguments [ 0 ] ; unset ( $ arguments [ 0 ] ) ; return [ 'multiple' => true , 'rule' => $ rule , 'arguments' => array_values ( $ arguments ) ] ; } return [ 'multiple' => false ] ; } | Retrieves multiple arguments from argument string . |
234,865 | protected function callValidator ( $ input , $ field , $ arguments ) { $ arguments = explode ( '|' , $ arguments ) ; foreach ( $ arguments as $ arg ) { if ( $ this -> multiple ( $ arg ) [ 'multiple' ] ) { switch ( $ this -> multiple ( $ arg ) [ 'rule' ] ) { case 'unique' : $ table = $ this -> multiple ( $ arg ) [ 'argu... | Loops through all arguments and checks what methods need to be called . |
234,866 | protected function table ( $ table ) { return $ this -> db -> connection ( $ this -> connection ) -> table ( $ table ) -> useWritePdo ( ) ; } | Get a query builder for the given table . |
234,867 | protected function normalizeTranslations ( Model \ TranslatableInterface $ translatable , $ format , array $ context = [ ] ) { $ data = [ ] ; $ groups = isset ( $ context [ 'groups' ] ) ? ( array ) $ context [ 'groups' ] : [ ] ; if ( in_array ( 'Search' , $ groups ) ) { if ( $ translatable instanceof Model \ Translatab... | Normalizes the translatable s translations . |
234,868 | private function Groups ( ) { if ( $ this -> groups === null ) { $ this -> groups = array ( ) ; if ( $ this -> GetMember ( ) ) { $ this -> groups = MembergroupUtil :: MemberMembergroups ( $ this -> GetMember ( ) ) ; } } return $ this -> groups ; } | The groups of the current member |
234,869 | public function Grant ( Action $ action , $ onObject ) { if ( $ onObject instanceof Page ) { return $ this -> GrantOnPage ( $ onObject ) ; } if ( $ onObject instanceof Content ) { return $ this -> GrantOnContent ( $ onObject , $ action ) ; } else { throw new \ LogicException ( 'Frontend access check not implemented for... | Check access to an object in the frontend |
234,870 | private function GrantByProperties ( $ guestsOnly , $ publish , Date $ from = null , Date $ to = null , array $ groups = array ( ) ) { if ( ! PublishDateUtil :: IsPublishedNow ( $ publish , $ from , $ to ) ) { return GrantResult :: NoAccess ( ) ; } if ( $ this -> GetMember ( ) && $ guestsOnly ) { return GrantResult :: ... | Checks access to an item by its properties and assigned groups |
234,871 | private function GrantOnPage ( Page $ page ) { $ groups = MembergroupUtil :: PageMembergroups ( $ page ) ; return $ this -> GrantByProperties ( $ page -> GetGuestsOnly ( ) , $ page -> GetPublish ( ) , $ page -> GetPublishFrom ( ) , $ page -> GetPublishTo ( ) , $ groups ) ; } | Checks a page for access rights |
234,872 | private function GrantOnContent ( Content $ content ) { $ groups = MembergroupUtil :: ContentMembergroups ( $ content ) ; return $ this -> GrantByProperties ( $ content -> GetGuestsOnly ( ) , $ content -> GetPublish ( ) , $ content -> GetPublishFrom ( ) , $ content -> GetPublishTo ( ) , $ groups ) ; } | Checks access to a content |
234,873 | public function run ( ) { $ url = parse_url ( $ _SERVER [ 'REQUEST_URI' ] ) ; $ controller = $ this -> router -> find ( $ url [ 'path' ] ) ; if ( ! $ controller instanceof ControllerInterface ) { throw new \ RuntimeException ( 'No valid controller found.' ) ; } $ controller -> setServer ( $ this ) ; $ result = $ contro... | Runs the listener . |
234,874 | public function channelGroupList ( array $ filter = array ( ) ) { if ( $ this -> cgroupList === null ) { $ this -> cgroupList = $ this -> request ( "channelgrouplist" ) -> toAssocArray ( "cgid" ) ; foreach ( $ this -> cgroupList as $ cgid => $ group ) { $ this -> cgroupList [ $ cgid ] = new Channelgroug ( $ this , $ gr... | Returns a list of channel groups available . |
234,875 | public static function delete ( ) { foreach ( func_get_args ( ) as $ argument ) { if ( is_array ( $ argument ) ) { foreach ( $ argument as $ key ) { unset ( $ _SESSION [ ( string ) $ key ] ) ; } } else { unset ( $ _SESSION [ ( string ) $ argument ] ) ; } } } | Deletes one or more session variables . |
234,876 | public static function exists ( ) : bool { if ( ! session_id ( ) ) { Session :: start ( ) ; } foreach ( func_get_args ( ) as $ argument ) { if ( is_array ( $ argument ) ) { foreach ( $ argument as $ key ) { if ( ! isset ( $ _SESSION [ ( string ) $ key ] ) ) { return false ; } } } else { if ( ! isset ( $ _SESSION [ ( st... | Checks if a session variable exists . |
234,877 | public static function get ( string $ key ) { if ( ! session_id ( ) ) { self :: start ( ) ; } if ( Session :: exists ( ( string ) $ key ) ) { return $ _SESSION [ ( string ) $ key ] ; } return null ; } | Gets a variable that was stored in the session . |
234,878 | public static function set ( string $ key , $ value ) { if ( ! session_id ( ) ) { self :: start ( ) ; } $ _SESSION [ ( string ) $ key ] = $ value ; } | Stores a variable in the session . |
234,879 | public static function getFormattedIdentifier ( ClassMetadata $ relatedClass , array $ criteria , $ fieldName , $ value ) { $ isObject = \ is_object ( $ criteria [ $ fieldName ] ) ; return $ isObject && null === $ value ? self :: formatEmptyIdentifier ( $ relatedClass ) : $ value ; } | Get the formatted identifier . |
234,880 | public static function formatEmptyIdentifier ( ClassMetadata $ meta ) { $ type = $ meta -> getTypeOfField ( current ( $ meta -> getIdentifier ( ) ) ) ; switch ( $ type ) { case 'bigint' : case 'decimal' : case 'integer' : case 'smallint' : case 'float' : return 0 ; case 'guid' : return '00000000-0000-0000-0000-00000000... | Format the empty identifier value for entity with relation . |
234,881 | public static function getObjectManager ( ManagerRegistry $ registry , $ entity , Constraint $ constraint ) { self :: validateConstraint ( $ constraint ) ; return self :: findObjectManager ( $ registry , $ entity , $ constraint ) ; } | Pre validate entity . |
234,882 | public static function updateCito ( Event $ event ) { $ options = static :: getOptions ( $ event ) ; $ configDir = $ options [ 'symfony-config-dir' ] ; $ templateDir = $ options [ 'symfony-template-dir' ] ; $ fs = new Filesystem ( ) ; $ yaml = Yaml :: parseFile ( $ configDir . '/packages/cito.yaml' ) ; if ( ! array_key... | Update the Cito files without delete user changes |
234,883 | public function sameValueAs ( ValueObjectInterface $ timezone ) { if ( false === Util :: classEquals ( $ this , $ timezone ) ) { return false ; } return $ this -> getName ( ) -> sameValueAs ( $ timezone -> getName ( ) ) ; } | Tells whether two DateTimeZone are equal by comparing their names |
234,884 | public function setQuery ( $ query ) { $ raw = SqlFormatter :: removeComments ( $ query ) ; if ( $ this -> noSplit ) { $ queries = array ( $ raw ) ; } else { $ queries = SqlFormatter :: splitQuery ( $ raw ) ; } foreach ( $ queries as $ index => $ q ) { $ this -> addOrReplace ( $ index , $ q ) ; } $ this -> removeFromIn... | Set SQL Query . |
234,885 | public function setResultDataType ( $ resultDataType ) { if ( is_string ( $ resultDataType ) && class_exists ( $ resultDataType ) ) { $ resultDataType = new $ resultDataType ( ) ; } if ( $ resultDataType instanceof DataInterface ) { $ this -> resultDataType = $ resultDataType ; } $ objectType = is_object ( $ resultData... | Set Result Data Type . |
234,886 | public function setInitializer ( QueryInitializer $ initial ) { $ this -> initial = $ initial ; for ( $ i = 0 ; $ i < $ this -> length ( ) ; ++ $ i ) { if ( $ this -> offsetExists ( $ i ) ) { $ this -> offsetGet ( $ i ) -> setInitializer ( $ this -> initial ) ; } } } | Set Initializer Class . |
234,887 | public function add ( SQLInterface $ sql ) { $ this -> raw [ ] = $ sql -> toString ( ) ; if ( ! $ sql -> getId ( ) ) { $ sql -> setId ( $ this -> count ( ) + 1 ) ; } $ sql -> setInitializer ( $ this -> initial ) ; $ this -> append ( $ sql ) ; } | Append SQL Object . |
234,888 | public function toArray ( ) { $ arrayResult = array ( ) ; for ( $ i = 0 ; $ i < $ this -> length ( ) ; ++ $ i ) { if ( $ this -> offsetExists ( $ i ) ) { $ arrayResult [ ] = $ this -> offsetGet ( $ i ) -> toArray ( ) ; } } return $ arrayResult ; } | Get All SQL Query as an array . |
234,889 | public function clear ( ) { for ( $ i = 0 ; $ i < $ this -> length ( ) ; ++ $ i ) { if ( $ this -> offsetExists ( $ i ) ) { $ this -> offsetUnset ( $ i ) ; } } } | Clear all sql queries . |
234,890 | public function last ( ) { $ lastIndex = $ this -> count ( ) - 1 ; if ( $ this -> offsetExists ( $ lastIndex ) ) { return $ this -> offsetGet ( $ lastIndex ) ; } } | Get last sql query if single query will return first query . |
234,891 | public function addOrReplace ( $ index , $ stringSql ) { if ( ! $ stringSql ) { return ; } $ sql = null ; if ( $ this -> offsetExists ( $ index ) ) { $ sql = $ this -> offsetGet ( $ index ) ; $ sql -> setSql ( $ stringSql ) ; } else { $ sql = new Sql ( $ stringSql ) ; $ this -> add ( $ sql ) ; } return $ sql ; } | Add Or Replace old query . |
234,892 | public function regenerate ( ) { $ pool = '0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ' ; $ sessionId = '' ; for ( $ i = 0 ; $ i < 32 ; $ i ++ ) { $ sessionId .= substr ( $ pool , mt_rand ( 0 , strlen ( $ pool ) - 1 ) , 1 ) ; } $ this -> setSessionId ( $ sessionId ) ; } | Regenerates the session id |
234,893 | public function setInstances ( Manager $ manager , DataContainer $ data , FlashContainer $ flash ) { $ this -> manager = $ manager ; $ this -> data = $ data ; $ this -> flash = $ flash ; } | Sets the manager that manages this driver and container instances for this session |
234,894 | protected function findSessionId ( ) { if ( ! empty ( $ this -> config [ 'post_cookie_name' ] ) and isset ( $ _POST [ $ this -> config [ 'post_cookie_name' ] ] ) ) { $ this -> sessionId = $ _POST [ $ this -> config [ 'post_cookie_name' ] ] ; } elseif ( ! empty ( $ this -> config [ 'enable_cookie' ] ) and isset ( $ _COO... | Finds the current session id |
234,895 | protected function setCookie ( $ name , $ value ) { $ expiration = $ this -> expiration > 0 ? $ this -> expiration + time ( ) : 0 ; return setcookie ( $ name , $ value , $ expiration , $ this -> config [ 'cookie_path' ] , $ this -> config [ 'cookie_domain' ] , $ this -> config [ 'cookie_secure' ] , $ this -> config [ '... | Sets a cookie . Note that all cookie values must be strings and no automatic serialization will be performed! |
234,896 | protected function deleteCookie ( $ name ) { unset ( $ _COOKIE [ $ name ] ) ; return setcookie ( $ name , null , - 86400 , $ this -> config [ 'cookie_path' ] , $ this -> config [ 'cookie_domain' ] , $ this -> config [ 'cookie_secure' ] , $ this -> config [ 'cookie_http_only' ] ) ; } | Deletes a cookie by making the value null and expiring it |
234,897 | protected function createFields ( $ pclass ) { $ fields = array ( ) ; $ fields [ ] = $ this -> dom -> createElement ( 'description' ) ; end ( $ fields ) -> appendChild ( $ this -> dom -> createTextNode ( $ pclass -> getDescription ( ) ) ) ; $ fields [ ] = $ this -> dom -> createElement ( 'months' , $ pclass -> getMonth... | Creates DOMElement for all fields for specified PClass . |
234,898 | public function watermark ( ImageResource $ watermark , $ watermarkPos = 4 , $ watermarkMargin = 10 ) { switch ( $ watermarkPos ) { case 0 : $ watermarkdestX = $ this -> width / 2 - $ watermark -> getWidth ( ) / 2 ; $ watermarkdestY = $ this -> height / 2 - $ watermark -> getHeight ( ) / 2 ; break ; case 1 : $ watermar... | adds a watermark to the image |
234,899 | public function trnRegister ( $ redirect = false ) { $ crc = md5 ( $ this -> postData [ "p24_session_id" ] . "|" . $ this -> posId . "|" . $ this -> postData [ "p24_amount" ] . "|" . $ this -> postData [ "p24_currency" ] . "|" . $ this -> salt ) ; $ this -> addValue ( "p24_sign" , $ crc ) ; $ RES = $ this -> callUrl ( ... | Prepare a transaction request |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.