idx
int64
0
60.3k
question
stringlengths
64
4.24k
target
stringlengths
5
618
5,600
protected function renderItems ( ) { $ lines = array ( ) ; if ( $ this -> type === Enum :: DROPDOWN_CONTENT ) { $ lines [ ] = $ this -> dropdownContent ; } if ( $ this -> type === Enum :: DROPDOWN_LIST ) { foreach ( $ this -> items as $ item ) { if ( is_string ( $ item ) ) { $ lines [ ] = $ item ; continue ; } if ( ! i...
Renders dropdown items
5,601
public static function valid_fingerprint ( $ fingerprint = null , $ name = null ) { return Manager :: create ( $ name ) -> valid_fingerprint ( $ fingerprint ) ; }
Check if the given fingerprint or the default fingerprint parameter matches the curent session fingerprint .
5,602
public static function set ( $ key , $ value , $ manager = null ) { return Manager :: create ( $ manager ) -> set ( $ key , $ value ) ; }
Set a value on the session
5,603
public static function add ( $ key , $ value , $ manager = null ) { return Manager :: create ( $ manager ) -> add ( $ key , $ value ) ; }
Similar to add but forces the element to be an array and appends an item .
5,604
public static function doDeleteAll ( PropelPDO $ con = null ) { if ( $ con === null ) { $ con = Propel :: getConnection ( UserCustomerRelationPeer :: DATABASE_NAME , Propel :: CONNECTION_WRITE ) ; } $ affectedRows = 0 ; try { $ con -> beginTransaction ( ) ; $ affectedRows += BasePeer :: doDeleteAll ( UserCustomerRelati...
Deletes all rows from the user_customer_relation table .
5,605
public static function doDelete ( $ values , PropelPDO $ con = null ) { if ( $ con === null ) { $ con = Propel :: getConnection ( UserCustomerRelationPeer :: DATABASE_NAME , Propel :: CONNECTION_WRITE ) ; } if ( $ values instanceof Criteria ) { UserCustomerRelationPeer :: clearInstancePool ( ) ; $ criteria = clone $ va...
Performs a DELETE on the database given a UserCustomerRelation or Criteria object OR a primary key value .
5,606
public static function retrieveByPK ( $ pk , PropelPDO $ con = null ) { if ( null !== ( $ obj = UserCustomerRelationPeer :: getInstanceFromPool ( ( string ) $ pk ) ) ) { return $ obj ; } if ( $ con === null ) { $ con = Propel :: getConnection ( UserCustomerRelationPeer :: DATABASE_NAME , Propel :: CONNECTION_READ ) ; }...
Retrieve a single object by pkey .
5,607
public static function retrieveByPKs ( $ pks , PropelPDO $ con = null ) { if ( $ con === null ) { $ con = Propel :: getConnection ( UserCustomerRelationPeer :: DATABASE_NAME , Propel :: CONNECTION_READ ) ; } $ objs = null ; if ( empty ( $ pks ) ) { $ objs = array ( ) ; } else { $ criteria = new Criteria ( UserCustomerR...
Retrieve multiple objects by pkey .
5,608
public function setSettingValue ( $ key , $ value ) { if ( $ key == '_orientation' && $ value == 'landscape' ) { $ this -> setLandscape ( ) ; } elseif ( $ key == '_orientation' && is_null ( $ value ) ) { $ this -> setPortrait ( ) ; } elseif ( $ key == '_borderSize' ) { $ this -> setBorderSize ( $ value ) ; } elseif ( $...
Set Setting Value
5,609
public function setLandscape ( ) { $ this -> _orientation = 'landscape' ; $ this -> _pageSizeW = $ this -> _defaultPageSizeH ; $ this -> _pageSizeH = $ this -> _defaultPageSizeW ; }
Set Landscape Orientation
5,610
public function setPortrait ( ) { $ this -> _orientation = null ; $ this -> _pageSizeW = $ this -> _defaultPageSizeW ; $ this -> _pageSizeH = $ this -> _defaultPageSizeH ; }
Set Portrait Orientation
5,611
public function getBorderSize ( ) { $ t = $ this -> getBorderTopSize ( ) ; $ l = $ this -> getBorderLeftSize ( ) ; $ r = $ this -> getBorderRightSize ( ) ; $ b = $ this -> getBorderBottomSize ( ) ; return array ( $ t , $ l , $ r , $ b ) ; }
Get Border Size
5,612
public function setBorderColor ( $ pValue = null ) { $ this -> _borderTopColor = $ pValue ; $ this -> _borderLeftColor = $ pValue ; $ this -> _borderRightColor = $ pValue ; $ this -> _borderBottomColor = $ pValue ; }
Set Border Color
5,613
public function getBorderColor ( ) { $ t = $ this -> getBorderTopColor ( ) ; $ l = $ this -> getBorderLeftColor ( ) ; $ r = $ this -> getBorderRightColor ( ) ; $ b = $ this -> getBorderBottomColor ( ) ; return array ( $ t , $ l , $ r , $ b ) ; }
Get Border Color
5,614
public function getRepository ( string $ className ) : AbstractObjectRepository { $ className = 'Infakt\\Repository\\' . substr ( $ className , strrpos ( $ className , '\\' ) + 1 ) . 'Repository' ; if ( ! class_exists ( $ className ) ) { throw new LogicException ( "There is no repository to work with class $className."...
Return object repository for a specific model class name .
5,615
public function get ( string $ query ) : ResponseInterface { return $ this -> client -> request ( 'get' , $ this -> buildQuery ( $ query ) , [ 'headers' => $ this -> getAuthorizationHeader ( ) ] ) ; }
Send HTTP GET request .
5,616
private function registerSanitizer ( ) { $ this -> singleton ( Contracts \ Sanitizer :: class , function ( $ app ) { $ config = $ app [ 'config' ] ; return new Factory ( $ config -> get ( 'sanitizer.filters' ) ) ; } ) ; $ this -> singleton ( 'arcanedev.sanitizer' , Contracts \ Sanitizer :: class ) ; }
Register Helpers .
5,617
public function hook ( OutputInterface $ output , array $ response ) { $ this -> printBoolean ( $ output , 'OK' , $ response [ 'success' ] , true === $ response [ 'success' ] ) ; }
output for hook api .
5,618
public function delete ( OutputInterface $ output , array $ response ) { $ this -> printBoolean ( $ output , 'OK' , $ response [ 'success' ] , true === $ response [ 'success' ] ) ; }
output for delete api .
5,619
protected function matchUser ( $ email , $ group ) { return Credentials :: getUserProvider ( ) -> findByLogin ( $ email ) -> addGroup ( Credentials :: getGroupProvider ( ) -> findByName ( $ group ) ) ; }
Add the user by email to a group .
5,620
public static function prefixFromType ( $ strType ) { switch ( $ strType ) { case Type :: ARRAY_TYPE : return "obj" ; case Type :: BOOLEAN : return "bln" ; case Type :: DATE_TIME : return "dtt" ; case Type :: FLOAT : return "flt" ; case Type :: INTEGER : return "int" ; case Type :: OBJECT : return "obj" ; case Type :: ...
Returns prefix for variable according to variable type
5,621
public function getInstalledTemplatePaths ( ) { $ dir = QCUBED_CONFIG_DIR . '/templates' ; $ paths = [ ] ; if ( $ dir !== false ) { foreach ( scandir ( $ dir ) as $ strFileName ) { if ( substr ( $ strFileName , - 8 ) == '.inc.php' ) { $ paths2 = include ( $ dir . '/' . $ strFileName ) ; if ( $ paths2 && is_array ( $ pa...
Return an array of paths to template files . This base class versions searches a config directory for pointers to template files to use . This allows qcubed repos to inject templates into the codegen process .
5,622
public static function getSettingsXml ( ) { $ strCrLf = "\r\n" ; $ strToReturn = sprintf ( '<codegen>%s' , $ strCrLf ) ; $ strToReturn .= sprintf ( ' <name application="%s"/>%s' , Codegen :: $ ApplicationName , $ strCrLf ) ; $ strToReturn .= sprintf ( ' <render preferredRenderMethod="%s"/>%s' , Codegen :: $ PreferredRe...
Gets the settings in codegen_settings . xml file and returns its text without comments
5,623
public static function run ( $ strSettingsXmlFilePath ) { if ( ! defined ( 'QCUBED_CODE_GENERATING' ) ) { define ( 'QCUBED_CODE_GENERATING' , true ) ; } Codegen :: $ CodeGenArray = array ( ) ; Codegen :: $ SettingsFilePath = $ strSettingsXmlFilePath ; if ( ! file_exists ( $ strSettingsXmlFilePath ) ) { Codegen :: $ Roo...
The function which actually performs the steps for code generation Code generation begins here .
5,624
protected function getTemplateSettings ( $ strTemplateFilePath , & $ strTemplate = null ) { if ( $ strTemplate === null ) { $ strTemplate = file_get_contents ( $ strTemplateFilePath ) ; } $ strError = 'Template\'s first line must be <template OverwriteFlag="boolean" TargetDirectory="string" DirectorySuffix="string" Tar...
Returns the settings of the template file as SimpleXMLElement object
5,625
public function generateFile ( $ strModuleSubPath , $ strTemplateFilePath , $ mixArgumentArray , $ blnSave = true ) { if ( Codegen :: DEBUG_MODE ) { echo ( "Evaluating $strTemplateFilePath<br/>" ) ; } if ( ! file_exists ( $ strTemplateFilePath ) ) { throw new Caller ( 'Template File Not Found: ' . $ strTemplateFilePath...
Generates a php code using a template file
5,626
protected function evaluatePHP ( $ strFilename , $ mixArgumentArray , & $ templateSettings = null ) { if ( $ mixArgumentArray ) { foreach ( $ mixArgumentArray as $ strName => $ mixValue ) { $ $ strName = $ mixValue ; } } global $ _TEMPLATE_SETTINGS ; unset ( $ _TEMPLATE_SETTINGS ) ; $ _TEMPLATE_SETTINGS = null ; $ objC...
Returns the evaluated PHP
5,627
protected function modelClassName ( $ strTableName ) { $ strTableName = $ this -> stripPrefixFromTable ( $ strTableName ) ; return sprintf ( '%s%s%s' , $ this -> strClassPrefix , QString :: camelCaseFromUnderscore ( $ strTableName ) , $ this -> strClassSuffix ) ; }
Given a table name returns the name of the class for the corresponding model object .
5,628
public function modelVariableName ( $ strTableName ) { $ strTableName = $ this -> stripPrefixFromTable ( $ strTableName ) ; return Codegen :: prefixFromType ( Type :: OBJECT ) . QString :: camelCaseFromUnderscore ( $ strTableName ) ; }
Given a table name returns a variable name that will be used to represent the corresponding model object .
5,629
protected function modelColumnVariableName ( SqlColumn $ objColumn ) { return Codegen :: prefixFromType ( $ objColumn -> VariableType ) . QString :: camelCaseFromUnderscore ( $ objColumn -> Name ) ; }
Given a column returns the name of the variable used to represent the column s value inside the model object .
5,630
protected function modelReferenceColumnName ( $ strColumnName ) { $ intNameLength = strlen ( $ strColumnName ) ; if ( ( $ intNameLength > 3 ) && ( substr ( $ strColumnName , $ intNameLength - 3 ) == "_id" ) ) { $ strColumnName = substr ( $ strColumnName , 0 , $ intNameLength - 3 ) ; } else { $ strColumnName = sprintf (...
Given the name of a column that is a foreign key to another table returns a kind of virtual column name that would refer to the object pointed to . This new name is used to refer to the object version of the column by json and other encodings and derivatives of this name are used to represent a variable and property na...
5,631
protected function modelReferenceVariableName ( $ strColumnName ) { $ strColumnName = $ this -> modelReferenceColumnName ( $ strColumnName ) ; return Codegen :: prefixFromType ( Type :: OBJECT ) . QString :: camelCaseFromUnderscore ( $ strColumnName ) ; }
Given a column name to a foreign key returns the name of the variable that will represent the foreign object stored in the model .
5,632
public static function modelConnectorControlName ( ColumnInterface $ objColumn ) { if ( ( $ o = $ objColumn -> Options ) && isset ( $ o [ 'Name' ] ) ) { return $ o [ 'Name' ] ; } return QString :: wordsFromCamelCase ( Codegen :: modelConnectorPropertyName ( $ objColumn ) ) ; }
Returns the control label name as used in the ModelConnector corresponding to this column or table .
5,633
public static function modelConnectorPropertyName ( ColumnInterface $ objColumn ) { if ( $ objColumn instanceof SqlColumn ) { if ( $ objColumn -> Reference ) { return $ objColumn -> Reference -> PropertyName ; } else { return $ objColumn -> PropertyName ; } } elseif ( $ objColumn instanceof ReverseReference ) { if ( $ ...
The property name used in the ModelConnector for the given column virtual column or table
5,634
public function modelConnectorVariableName ( ColumnInterface $ objColumn ) { $ strPropName = static :: modelConnectorPropertyName ( $ objColumn ) ; $ objControlHelper = $ this -> getControlCodeGenerator ( $ objColumn ) ; return $ objControlHelper -> varName ( $ strPropName ) ; }
Return a variable name corresponding to the given column including virtual columns like ReverseReference and QManyToMany references .
5,635
public function modelConnectorLabelVariableName ( ColumnInterface $ objColumn ) { $ strPropName = static :: modelConnectorPropertyName ( $ objColumn ) ; return \ QCubed \ Codegen \ Generator \ Label :: instance ( ) -> varName ( $ strPropName ) ; }
Returns a variable name for the label version of a control which would be the read - only version of viewing the data in the column .
5,636
public static function dataListControlName ( SqlTable $ objTable ) { if ( ( $ o = $ objTable -> Options ) && isset ( $ o [ 'Name' ] ) ) { return $ o [ 'Name' ] ; } return QString :: wordsFromCamelCase ( $ objTable -> ClassNamePlural ) ; }
Returns the control label name as used in the data list panel corresponding to this column .
5,637
public static function dataListItemName ( SqlTable $ objTable ) { if ( ( $ o = $ objTable -> Options ) && isset ( $ o [ 'ItemName' ] ) ) { return $ o [ 'ItemName' ] ; } return QString :: wordsFromCamelCase ( $ objTable -> ClassName ) ; }
Returns the name of an item in the data list as will be displayed in the edit panel .
5,638
protected function variableTypeFromDbType ( $ strDbType ) { switch ( $ strDbType ) { case Database \ FieldType :: BIT : return Type :: BOOLEAN ; case Database \ FieldType :: BLOB : return Type :: STRING ; case Database \ FieldType :: CHAR : return Type :: STRING ; case Database \ FieldType :: DATE : return Type :: DATE...
Returns the variable type corresponding to the database column type
5,639
protected function pluralize ( $ strName ) { switch ( true ) { case ( strtolower ( $ strName ) == 'play' ) : return $ strName . 's' ; } $ intLength = strlen ( $ strName ) ; if ( substr ( $ strName , $ intLength - 1 ) == "y" ) { return substr ( $ strName , 0 , $ intLength - 1 ) . "ies" ; } if ( substr ( $ strName , $ in...
Return the plural of the given name . Override this and return the plural version of particular names if this generic version isn t working for you .
5,640
public function toArray ( ) { $ attr = ! empty ( $ this -> getWarden ( ) ) ? $ this -> getWarden ( ) : null ; if ( empty ( $ attr ) ) { $ attr = empty ( $ this -> getVisible ( ) ) ? $ this -> getFillable ( ) : $ this -> getVisible ( ) ; } $ returnable = [ ] ; $ f_model = \ FormModel :: using ( 'plain' ) -> withModel ( ...
Parses the warden config .
5,641
public function cc ( $ email , $ name = null ) { if ( ! is_array ( $ email ) ) { $ email = array ( $ email => $ name ) ; } foreach ( $ email as $ address => $ name ) { if ( is_numeric ( $ address ) && is_string ( $ name ) ) { $ this -> cc [ $ name ] = null ; } else { $ this -> cc [ $ address ] = $ name ; } } return $ t...
Add Carbon copies
5,642
public function send ( ) { $ config = \ CCConfig :: create ( 'mail' ) ; if ( $ config -> disabled === true ) { return ; } if ( empty ( $ this -> to ) ) { throw new Exception ( "Cannot send mail without recipients." ) ; } if ( $ config -> get ( 'catch_all.enabled' ) === true ) { $ mail = clone $ this ; $ mail -> to = ar...
Prepare the message for sending to the transport
5,643
protected function transport ( $ transporter = null ) { if ( ! is_null ( $ transporter ) ) { $ transporter = Transporter :: create ( $ transporter ) ; } else { $ transporter = $ this -> transporter ; } $ transporter -> send ( $ this ) ; }
Transport the message
5,644
public function returnExceptionToThrow ( $ status_code ) { static $ map = array ( 1 => 'E4xx_IndexOutOfBoundsWebDriverError' , 2 => 'E4xx_NoCollectionWebDriverError' , 3 => 'E4xx_NoStringWebDriverError' , 4 => 'E4xx_NoStringLengthWebDriverError' , 5 => 'E4xx_NoStringWrapperWebDriverError' , 6 => 'E4xx_NoSuchDriverWebDr...
Returns the name of the exception class to throw
5,645
private function getHttpVerb ( $ webdriver_command ) { $ methods = $ this -> getMethods ( ) ; if ( ! isset ( $ methods [ $ webdriver_command ] ) ) { throw new E5xx_BadMethodCallWebDriverError ( sprintf ( '%s is not a valid webdriver command.' , $ webdriver_command ) ) ; } return $ methods [ $ webdriver_command ] ; }
determine the HTTP verb to use for a given webdriver command
5,646
public function getProjectRoot ( $ name , $ mode = Project :: MODE_SRC ) { if ( $ mode === Project :: MODE_PHAR ) { $ root = new Dir ( PHAR_ROOT ) ; } elseif ( ( $ proot = $ this -> hostConfig -> get ( array ( 'projects' , $ name , 'root' ) ) ) != NULL ) $ root = new Dir ( $ proot ) ; else $ root = $ this -> getProject...
Macht keine Checks ob das Projekt existiert
5,647
private function parseName ( string $ name ) : array { $ name = str_replace ( '/' , '\\' , $ name ) ; if ( strpos ( $ name , '\\' ) !== false ) { $ names = explode ( '\\' , $ name ) ; $ class = array_pop ( $ names ) ; return [ join ( '\\' , $ names ) , $ class ] ; } return [ '' , $ name ] ; }
Split user name into namespace and class name .
5,648
private function getGalleryList ( Response $ response ) { $ list = $ this -> manager -> getGalleryList ( ) ; foreach ( $ list as $ gallery ) { $ file = $ this -> prepareGallery ( $ gallery ) ; $ response -> addFile ( $ file ) ; $ response -> addTreeFile ( $ file ) ; } }
get Gallery list .
5,649
private function getGallery ( Response $ response , $ target = '' ) { if ( $ target && $ gallery = $ this -> manager -> getGallery ( basename ( $ target ) ) ) { $ response -> setCwd ( $ this -> prepareGallery ( $ gallery ) ) ; $ images = $ gallery -> getImages ( true ) ; foreach ( $ images as $ img ) { $ this -> addIma...
get Gallery .
5,650
private function prepareGallery ( Gallery $ gallery ) { $ time = $ gallery -> getUpdatedAt ( ) ? $ gallery -> getUpdatedAt ( ) -> getTimestamp ( ) : time ( ) ; $ file = new FileInfo ( $ gallery -> getName ( ) , $ this -> driverId , $ time , $ this -> driverOptions [ 'rootName' ] ) ; $ file -> setHash ( $ this -> getDri...
prepare Gallery .
5,651
private function addImage ( Response $ response , Image $ image , $ galleryId , $ imageSize ) { if ( $ image -> get ( $ imageSize ) ) { $ href = $ image -> get ( $ imageSize ) -> getHref ( ) ; $ file = new FileInfo ( $ image -> getTitle ( ) . '(' . $ imageSize . ')' , $ this -> getDriverId ( ) , $ image -> getUpdateAt ...
add Image .
5,652
static public function getVirtualAlias ( $ strName ) { $ strName = trim ( $ strName ) ; $ strName = str_replace ( " " , "_" , $ strName ) ; $ strName = strtolower ( $ strName ) ; return $ strName ; }
Converts a virtual attribute name to an alias used in the query . The name is converted to an identifier that will work on any SQL database . In the query itself the name will have two underscores in front of the alias name to prevent conflicts with column names .
5,653
public static function extractSelectClause ( $ objClauses ) { if ( $ objClauses instanceof Clause \ Select ) { return $ objClauses ; } if ( is_array ( $ objClauses ) ) { $ hasSelects = false ; $ objSelect = QQ :: select ( ) ; foreach ( $ objClauses as $ objClause ) { if ( $ objClause instanceof Clause \ Select ) { $ ha...
Searches for all the Clause \ Select clauses and merges them into one clause and returns that clause . Returns null if none found .
5,654
static public function func ( $ strName , $ param1 ) { $ args = func_get_args ( ) ; $ strFunc = array_shift ( $ args ) ; return new Node \ FunctionNode ( $ strFunc , $ args ) ; }
Apply an arbitrary scalar function using the given parameters . See below for functions that let you apply common SQL functions . The list below only includes sql operations that are generic to all supported versions of SQL . However you can call Func directly with any named function that works in your current SQL vers...
5,655
static public function mathOp ( $ strOperation , $ param1 ) { $ args = func_get_args ( ) ; $ strFunc = array_shift ( $ args ) ; return new Node \ Math ( $ strFunc , $ args ) ; }
Apply an arbitrary math operation to 2 or more operands . Operands can be scalar values or column nodes .
5,656
protected function registerBladeDirectives ( ) { Blade :: directive ( 'form' , function ( $ expression ) { $ expression = $ this -> addParenthesis ( $ expression ) ; return "<?php app('Activisme_BE')->model{$expression}; ?>" ; } ) ; Blade :: directive ( 'input' , function ( $ expression ) { $ expression = $ this -> add...
Register blade directives .
5,657
public function setStyleValue ( $ key , $ value ) { if ( $ key == '_borderSize' ) { $ this -> setBorderSize ( $ value ) ; } elseif ( $ key == '_borderColor' ) { $ this -> setBorderColor ( $ value ) ; } else { $ this -> $ key = $ value ; } }
Set style value
5,658
public function getUser ( $ username , $ password ) { $ authHash = $ this -> hashUserNameAndPassword ( $ username , $ password ) ; $ body = json_encode ( [ 'clientType' => 'wp-plugin' ] ) ; try { $ response = $ this -> client -> post ( $ this -> loginurl , [ 'headers' => [ 'Authorization' => 'Basic ' . $ authHash ] , '...
get user information
5,659
public function createApiKey ( ) { if ( ! isset ( $ this -> token ) ) { return false ; } $ authHeader = 'LP-Security-Token' ; if ( stripos ( $ this -> token , 'lp ' ) === 0 ) { $ authHeader = 'Authorization' ; } try { $ response = $ this -> client -> post ( $ this -> keyUrl , [ 'headers' => [ $ authHeader => $ this -> ...
Create an API key for account
5,660
public function parseResponse ( $ deleteTokenOnFail = false ) { $ responseArray = json_decode ( $ this -> response , true ) ; if ( isset ( $ responseArray [ 'error' ] ) && $ responseArray [ 'error' ] ) { unset ( $ this -> token ) ; if ( $ deleteTokenOnFail ) { $ this -> deleteToken ( ) ; } return $ this -> response ; }...
Parse response for call to Leadpages Login . If response does not contain a error we will return a response with HttpResponseCode and Message
5,661
protected static function detectType ( array $ data ) { foreach ( [ self :: TYPE_MESSAGE , self :: TYPE_EDITED_MESSAGE , self :: TYPE_CHANNEL_POST , self :: TYPE_EDITED_CHANNEL_POST , self :: TYPE_INLINE_QUERY , self :: TYPE_CHOSEN_INLINE_RESULT , self :: TYPE_CALLBACK_QUERY , ] as $ type ) { if ( isset ( $ data [ $ ty...
Detects update type
5,662
public function perform ( ) { if ( ! is_null ( $ this -> input ) ) { CCIn :: instance ( $ this -> input ) ; } else { CCIn :: instance ( CCServer :: instance ( ) ) ; } static :: $ _current = & $ this ; if ( ! $ this -> route instanceof CCRoute ) { $ this -> route = CCRouter :: resolve ( '#404' ) ; } foreach ( CCRouter :...
Execute the Request
5,663
public function cardInfo ( $ number , $ expirationDate , $ code ) { $ this -> setArgument ( 'card_number' , $ number ) ; $ this -> setArgument ( 'card_expiration_date' , $ expirationDate ) ; return $ this -> setArgument ( 'card_code' , $ code ) ; }
Set card information .
5,664
public function address ( $ streetAddress , $ city , $ state , $ zip , $ country ) { $ this -> setArgument ( 'address' , $ streetAddress ) ; $ this -> setArgument ( 'city' , $ city ) ; $ this -> setArgument ( 'state' , $ state ) ; $ this -> setArgument ( 'zip' , $ zip ) ; return $ this -> setArgument ( 'country' , $ co...
Set card billing address .
5,665
private function createChainArrayOfReturnValues ( $ action , $ response ) { $ methods = $ this -> methods ; $ firstMethod = array_pop ( $ methods ) ; $ lastValue = $ response ; $ mockClassType = get_class ( $ this -> mockClass ) ; if ( ! $ this -> mockClass instanceof MockInterface ) { throw self :: generateException (...
Creating a chain array of return values
5,666
private function extractChainedMethodsBefore ( $ methods , $ currentMethod ) { $ chainedMethodsBefore = [ ] ; $ currentMethodName = key ( $ currentMethod ) ; foreach ( $ methods as $ method ) { $ methodName = key ( $ method ) ; if ( $ methodName == $ currentMethodName ) { break ; } $ chainedMethodsBefore [ ] = $ method...
Extracting chained methods before current method into an array
5,667
public function addChild ( & $ node , $ setCurrent = false ) { JLog :: add ( 'JTree::addChild() is deprecated.' , JLog :: WARNING , 'deprecated' ) ; $ this -> _current -> addChild ( $ node ) ; if ( $ setCurrent ) { $ this -> _current = & $ node ; } }
Method to add a child
5,668
public function getParent ( ) { JLog :: add ( 'JTree::getParent() is deprecated.' , JLog :: WARNING , 'deprecated' ) ; $ this -> _current = & $ this -> _current -> getParent ( ) ; }
Method to get the parent
5,669
public function addNamespace ( $ name ) { if ( ! Arr :: in ( $ name , self :: $ _namespace ) ) { self :: $ _namespace [ ] = $ name ; return true ; } return false ; }
Add new helper group namespace .
5,670
protected function _register ( $ id , $ className ) { $ id = ( string ) $ id ; if ( class_exists ( $ className ) ) { self :: $ _loaded [ $ id ] = $ className ; $ this [ $ id ] = function ( ) use ( $ className ) { return new $ className ( ) ; } ; } else { throw new Exception ( "Helper \"{{$className}}\" not found!" ) ; ...
Register helper class .
5,671
protected function _getClassName ( $ class ) { $ class = Str :: low ( $ class ) ; list ( $ plugin , $ className ) = pluginSplit ( $ class ) ; $ return = self :: HELPER_SUFFIX . '\\' . Inflector :: camelize ( $ className ) . self :: HELPER_SUFFIX ; if ( $ plugin !== null ) { return Inflector :: camelize ( $ plugin ) . '...
Get current helper class name .
5,672
public function createSlug ( $ value , $ id = 0 ) { $ slug = str_slug ( $ value ) ; $ relatedSlugs = $ this -> getRelatedSlugs ( $ slug , $ id ) ; if ( ! $ relatedSlugs -> contains ( 'slug' , $ slug ) ) { return $ slug ; } $ completed = false ; $ i = 1 ; while ( $ completed == false ) { $ newSlug = $ slug . '-' . $ i ;...
Create a unique slug
5,673
protected function getRelatedSlugs ( $ slug , $ id = 0 ) { return $ this -> select ( 'slug' ) -> where ( 'slug' , 'like' , $ slug . '%' ) -> where ( 'id' , '<>' , $ id ) -> get ( ) ; }
Get similar slugs
5,674
public function setUser ( User $ v = null ) { if ( $ v === null ) { $ this -> setUserId ( NULL ) ; } else { $ this -> setUserId ( $ v -> getId ( ) ) ; } $ this -> aUser = $ v ; if ( $ v !== null ) { $ v -> addUserRole ( $ this ) ; } return $ this ; }
Declares an association between this object and a User object .
5,675
public function getUser ( PropelPDO $ con = null , $ doQuery = true ) { if ( $ this -> aUser === null && ( $ this -> user_id !== null ) && $ doQuery ) { $ this -> aUser = UserQuery :: create ( ) -> findPk ( $ this -> user_id , $ con ) ; } return $ this -> aUser ; }
Get the associated User object
5,676
public function setRole ( Role $ v = null ) { if ( $ v === null ) { $ this -> setRoleId ( NULL ) ; } else { $ this -> setRoleId ( $ v -> getId ( ) ) ; } $ this -> aRole = $ v ; if ( $ v !== null ) { $ v -> addUserRole ( $ this ) ; } return $ this ; }
Declares an association between this object and a Role object .
5,677
public function getRole ( PropelPDO $ con = null , $ doQuery = true ) { if ( $ this -> aRole === null && ( $ this -> role_id !== null ) && $ doQuery ) { $ this -> aRole = RoleQuery :: create ( ) -> findPk ( $ this -> role_id , $ con ) ; } return $ this -> aRole ; }
Get the associated Role object
5,678
final protected function initPostTypesTrait ( ) { add_action ( "init" , function ( ) { $ postTypes = $ this -> getPostTypes ( ) ; foreach ( $ postTypes as $ postType ) { $ this -> registerPostType ( $ postType ) ; } } ) ; }
Called automatically when the plugins are loaded this method registers our post types for the users of this boilerplate .
5,679
public function onUpdated ( UpdatedEvent $ event ) { if ( $ event -> getPackage ( ) -> getType ( ) == self :: PLUGIN_TYPE ) { $ this -> addPackage ( $ event -> getPackage ( ) ) ; } }
Update plugin data .
5,680
public function onInstalled ( InstalledEvent $ event ) { if ( $ event -> getPackage ( ) -> getType ( ) == self :: PLUGIN_TYPE ) { $ this -> addPackage ( $ event -> getPackage ( ) ) ; } }
Registr plugin .
5,681
protected function addPackage ( ComposerPackage $ package ) { $ plugin = $ this -> rep -> find ( $ package -> getName ( ) ) ; if ( ! $ plugin ) { $ plugin = new Plugin ( ) ; $ plugin -> setName ( $ package -> getName ( ) ) ; } list ( $ vendor , $ package ) = explode ( '/' , $ plugin -> getName ( ) ) ; try { $ data = $ ...
Add plugin from package .
5,682
public function onRemoved ( RemovedEvent $ event ) { if ( $ event -> getPackage ( ) -> getType ( ) == self :: PLUGIN_TYPE ) { $ plugin = $ this -> rep -> find ( $ event -> getPackage ( ) -> getName ( ) ) ; if ( $ plugin ) { $ this -> em -> remove ( $ plugin ) ; $ this -> em -> flush ( ) ; } } }
Unregistr plugin .
5,683
public function onInstalledConfigureShmop ( InstalledEvent $ event ) { if ( $ event -> getPackage ( ) -> getName ( ) == self :: PACKAGE_SHMOP ) { $ this -> parameters -> set ( 'cache_time_keeper.driver' , 'cache_time_keeper.driver.multi' ) ; $ this -> parameters -> set ( 'cache_time_keeper.driver.multi.fast' , 'cache_t...
Configure shmop .
5,684
public function onRemovedShmop ( RemovedEvent $ event ) { if ( $ event -> getPackage ( ) -> getName ( ) == self :: PACKAGE_SHMOP ) { $ this -> parameters -> set ( 'cache_time_keeper.driver' , 'cache_time_keeper.driver.file' ) ; } }
Restore config on removed shmop .
5,685
public function lock ( ) { if ( ! $ this -> isLocked ( ) ) { $ file = fopen ( $ this -> getFilePath ( ) , 'w' ) ; if ( $ file ) { fwrite ( $ file , getmypid ( ) ) ; fclose ( $ file ) ; return true ; } } return false ; }
Try create semafor file
5,686
protected function buildCommand ( $ binary , $ host , $ port , $ base ) { $ binary = $ this -> handleCustomIni ( $ binary ) ; $ base = str_replace ( "'" , '' , $ base ) ; $ command = "{$binary} -S {$host}:{$port} {$base}/server.php" ; return $ command ; }
Returns a command to pass through to shell .
5,687
protected function handleCustomIni ( $ command ) { if ( ! $ this -> option ( 'ini' ) ) { return $ command ; } $ command = str_replace ( "'" , '' , $ command ) ; $ iniPath = ( $ this -> option ( 'ini-path' ) === $ this -> defaultIniPath ) ? $ this -> laravel -> basePath ( ) . '/' . $ this -> defaultIniPath : $ this -> o...
Adds parameter telling PHP built - in server to respect a custom php . ini file .
5,688
public function getChoices ( $ username = null , $ email = null , $ or = false , $ limit = null ) { $ qb = $ this -> getRepository ( ) -> createQueryBuilder ( 'u' ) ; $ qb -> orderBy ( 'u.username' ) ; $ method = $ or ? 'orWhere' : 'andWhere' ; if ( $ username ) { $ qb -> $ method ( 'u.username LIKE :username' ) ; $ qb...
Find user choices
5,689
public function getChoicesAsEmailUsername ( array & $ choices ) { $ ret = [ ] ; foreach ( $ choices as $ item ) { $ ret [ ] = sprintf ( '%s (%s)' , $ item -> getEmail ( ) , $ item -> getUsername ( ) ) ; } return $ ret ; }
Get selector choices as combined username + email
5,690
public function updateUser ( User $ user , UserUpdater $ up ) { $ up -> updateUser ( $ user , $ this -> getEncoder ( ) ) ; $ em = $ this -> getRegistry ( ) -> getManager ( ) ; $ em -> persist ( $ user ) ; $ em -> flush ( ) ; }
Update user details
5,691
public function get ( ) { if ( ! file_exists ( $ this -> file ) ) return array ( ) ; $ data = unserialize ( base64_decode ( file_get_contents ( $ this -> file ) ) ) ; return $ data ? : array ( ) ; }
returns the cached access token
5,692
public function put ( $ accessToken ) { if ( $ accessToken === null ) return unlink ( $ this -> file ) ; file_put_contents ( $ this -> file , base64_encode ( serialize ( $ accessToken ) ) ) ; return file_exists ( $ this -> file ) ; }
store the access token
5,693
public static function _fetch_handler ( & $ query ) { $ query -> fetch_arguments = array ( 'obj' ) ; return static :: assign ( $ query -> handler -> fetch ( $ query -> build ( ) , $ query -> handler -> builder ( ) -> parameters , array ( 'assoc' ) ) ) ; }
Fetch from the databse and created models out of the reults
5,694
public static function find ( $ param = null , $ param2 = null ) { $ settings = static :: _model ( ) ; $ query = DB :: select ( $ settings [ 'table' ] ) ; if ( ! is_null ( $ settings [ 'find_modifier' ] ) ) { $ callbacks = $ settings [ 'find_modifier' ] ; if ( ! \ CCArr :: is_collection ( $ callbacks ) ) { $ callbacks ...
Model finder This function allows you direct access to your records .
5,695
public function __call_property ( $ key ) { $ result = parent :: __call_property ( $ key ) ; if ( $ result instanceof Model_Relation ) { return $ this -> _data_store [ $ key ] = $ result -> run ( ) ; } return $ result ; }
Call a function as a property
5,696
protected function has_one ( $ model , $ foreign_key = null , $ local_key = null ) { return new Model_Relation_HasOne ( $ this , $ model , $ foreign_key , $ local_key ) ; }
Has one releationships
5,697
protected function has_many ( $ model , $ foreign_key = null , $ local_key = null ) { return new Model_Relation_HasMany ( $ this , $ model , $ foreign_key , $ local_key ) ; }
Has many releationships
5,698
protected function belongs_to ( $ model , $ foreign_key = null , $ local_key = null ) { return new Model_Relation_BelongsTo ( $ this , $ model , $ foreign_key , $ local_key ) ; }
Belongs To releationships
5,699
public static function with ( $ with , $ callback = null ) { if ( ! is_array ( $ with ) ) { $ with = array ( $ with ) ; } $ settings = static :: _model ( ) ; $ query = DB :: select ( $ settings [ 'table' ] ) ; if ( ! is_null ( $ callback ) ) { call_user_func_array ( $ callback , array ( & $ query ) ) ; } $ query -> for...
find with an relationship