idx int64 0 60.3k | question stringlengths 64 4.24k | target stringlengths 5 618 |
|---|---|---|
7,700 | protected function getNewValues ( User $ user ) { $ newProps = new UserUpdater ( ) ; $ this -> logger -> section ( 'Editing user ' . $ user -> getEmail ( ) . ' (' . $ user -> getUsername ( ) . ')' ) ; $ this -> logger -> comment ( 'leave empty to keep unchanged' ) ; $ newProps -> setUsername ( $ this -> ask ( new Quest... | Ask for new user properties |
7,701 | static function notify ( $ message , $ type , $ page = null ) { global $ pagenow ; if ( ( null != $ page && $ page == $ pagenow ) || null == $ page ) { add_action ( 'admin_notices' , create_function ( '' , "echo '<div class=\"" . $ type . "\"><p>" . $ message . "</p></div>';" ) ) ; } } | Register an admin notification . |
7,702 | public function set ( EntityInterface $ entity ) : string { $ hash = $ entity -> calculateHash ( ) ; $ content = $ this -> encodeContent ( $ entity -> writeData ( ) ) ; $ this -> saveContent ( $ hash , $ content ) ; return $ hash ; } | Sets the specified entity into the registry . |
7,703 | public function get ( string $ hash ) : ? EntityInterface { $ result = null ; $ content = $ this -> loadContent ( $ hash ) ; if ( $ content !== null ) { $ result = $ this -> createEntityFromContent ( $ content ) ; } return $ result ; } | Returns the entity with the specified hash . |
7,704 | protected function createEntityFromContent ( string $ content ) : EntityInterface { $ result = $ this -> createEntity ( ) ; $ result -> readData ( new DataContainer ( $ this -> decodeContent ( $ content ) ) ) ; return $ result ; } | Creates an entity from the specified content . |
7,705 | public function associateScope ( ScopeEntity $ scope ) { if ( ! isset ( $ this -> scopes [ $ scope -> getId ( ) ] ) ) { $ this -> scopes [ $ scope -> getId ( ) ] = $ scope ; } return $ this ; } | Associate a scope |
7,706 | public function hasScope ( $ scope ) { if ( $ this -> scopes === null ) { $ this -> getScopes ( ) ; } return isset ( $ this -> scopes [ $ scope ] ) ; } | Check if access token has an associated scope |
7,707 | public function getClient ( ) { if ( $ this -> client instanceof ClientEntity ) { return $ this -> client ; } $ this -> client = $ this -> server -> getClientStorage ( ) -> getBySession ( $ this ) ; return $ this -> client ; } | Return the session client |
7,708 | public function setOwner ( $ type , $ id ) { $ this -> ownerType = $ type ; $ this -> ownerId = $ id ; $ this -> server -> getEventEmitter ( ) -> emit ( new SessionOwnerEvent ( $ this ) ) ; return $ this ; } | Set the session owner |
7,709 | public function save ( ) { $ id = $ this -> server -> getSessionStorage ( ) -> create ( $ this -> getOwnerType ( ) , $ this -> getOwnerId ( ) , $ this -> getClient ( ) -> getId ( ) , $ this -> getClient ( ) -> getRedirectUri ( ) ) ; $ this -> setId ( $ id ) ; foreach ( $ this -> getScopes ( ) as $ scope ) { $ this -> s... | Save the session |
7,710 | protected function convertButtons ( ) { $ buttons = array ( ) ; $ snippets = array ( ) ; if ( isset ( $ this -> assignedValues ) ) { foreach ( $ this -> assignedValues as $ item ) { if ( $ item instanceof \ Psc \ UI \ ButtonInterface ) { $ button = $ item ; } elseif ( $ item instanceof \ Psc \ CMS \ Entity ) { $ button... | Wandelt die assignedValues in Buttons um |
7,711 | protected function prepareColumnsConfig ( ) { $ columns = [ ] ; foreach ( $ this -> table -> getColumns ( ) as $ column ) { $ columns [ ] = $ column -> getProperties ( ) ; } $ this -> table -> setColumns ( $ columns ) ; } | Prepare columns config |
7,712 | protected function prepareExtensionsConfig ( ) { foreach ( $ this -> table -> getExtensions ( ) as $ extension ) { $ properties = $ extension -> getProperties ( ) ; if ( isset ( $ properties ) ) { $ this -> table -> setProperty ( $ extension -> getPropertyName ( ) , $ properties ) ; } } } | Prepare extensions config |
7,713 | public function dirs ( $ resource , $ recursive = false , $ filter = null ) { return $ this -> ls ( $ resource , self :: LS_MODE_DIR , $ recursive , $ filter ) ; } | Get a list of directories from a resource . |
7,714 | public function ls ( $ resource , $ mode = self :: LS_MODE_FILE , $ recursive = false , $ filter = null ) { $ files = [ ] ; list ( , $ paths , $ path ) = $ this -> _parse ( $ resource ) ; foreach ( ( array ) $ paths as $ _path ) { if ( file_exists ( $ _path . '/' . $ path ) ) { foreach ( $ this -> _list ( FS :: clean (... | Get a list of files or diretories from a resource . |
7,715 | protected function _list ( $ path , $ prefix = '' , $ mode = 'file' , $ recursive = false , $ filter = null ) { $ files = [ ] ; $ ignore = [ '.' , '..' , '.DS_Store' , '.svn' , '.git' , '.gitignore' , '.gitmodules' , 'cgi-bin' ] ; if ( $ scan = @ scandir ( $ path ) ) { foreach ( $ scan as $ file ) { if ( Arr :: in ( $ ... | Get the list of files or directories in a given path . |
7,716 | public function putBaiDu ( array $ urls ) { return $ this -> getBaiDu ( ) -> setHeader ( [ 'Content-Type' => 'text/plain' ] ) -> parameters ( $ this -> merge ( [ 'urls' => $ urls ] ) ) -> encode ( function ( $ data ) { return implode ( "\n" , $ data [ 'urls' ] ) ; } ) -> json ( ) ; } | INITIATIVE PUT URLS TO BAIDU |
7,717 | private function createCreateForm ( PermissionsGroup $ permissionsGroup ) { $ form = $ this -> createForm ( new PermissionsGroupType ( ) , $ permissionsGroup , array ( 'action' => $ this -> generateUrl ( 'admin_permissionsgroup_create' ) , 'method' => 'POST' , ) ) ; $ form -> add ( 'submit' , 'submit' , array ( 'label'... | Creates a form to create a PermissionsGroup entity . |
7,718 | public function newAction ( ) { $ permissionsGroup = new PermissionsGroup ( ) ; $ form = $ this -> createCreateForm ( $ permissionsGroup ) ; return $ this -> render ( 'ChillMainBundle:PermissionsGroup:new.html.twig' , array ( 'entity' => $ permissionsGroup , 'form' => $ form -> createView ( ) , ) ) ; } | Displays a form to create a new PermissionsGroup entity . |
7,719 | public function showAction ( $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ permissionsGroup = $ em -> getRepository ( 'ChillMainBundle:PermissionsGroup' ) -> find ( $ id ) ; if ( ! $ permissionsGroup ) { throw $ this -> createNotFoundException ( 'Unable to find PermissionsGroup entity.' ) ; } $ transl... | Finds and displays a PermissionsGroup entity . |
7,720 | private function getExpandedRoles ( array $ roleScopes ) { $ expandedRoles = array ( ) ; foreach ( $ roleScopes as $ roleScope ) { if ( ! array_key_exists ( $ roleScope -> getRole ( ) , $ expandedRoles ) ) { $ expandedRoles [ $ roleScope -> getRole ( ) ] = array_map ( function ( RoleInterface $ role ) { return $ role -... | expand roleScopes to be easily shown in template |
7,721 | public function editAction ( $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ permissionsGroup = $ em -> getRepository ( 'ChillMainBundle:PermissionsGroup' ) -> find ( $ id ) ; if ( ! $ permissionsGroup ) { throw $ this -> createNotFoundException ( 'Unable to find PermissionsGroup entity.' ) ; } $ editFo... | Displays a form to edit an existing PermissionsGroup entity . |
7,722 | private function createEditForm ( PermissionsGroup $ permissionsGroup ) { $ form = $ this -> createForm ( new PermissionsGroupType ( ) , $ permissionsGroup , array ( 'action' => $ this -> generateUrl ( 'admin_permissionsgroup_update' , array ( 'id' => $ permissionsGroup -> getId ( ) ) ) , 'method' => 'PUT' , ) ) ; $ fo... | Creates a form to edit a PermissionsGroup entity . |
7,723 | public function updateAction ( Request $ request , $ id ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ permissionsGroup = $ em -> getRepository ( 'ChillMainBundle:PermissionsGroup' ) -> find ( $ id ) ; if ( ! $ permissionsGroup ) { throw $ this -> createNotFoundException ( 'Unable to find PermissionsGroup e... | Edits an existing PermissionsGroup entity . |
7,724 | protected function getPersistentRoleScopeBy ( $ role , Scope $ scope = null ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ roleScope = $ em -> getRepository ( 'ChillMainBundle:RoleScope' ) -> findOneBy ( array ( 'role' => $ role , 'scope' => $ scope ) ) ; if ( $ roleScope === NULL ) { $ roleScope = ( new Ro... | get a role scope by his parameters . The role scope is persisted if it doesn t exists in database . |
7,725 | public function deleteLinkRoleScopeAction ( $ pgid , $ rsid ) { $ em = $ this -> getDoctrine ( ) -> getManager ( ) ; $ permissionsGroup = $ em -> getRepository ( 'ChillMainBundle:PermissionsGroup' ) -> find ( $ pgid ) ; $ roleScope = $ em -> getRepository ( 'ChillMainBundle:RoleScope' ) -> find ( $ rsid ) ; if ( ! $ pe... | remove an association between permissionsGroup and roleScope |
7,726 | private function createDeleteRoleScopeForm ( PermissionsGroup $ permissionsGroup , RoleScope $ roleScope ) { return $ this -> createFormBuilder ( ) -> setAction ( $ this -> generateUrl ( 'admin_permissionsgroup_delete_role_scope' , array ( 'pgid' => $ permissionsGroup -> getId ( ) , 'rsid' => $ roleScope -> getId ( ) )... | Creates a form to delete a link to roleScope . |
7,727 | private function createAddRoleScopeForm ( PermissionsGroup $ permissionsGroup ) { return $ this -> createFormBuilder ( ) -> setAction ( $ this -> generateUrl ( 'admin_permissionsgroup_add_role_scope' , array ( 'id' => $ permissionsGroup -> getId ( ) ) ) ) -> setMethod ( 'PUT' ) -> add ( 'composed_role_scope' , 'compose... | creates a form to add a role scope to permissionsgroup |
7,728 | public function getDefaultQueue ( ) : ? Queue { $ manager = QueueFacade :: getFacadeRoot ( ) ; if ( isset ( $ manager ) ) { return $ manager -> connection ( ) ; } return $ manager ; } | Get a default queue value if any is available |
7,729 | public function insertMulti ( array $ hashes ) { $ valuesString = '' ; foreach ( $ hashes as $ id => $ hash ) { $ valuesString .= "('$id','$hash')," ; } $ this -> storage -> exec ( "INSERT INTO " . $ this -> tableName . "(id, hash) VALUES " . rtrim ( $ valuesString , ',' ) ) ; } | Inserts hashes in batch for better performance |
7,730 | public function updateMulti ( array $ hashes ) { $ startSql = "UPDATE " . $ this -> tableName ; $ this -> storage -> exec ( 'BEGIN TRANSACTION' ) ; foreach ( $ hashes as $ id => $ hash ) { $ this -> storage -> exec ( $ startSql . " SET hash='$hash' WHERE id='$id'" ) ; } $ this -> storage -> exec ( 'END TRANSACTION' ) ;... | Updating hashes in batch for better performance |
7,731 | public static function addParagraphStyle ( $ styleName , $ styles ) { if ( ! array_key_exists ( $ styleName , self :: $ _styleElements ) ) { $ style = new PHPWord_Style_Paragraph ( ) ; foreach ( $ styles as $ key => $ value ) { if ( substr ( $ key , 0 , 1 ) != '_' ) { $ key = '_' . $ key ; } $ style -> setStyleValue ( ... | Add a paragraph style |
7,732 | public static function addFontStyle ( $ styleName , $ styleFont , $ styleParagraph = null ) { if ( ! array_key_exists ( $ styleName , self :: $ _styleElements ) ) { $ font = new PHPWord_Style_Font ( 'text' , $ styleParagraph ) ; foreach ( $ styleFont as $ key => $ value ) { if ( substr ( $ key , 0 , 1 ) != '_' ) { $ ke... | Add a font style |
7,733 | public static function addLinkStyle ( $ styleName , $ styles ) { if ( ! array_key_exists ( $ styleName , self :: $ _styleElements ) ) { $ style = new PHPWord_Style_Font ( 'link' ) ; foreach ( $ styles as $ key => $ value ) { if ( substr ( $ key , 0 , 1 ) != '_' ) { $ key = '_' . $ key ; } $ style -> setStyleValue ( $ k... | Add a link style |
7,734 | public static function addTableStyle ( $ styleName , $ styleTable , $ styleFirstRow = null , $ styleLastRow = null ) { if ( ! array_key_exists ( $ styleName , self :: $ _styleElements ) ) { $ style = new PHPWord_Style_TableFull ( $ styleTable , $ styleFirstRow , $ styleLastRow ) ; self :: $ _styleElements [ $ styleName... | Add a table style |
7,735 | public function setProcessorsStack ( array $ stack ) { $ this -> processorsStack = [ ] ; foreach ( array_reverse ( $ stack ) as $ processor ) { $ this -> pushProcessor ( $ processor ) ; } return $ this ; } | Setting the processors stack as array . |
7,736 | public function getEntityMeta ( EntityMetaProvider $ entityMetaProvider = NULL ) { if ( ! isset ( $ this -> entityMeta ) && $ this -> type === self :: SPECIFIC ) { if ( ! isset ( $ entityMetaProvider ) ) throw new \ LogicException ( 'Missing Parameter 1 (EntityMetaProvider) for ' . __FUNCTION__ ) ; $ this -> entityMeta... | Returns the EntityMeta for specific or general type |
7,737 | public function getProperties ( $ public = true ) { JLog :: add ( 'JException::getProperties is deprecated.' , JLog :: WARNING , 'deprecated' ) ; $ vars = get_object_vars ( $ this ) ; if ( $ public ) { foreach ( $ vars as $ key => $ value ) { if ( '_' == substr ( $ key , 0 , 1 ) ) { unset ( $ vars [ $ key ] ) ; } } } r... | Returns an associative array of object properties |
7,738 | public static function isValidValue ( $ value , $ strict = false ) { static :: initialize ( ) ; return ( array_search ( $ value , static :: $ constants , $ strict ) !== false ) ; } | Check if a specific enum exists by value . |
7,739 | public static function getValueName ( $ value , $ strict = false ) { if ( ! static :: isValidValue ( $ value ) ) { throw new \ InvalidArgumentException ( 'No enum name was found for the value supplied.' ) ; } return array_search ( $ value , static :: $ constants , $ strict ) ; } | Get the enum name from its value . |
7,740 | public static function getNameValue ( $ name ) { static :: initialize ( ) ; if ( ! static :: isValidName ( $ name ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The enum name "%s" is not valid. Expected one of: %s' , $ name , implode ( ', ' , static :: names ( ) ) ) ) ; } return static :: $ constants [ static ... | Get the enum value from its name . |
7,741 | protected static function initialize ( ) { $ class = static :: class ; if ( static :: $ constants === null ) { static :: $ constants = ( new \ ReflectionClass ( $ class ) ) -> getConstants ( ) ; foreach ( static :: names ( ) as $ name ) { static :: $ lcKeyMap [ strtolower ( $ name ) ] = $ name ; } } } | Cache the enum array statically so we only have to do reflection a single time . |
7,742 | public static function instance ( ) { if ( null === self :: $ _instance ) { self :: $ _instance = new Blade ( APP_ROOT . 'views' , PROJECT_ROOT . 'tmp' . DS . 'cache' ) ; } return self :: $ _instance ; } | Instantiate Blade Renderer |
7,743 | public static function render ( $ template , $ data = [ ] ) { $ factory = self :: instance ( ) -> view ( ) ; $ view = $ factory -> make ( $ template , $ data ) ; return $ view -> render ( ) ; } | Render Blade template file with Data |
7,744 | public static function renderJSON ( $ data = [ ] , $ flags = null ) { if ( is_null ( $ flags ) ) { $ flags = JSON_HEX_TAG | JSON_HEX_APOS | JSON_HEX_AMP | JSON_HEX_QUOT | JSON_UNESCAPED_SLASHES ; } json_encode ( null ) ; $ result = json_encode ( $ data , $ flags ) ; if ( JSON_ERROR_NONE !== json_last_error ( ) ) { thro... | Json Encode String with given flags |
7,745 | public function setAll ( $ variables ) { $ vars = array ( ) ; foreach ( $ variables as $ k => $ v ) { $ vars [ ] = array ( 'key' => $ k , 'value' => $ v ) ; } return $ this -> setArgument ( "variables" , $ vars ) ; } | Sets all the given variables . |
7,746 | public function setStateChange ( $ stateChange ) { $ hash = sha1 ( $ stateChange ) ; $ this -> properties [ 'stateChange' ] = $ hash ; $ this -> callbacks [ $ hash ] = $ stateChange ; return $ this ; } | Set callback function to let you know when the state has changed . |
7,747 | public function belongsTo ( array $ tagList ) { if ( is_string ( $ this -> getName ( ) ) ) { return in_array ( strtolower ( $ this -> getName ( ) ) , $ tagList ) ; } return false ; } | Return true if the tag name is in the given list . |
7,748 | public function setRemoteApp ( RemoteApp $ v = null ) { if ( $ v === null ) { $ this -> setRemoteAppId ( NULL ) ; } else { $ this -> setRemoteAppId ( $ v -> getId ( ) ) ; } $ this -> aRemoteApp = $ v ; if ( $ v !== null ) { $ v -> addApiLog ( $ this ) ; } return $ this ; } | Declares an association between this object and a RemoteApp object . |
7,749 | public function getRemoteApp ( PropelPDO $ con = null , $ doQuery = true ) { if ( $ this -> aRemoteApp === null && ( $ this -> remote_app_id !== null ) && $ doQuery ) { $ this -> aRemoteApp = RemoteAppQuery :: create ( ) -> findPk ( $ this -> remote_app_id , $ con ) ; } return $ this -> aRemoteApp ; } | Get the associated RemoteApp object |
7,750 | public function parse ( $ code ) { $ parser = $ this -> parserFactory -> create ( $ this -> parserType ) ; try { $ ast = $ parser -> parse ( $ code ) ; } catch ( Error $ error ) { throw new ParseException ( $ error -> getMessage ( ) , 0 , $ error ) ; } $ printer = new Printer ( $ this -> securityManager ) ; return $ pr... | Parses untrusted PHP code and returns a secure version which only contains safe calls . Throws an exception in case the code contains untrusted calls |
7,751 | protected function positionAfterWhitespace ( $ start ) { $ position = $ start ; $ length = $ this -> source -> getLength ( ) ; while ( $ start < $ length ) { $ code = $ this -> charCodeAt ( $ position ) ; if ( $ code === 32 || $ code === 44 || $ code === 160 || $ code === 0x2028 || $ code === 0x2029 || $ code > 8 && $ ... | Reads from body starting at startPosition until it finds a non - whitespace or commented character then returns the position of that character for lexing . |
7,752 | protected function readNumber ( $ start , $ code ) { $ position = $ start ; $ type = Token :: INT_TYPE ; if ( $ code === 45 ) { $ code = $ this -> charCodeAt ( ++ $ position ) ; } if ( $ code === 48 ) { $ code = $ this -> charCodeAt ( ++ $ position ) ; } elseif ( $ code >= 49 && $ code <= 57 ) { do { $ code = $ this ->... | Reads a number token from the source file either a float or an int depending on whether a decimal point appears . |
7,753 | protected function readName ( $ position ) { $ end = $ position + 1 ; $ length = $ this -> source -> getLength ( ) ; $ body = $ this -> source -> getBody ( ) ; while ( $ end < $ length && ( $ code = $ this -> charCodeAt ( $ end ) ) && ( $ code === 95 || $ code >= 48 && $ code <= 57 || $ code >= 65 && $ code <= 90 || $ ... | Reads an alphanumeric + underscore name from the source . |
7,754 | protected function charCodeAt ( $ index ) { $ body = $ this -> source -> getBody ( ) ; $ char = mb_substr ( $ body , $ index , 1 , 'UTF-8' ) ; if ( mb_check_encoding ( $ char , 'UTF-8' ) ) { return hexdec ( bin2hex ( mb_convert_encoding ( $ char , 'UTF-32BE' , 'UTF-8' ) ) ) ; } else { return NULL ; } } | Implementation of JavaScript s String . prototype . charCodeAt function . |
7,755 | protected function char2hex ( $ a ) { return $ a >= 48 && $ a <= 57 ? $ a - 48 : ( $ a >= 65 && $ a <= 70 ? $ a - 55 : ( $ a >= 97 && $ a <= 102 ? $ a - 87 : - 1 ) ) ; } | Converts a hex character to its integer value . 0 becomes 0 9 becomes 9 A becomes 10 F becomes 15 a becomes 10 f becomes 15 |
7,756 | protected function convertNodes ( Array $ nodes , $ em ) { $ navigationNodes = array ( ) ; foreach ( $ nodes as $ node ) { $ node = ( object ) $ node ; $ navigationNode = $ this -> createNode ( array ( 'de' => $ node -> title ) ) ; $ navigationNode -> setContext ( $ this -> context ) ; $ navigationNode -> generateSlugs... | we elevate every node to an entity and set parent pointers |
7,757 | public function getRpPoints ( $ rp , $ metric , $ tags , $ granularity , $ startDt = null , $ endDt = null , $ timezone = 'utc' ) { if ( null == $ rp || null == $ metric ) { return [ ] ; } $ where = [ ] ; $ query = $ this -> db -> getQueryBuilder ( ) -> retentionPolicy ( $ rp ) -> sum ( 'value' ) -> from ( $ metric ) ;... | Get points from retention policy |
7,758 | public function getPoints ( $ metric , $ tags , $ granularity , $ endDt , $ timezone = 'utc' ) { if ( null == $ metric ) { return [ ] ; } $ where = [ ] ; $ now = $ this -> normalizeUTC ( date ( "Y-m-d H:i:s" ) ) ; $ min = intval ( date ( 'i' ) ) ; $ minutes = $ min > 45 ? 45 : ( $ min > 30 ? 30 : ( $ min > 15 ? 15 : '0... | Get points from default retention policy |
7,759 | public function getRpSum ( $ rp , $ metric , $ tags , $ startDt = null , $ endDt = null ) { if ( null == $ rp || null == $ metric ) { return 0 ; } $ where = [ ] ; if ( isset ( $ startDt ) ) { $ where [ ] = "time >= '" . $ startDt . "'" ; } if ( ! isset ( $ endDt ) ) { $ endDt = '2100-01-01T00:00:00Z' ; } $ where [ ] = ... | Get total from retention policy |
7,760 | public function getSum ( $ metric , $ tags , $ endDt = null ) { if ( null == $ metric ) { return 0 ; } $ min = intval ( date ( 'i' ) ) ; $ minutes = $ min > 45 ? 45 : ( $ min > 30 ? 30 : ( $ min > 15 ? 15 : '00' ) ) ; $ lastHourDt = date ( "Y-m-d" ) . "T" . date ( 'H' ) . ":$minutes:00Z" ; $ where = [ ] ; if ( ! isset ... | Get total from default retention policy |
7,761 | public function run ( ) { $ response = $ this -> queue -> handle ( $ this -> request ) ; $ reasonPhrase = $ response -> getReasonPhrase ( ) ; $ reasonPhrase = ( $ reasonPhrase ? ' ' . $ reasonPhrase : '' ) ; header ( sprintf ( 'HTTP/%s %d%s' , $ response -> getProtocolVersion ( ) , $ response -> getStatusCode ( ) , $ r... | run a http based application |
7,762 | public static function cacheBust ( string $ src ) : string { if ( ! file_exists ( $ src ) ) return $ src ; $ path = pathinfo ( $ src ) ; return $ path [ 'dirname' ] . '/' . $ path [ 'filename' ] . '.' . filemtime ( $ src ) . '.' . $ path [ 'extension' ] ; } | cacheBust function . |
7,763 | public function getTitle ( string $ prefix = '' , string $ separator = ' | ' , string $ sufix = '' ) : string { if ( empty ( $ this -> getTitleValue ( ) ) ) $ separator = '' ; return $ prefix . $ separator . $ this -> getTitleValue ( ) . $ sufix ; } | Get the view s title . |
7,764 | protected function getReflectionProperty ( $ name ) { do { $ reflClass = ( ! isset ( $ reflClass ) ) ? new \ ReflectionClass ( $ this -> getObject ( ) ) : $ reflClass ; $ property = $ reflClass -> getProperty ( $ name ) ; if ( isset ( $ property ) ) { break ; } } while ( ( $ reflClass = $ reflClass -> getParentClass ( ... | Get a reflection property - may need to iterate through class parents |
7,765 | public function render ( $ template = '' , $ data = [ ] ) { if ( ! isset ( $ this -> blocks [ $ template ] ) ) { $ this -> blocks [ $ template ] = $ this -> blockFactory -> create ( $ template ) ; } $ block = $ this -> blocks [ $ template ] ; $ block -> setData ( $ data ) ; return $ block -> render ( ) ; } | Render a block . |
7,766 | public static function create ( $ modelAlias = null , $ criteria = null ) { if ( $ criteria instanceof LicenseQuery ) { return $ criteria ; } $ query = new LicenseQuery ( null , null , $ modelAlias ) ; if ( $ criteria instanceof Criteria ) { $ query -> mergeWith ( $ criteria ) ; } return $ query ; } | Returns a new LicenseQuery object . |
7,767 | public function filterByMaxClients ( $ maxClients = null , $ comparison = null ) { if ( is_array ( $ maxClients ) ) { $ useMinMax = false ; if ( isset ( $ maxClients [ 'min' ] ) ) { $ this -> addUsingAlias ( LicensePeer :: MAX_CLIENTS , $ maxClients [ 'min' ] , Criteria :: GREATER_EQUAL ) ; $ useMinMax = true ; } if ( ... | Filter the query on the max_clients column |
7,768 | public function filterByDomain ( $ domain = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ domain ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ domain ) ) { $ domain = str_replace ( '*' , '%' , $ domain ) ; $ comparison = Criteria :: LIKE ; } } return $ th... | Filter the query on the domain column |
7,769 | public function filterByValidUntil ( $ validUntil = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ validUntil ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ validUntil ) ) { $ validUntil = str_replace ( '*' , '%' , $ validUntil ) ; $ comparison = Criteria :... | Filter the query on the valid_until column |
7,770 | public function filterBySerial ( $ serial = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ serial ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ serial ) ) { $ serial = str_replace ( '*' , '%' , $ serial ) ; $ comparison = Criteria :: LIKE ; } } return $ th... | Filter the query on the serial column |
7,771 | public function setDOM ( DOMElement $ element ) { $ this -> _element = $ this -> _element -> ownerDocument -> importNode ( $ element , true ) ; } | Update the object from a DOM element |
7,772 | protected function ensureAppended ( ) { if ( ! $ this -> _appended ) { $ this -> _parentElement -> getDOM ( ) -> appendChild ( $ this -> _element ) ; $ this -> _appended = true ; $ this -> _parentElement -> ensureAppended ( ) ; } } | Appends this element to its parent if necessary . |
7,773 | public function __isset ( $ var ) { if ( strpos ( $ var , ':' ) !== false ) { list ( $ ns , $ elt ) = explode ( ':' , $ var , 2 ) ; foreach ( $ this -> _element -> childNodes as $ child ) { if ( $ child -> localName == $ elt && $ child -> prefix == $ ns ) { return true ; } } } else { foreach ( $ this -> _element -> chi... | Map isset calls onto the underlying entry representation . |
7,774 | public function render ( array $ data , ContextInterface $ context ) { $ data = array_merge ( [ 'class' => null ] , $ data ) ; $ data [ 'class' ] .= ' materialize-textarea' ; $ data [ 'class' ] = Str :: trim ( $ data [ 'class' ] ) ; return parent :: render ( $ data , $ context ) ; } | Render a text area form widget . |
7,775 | public function input ( $ name , $ default = null ) { $ value = e ( $ this -> value ( $ name , $ default ) ) ; $ name = e ( $ name ) ; return "name=\"$name\" value=\"$value\"" ; } | Get the attributes for an input field . |
7,776 | public function checkbox ( $ name , $ inputValue = 1 , $ checkByDefault = false ) { $ value = $ this -> value ( $ name ) ; if ( is_null ( $ value ) ) { $ checked = $ checkByDefault ; } else { $ checked = $ value == $ inputValue ; } $ name = e ( $ name ) ; $ inputValue = e ( $ inputValue ) ; $ checked = $ checked ? ' ch... | Get the attributes for a checkbox . |
7,777 | public function radio ( $ name , $ inputValue = 1 , $ checkByDefault = false ) { return $ this -> checkbox ( $ name , $ inputValue , $ checkByDefault ) ; } | Get the attributes for a radio . |
7,778 | public function options ( $ options , $ name , $ default = null , $ placeholder = null ) { $ tags = [ ] ; if ( $ placeholder ) { $ tags [ ] = '<option value="" selected disabled>' . e ( $ placeholder ) . '</option>' ; } $ value = $ this -> value ( $ name , $ default ) ; if ( ! is_array ( $ value ) ) { $ value = [ $ val... | Get the options for a select . |
7,779 | public function error ( $ name , $ template = null ) { $ errors = $ this -> session -> get ( 'errors' ) ; if ( is_null ( $ template ) ) { $ template = config ( 'form-helpers.error_template' ) ; } if ( $ errors && $ errors -> has ( $ name ) ) { return str_replace ( ':message' , e ( $ errors -> first ( $ name ) ) , $ tem... | Get the error message if exists . |
7,780 | public function value ( $ name , $ default = null ) { if ( ! is_null ( $ value = $ this -> valueFromOld ( $ name ) ) ) { return $ value ; } if ( ! is_null ( $ value = $ this -> valueFromModel ( $ name ) ) ) { return $ value ; } return $ default ; } | Get the value to use in an input field . |
7,781 | public static function hasFeature ( $ jname , $ feature ) { $ return = false ; $ admin = Factory :: getAdmin ( $ jname ) ; $ user = Factory :: getUser ( $ jname ) ; switch ( $ feature ) { case 'wizard' : $ return = $ admin -> methodDefined ( 'setupFromPath' ) ; break ; case 'useractivity' : $ return = $ user -> methodD... | Check if feature exists |
7,782 | public static function getXml ( $ data , $ isFile = true ) { libxml_use_internal_errors ( true ) ; if ( $ isFile ) { $ xml = simplexml_load_file ( $ data ) ; } else { $ xml = simplexml_load_string ( $ data ) ; } if ( $ xml === false ) { $ message = null ; if ( $ isFile ) { $ message = Text :: _ ( 'FILE' ) . ': ' . $ da... | Checks to see if a JFusion plugin is properly configured |
7,783 | public static function raise ( $ type , $ message , $ jname = '' ) { if ( is_array ( $ message ) ) { foreach ( $ message as $ msgtype => $ msg ) { if ( is_numeric ( $ msgtype ) ) { $ msgtype = $ jname ; } static :: raise ( $ type , $ msg , $ msgtype ) ; } } else { $ app = Application :: getInstance ( ) ; if ( $ message... | Raise warning function that can handle arrays |
7,784 | public static function validate ( $ identifier , $ password , $ name = null ) { return Handler :: create ( $ name ) -> validate ( $ identifier , $ password ) ; } | Validate user credentials |
7,785 | public static function sign_in ( \ Auth \ User $ user , $ keep_loggedin = true , $ name = null ) { return Handler :: create ( $ name ) -> sign_in ( $ user , $ keep_loggedin ) ; } | Sign in a user |
7,786 | public static function doUpdate ( $ values , PropelPDO $ con = null ) { if ( $ con === null ) { $ con = Propel :: getConnection ( SystemSettingsPeer :: DATABASE_NAME , Propel :: CONNECTION_WRITE ) ; } $ selectCriteria = new Criteria ( SystemSettingsPeer :: DATABASE_NAME ) ; if ( $ values instanceof Criteria ) { $ crite... | Performs an UPDATE on the database given a SystemSettings or Criteria object . |
7,787 | protected function parseTitle ( ) { if ( ( $ registeredName = array_search ( $ this -> className , $ this -> defaultContextSettings ) ) !== false ) { return $ registeredName ; } elseif ( preg_match ( '/\\\\([^\\\\]*)Helper$/' , $ this -> className , $ matches ) ) { return $ matches [ 1 ] ; } return $ this -> className ... | Get the title from the Eel helper class name |
7,788 | protected function parseDescription ( ) { $ description = $ this -> classReflection -> getDescription ( ) . chr ( 10 ) . chr ( 10 ) ; $ description .= 'Implemented in: ``' . $ this -> className . '``' . chr ( 10 ) . chr ( 10 ) ; $ helperName = $ this -> parseTitle ( ) ; $ helperInstance = new $ this -> className ( ) ; ... | Iterate over all methods in the helper class |
7,789 | protected function prepareInit ( ) { $ stid = oci_parse ( $ this -> raw , "ALTER SESSION SET NLS_TIMESTAMP_FORMAT = 'YYYY-MM-DD HH24:MI:SS'" ) ; oci_execute ( $ stid ) ; oci_free_statement ( $ stid ) ; $ stid = oci_parse ( $ this -> raw , "ALTER SESSION SET NLS_SORT = BINARY_CI" ) ; oci_execute ( $ stid ) ; oci_free_st... | Preparing initialization of connection |
7,790 | public function persist ( $ collection , array $ document ) { if ( $ collection instanceof Collection ) { $ collectionName = $ collection -> getName ( ) ; } else { $ collectionName = $ collection ; $ collection = static :: factory ( $ collection ) ; } $ data = $ this -> marshall ( $ document ) ; $ result = false ; if (... | Sync data to database . If it s new data we insert it as new document otherwise if the document exists we just update it . |
7,791 | public function insert ( $ collectionName , $ data ) { $ id = 0 ; $ sql = $ this -> dialect -> grammarInsert ( $ collectionName , $ data ) ; $ stid = oci_parse ( $ this -> raw , $ sql ) ; oci_bind_by_name ( $ stid , ":id" , $ id , - 1 , SQLT_INT ) ; foreach ( $ data as $ key => $ value ) { oci_bind_by_name ( $ stid , "... | Perform insert new document to database . |
7,792 | public function update ( $ collectionName , $ data ) { $ sql = $ this -> dialect -> grammarUpdate ( $ collectionName , $ data ) ; $ stid = oci_parse ( $ this -> raw , $ sql ) ; oci_bind_by_name ( $ stid , ":id" , $ data [ 'id' ] ) ; foreach ( $ data as $ key => $ value ) { oci_bind_by_name ( $ stid , ":" . $ key , $ da... | Perform update to a document . |
7,793 | protected function set_options ( array $ options = [ ] ) { foreach ( $ options as $ key => $ value ) { if ( ! array_key_exists ( $ key , $ this -> options ) ) { throw new \ InvalidArgumentException ( sprintf ( 'The option "%1$s" does not have a matching option[%1$s] array key' , $ key ) , 1.0 ) ; continue ; } $ this ->... | Setting the given options from constructor . |
7,794 | public function check4Client ( $ iCustomerId ) { if ( $ this -> get ( 'security.context' ) -> isGranted ( 'ROLE_ADMIN' ) ) { return true ; } else { $ oUser = $ this -> getUser ( ) ; if ( empty ( $ oUser ) ) { return false ; } $ oResult = UserCustomerRelationQuery :: create ( ) -> findOneByArray ( array ( "UserId" => $ ... | Check if user has access to customer |
7,795 | public function visitFile ( \ SplFileInfo $ file , MessageCatalogue $ catalogue ) { if ( $ file -> getExtension ( ) != 'yml' ) { return ; } $ path = strtr ( $ file -> getRealPath ( ) , DIRECTORY_SEPARATOR , '/' ) ; if ( strpos ( $ path , 'Resources/config/pageparts' ) === false ) { return ; } $ parser = $ this -> getYm... | Collect the pagepart names! |
7,796 | public function setChatOffset ( $ offsetX , $ offsetY ) { $ offset = array ( ( float ) $ offsetX , ( float ) $ offsetY ) ; $ this -> setProperty ( $ this -> chatProperties , "offset" , implode ( " " , $ offset ) ) ; return $ this ; } | Set the chat offset |
7,797 | public function setMapInfoPosition ( $ positionX , $ positionY , $ positionZ = null ) { $ this -> setPositionProperty ( $ this -> mapInfoProperties , $ positionX , $ positionY , $ positionZ ) ; return $ this ; } | Set the map info position |
7,798 | public function setCountdownPosition ( $ positionX , $ positionY , $ positionZ = null ) { $ this -> setPositionProperty ( $ this -> countdownProperties , $ positionX , $ positionY , $ positionZ ) ; return $ this ; } | Set the countdown position |
7,799 | public function renderStandalone ( ) { $ domDocument = new \ DOMDocument ( "1.0" , "utf-8" ) ; $ domDocument -> xmlStandalone = true ; $ domElement = $ domDocument -> createElement ( "ui_properties" ) ; $ domDocument -> appendChild ( $ domElement ) ; $ allProperties = $ this -> getProperties ( ) ; foreach ( $ allProper... | Render the UI Properties standalone |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.