idx
int64
0
60.3k
question
stringlengths
99
4.85k
target
stringlengths
5
718
58,500
private function parseParameters ( array $ parameters ) { if ( empty ( $ parameters ) ) { return '' ; } $ parameters = implode ( '&' , array_map ( function ( $ value , $ key ) { return sprintf ( '%s=%s' , $ key , urlencode ( $ value ) ) ; } , $ parameters , array_keys ( $ parameters ) ) ) ; return "&{$parameters}" ; }
Parse an array of parameters to their string representation .
58,501
public static function bootRequired ( ) { if ( self :: isUnableToRunPlugins ( ) ) { return ; } foreach ( self :: $ required as $ plugin ) { require_once __DIR__ . DS . $ plugin ; } }
Load required plugins
58,502
public static function loadFromPath ( $ path ) { if ( self :: isUnableToRunPlugins ( ) ) { return ; } if ( ! file_exists ( $ path ) ) { throw new InvalidArgumentException ( "The path [{$path}] doesn't exist to load plugins." ) ; } $ plugins = require $ path ; foreach ( $ plugins as $ plugin ) { if ( array_key_exists ( ...
Require plugins based on an array of paths
58,503
protected function setTags ( $ key , array $ tags = [ ] ) { if ( empty ( $ tags ) ) { return ; } foreach ( $ this -> prepareTags ( $ tags ) as $ tag ) { if ( ( $ keys = $ this -> storage -> get ( $ tag ) ) !== false ) { $ keys = $ this -> unserialize ( $ keys ) ; if ( in_array ( $ key , $ keys , true ) ) { continue ; }...
Sets a tags
58,504
public function getByTaxonomy ( $ taxonomy ) { if ( ! ( $ taxonomy instanceof Taxonomy ) ) { $ taxonomy = $ this -> taxonomyFactory -> create ( $ taxonomy ) ; } return $ this -> convertTermsArray ( get_terms ( $ taxonomy -> getName ( ) , array ( 'hide_empty' => false ) ) , $ taxonomy ) ; }
Get all terms in the given taxonomy .
58,505
private function convertTermsArray ( $ terms , Taxonomy $ taxonomy ) { $ res = array ( ) ; foreach ( $ terms as $ t ) { $ res [ ] = $ this -> termFactory -> create ( $ t , $ taxonomy ) ; } return $ res ; }
Convert an array of Wordpress term objects to array of Term objects .
58,506
protected function checkSSHConnection ( $ server = null , $ ssh_config_file = null , $ verbose = false ) { $ server = $ server ? $ server : $ this -> hostNameForConfigFile ( ) ; $ ssh_config_file = $ ssh_config_file ? $ ssh_config_file : $ this -> sshConfigFile ( ) ; if ( $ verbose ) { $ this -> info ( "timeout 10 ssh ...
Check SSH connection .
58,507
protected function abortIfNoSSHConnection ( $ server = null ) { $ server = $ server ? $ server : $ this -> hostNameForConfigFile ( ) ; if ( ! $ this -> checkSSHConnection ( $ server ) ) { $ this -> error ( "SSH connection to server $server doesn't works. Please run php artisan publish:init or publish:ssh" ) ; die ( ) ;...
Abort if no SSH connection .
58,508
protected function _processKey ( $ config , $ key , $ value ) { if ( strpos ( $ key , $ this -> _nestSeparator ) !== false ) { $ parts = explode ( $ this -> _nestSeparator , $ key , 2 ) ; if ( strlen ( Arrays :: first ( $ parts ) ) && strlen ( Arrays :: last ( $ parts ) ) ) { if ( ! isset ( $ config [ Arrays :: first (...
Assign the key s value to the property list . Handles the nest separator for sub - properties .
58,509
public function assertParity ( ) : void { $ ignored_classes = [ ] ; $ object_exists = false ; $ actor_exists = false ; $ locator = new ClassFileLocator ( $ this -> folder ) ; foreach ( $ locator as $ file ) { $ filename = str_replace ( $ this -> folder . DIRECTORY_SEPARATOR , '' , $ file -> getRealPath ( ) ) ; foreach ...
Validates the compiled schema directory .
58,510
protected function checkEdgeDir ( string $ node_name ) : void { $ dirname = $ this -> folder . DIRECTORY_SEPARATOR . $ node_name . "Out" ; if ( ! file_exists ( $ dirname ) ) { throw new Exceptions \ AbsentEdgeDirImparityException ( $ dirname , $ node_name ) ; } }
Checks if the node has a directory for its edges .
58,511
public function optimize ( stdClass $ data ) { $ data -> translationFilePrefix = $ this -> stringWithUnderscore ( $ data -> serviceURL ) ; $ data -> translationFilePrefix = $ this -> stringWithUnderscore ( $ data -> translationFilePrefix ) ; $ data -> translationsLocation = $ this -> getTranslationPrefix ( $ data ) . $...
Optimizing Translations data
58,512
private function getServiceProviderNameSpace ( stdClass $ item ) { return json_decode ( file_get_contents ( $ item -> rootDirectory . 'app/' . HCNewService :: CONFIG_PATH ) ) -> general -> serviceProviderNameSpace ; }
Getting service provider namespace
58,513
public function generate ( stdClass $ service ) { $ this -> createFileFromTemplate ( [ "destination" => $ service -> rootDirectory . 'resources/lang/en/' . $ service -> translationFilePrefix . '.php' , "templateDestination" => __DIR__ . '/../templates/service/translations.hctpl' , "content" => [ "translations" => $ thi...
Creating translation file
58,514
private function gatherTranslations ( stdClass $ service ) { $ output = '' ; $ tpl = file_get_contents ( __DIR__ . '/../templates/shared/array.element.hctpl' ) ; $ line = str_replace ( '{key}' , 'page_title' , $ tpl ) ; $ line = str_replace ( '{value}' , $ service -> serviceName , $ line ) ; $ output .= $ line ; $ outp...
Gathering available translations
58,515
private function gatherTranslationsFromModel ( stdClass $ model , string $ tpl , array $ skip ) { $ output = '' ; if ( array_key_exists ( 'columns' , $ model ) && ! empty ( $ model -> columns ) ) foreach ( $ model -> columns as $ column ) { if ( in_array ( $ column -> Field , $ skip ) ) continue ; $ line = str_replace ...
Gathering fields from specific model
58,516
public function getQueryCacheDriver ( ) { if ( ! $ this -> queryCacheDriver instanceof CacheProvider ) { $ this -> queryCacheDriver = $ this -> getCacheDriver ( ( string ) $ this -> getOption ( 'query_cache_namespace' ) , $ this -> getOption ( 'query_cache_driver' ) ) ; } return $ this -> queryCacheDriver ; }
Retrieve query cache driver .
58,517
public function getResultCacheDriver ( ) { if ( ! $ this -> resultCacheDriver instanceof CacheProvider ) { $ this -> resultCacheDriver = $ this -> getCacheDriver ( ( string ) $ this -> getOption ( 'result_cache_namespace' ) , $ this -> getOption ( 'result_cache_driver' ) ) ; } return $ this -> resultCacheDriver ; }
Retrieve result cache driver .
58,518
public function getHydratorCacheDriver ( ) { if ( ! $ this -> hydratorCacheDriver instanceof CacheProvider ) { $ this -> hydratorCacheDriver = $ this -> getCacheDriver ( ( string ) $ this -> getOption ( 'hydrator_cache_namespace' ) , $ this -> getOption ( 'hydrator_cache_driver' ) ) ; } return $ this -> hydratorCacheDr...
Retrieve hydrator cache driver .
58,519
protected function getCacheDriver ( $ cacheNamespace , CacheProvider $ cacheDriver = null ) { if ( ! $ cacheDriver instanceof CacheProvider ) { $ cacheDriver = clone $ this -> getMetadataCacheDriver ( ) ; $ cacheDriver -> setNamespace ( $ cacheNamespace ) ; } if ( $ cacheDriver -> getNamespace ( ) === '' ) { $ cacheDri...
Get cache driver .
58,520
protected function getNamingStrategy ( ) { if ( ! $ this -> namingStrategy instanceof NamingStrategy ) { $ namingStrategy = $ this -> getOption ( 'naming_strategy' ) ; if ( ! $ namingStrategy instanceof NamingStrategy ) { $ namingStrategy = new UnderscoreNamingStrategy ( CASE_LOWER ) ; } $ this -> namingStrategy = $ na...
Retrieve naming strategy .
58,521
protected function getQuoteStrategy ( ) { if ( ! $ this -> quoteStrategy instanceof QuoteStrategy ) { $ quoteStrategy = $ this -> getOption ( 'quote_strategy' ) ; if ( ! $ quoteStrategy instanceof QuoteStrategy ) { $ quoteStrategy = new DefaultQuoteStrategy ; } $ this -> quoteStrategy = $ quoteStrategy ; } return $ thi...
Retrieve quote strategy .
58,522
protected function getSecondLevelCacheConfiguration ( ) { if ( ! $ this -> secondCacheConfig instanceof CacheConfiguration ) { $ secondCacheConfig = $ this -> getOption ( 'second_level_cache_configuration' ) ; if ( $ secondCacheConfig instanceof CacheConfiguration ) { $ this -> secondCacheConfig = $ secondCacheConfig ;...
Retrieve second level cache configuration .
58,523
protected function getSQLLogger ( ) { if ( ! $ this -> SQLLogger instanceof SQLLogger ) { $ sqlLogger = $ this -> getOption ( 'sql_logger' ) ; if ( $ sqlLogger instanceof SQLLogger ) { $ this -> SQLLogger = $ sqlLogger ; } } return $ this -> SQLLogger ; }
Retrieve SQL logger .
58,524
protected function getCustomStringFunctions ( ) { $ functions = ( array ) $ this -> getOption ( 'custom_string_functions' ) ; return array_filter ( $ functions , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; }
Retrieve custom DQL string functions .
58,525
protected function getCustomNumericFunctions ( ) { $ functions = ( array ) $ this -> getOption ( 'custom_numeric_functions' ) ; return array_filter ( $ functions , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; }
Retrieve custom DQL numeric functions .
58,526
protected function getCustomDateTimeFunctions ( ) { $ functions = ( array ) $ this -> getOption ( 'custom_datetime_functions' ) ; return array_filter ( $ functions , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; }
Retrieve custom DQL date time functions .
58,527
protected function getCustomTypes ( ) { $ types = ( array ) $ this -> getOption ( 'custom_types' ) ; return array_filter ( $ types , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; }
Retrieve custom DBAL types .
58,528
protected function getCustomMappingTypes ( ) { $ mappingTypes = ( array ) $ this -> getOption ( 'custom_mapping_types' ) ; return array_filter ( $ mappingTypes , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; }
Retrieve custom DBAL mapping types .
58,529
protected function getCustomFilters ( ) { $ filters = ( array ) $ this -> getOption ( 'custom_filters' ) ; return array_filter ( $ filters , function ( $ name ) { return is_string ( $ name ) ; } , ARRAY_FILTER_USE_KEY ) ; }
Get custom registered filters .
58,530
protected function getConsoleHelperSet ( ) { $ entityManager = $ this -> getManager ( ) ; return new HelperSet ( [ 'db' => new ConnectionHelper ( $ entityManager -> getConnection ( ) ) , 'em' => new EntityManagerHelper ( $ entityManager ) , ] ) ; }
Get console helper set .
58,531
public function setSalt ( string $ salt , string $ position = self :: SALT_AFTER ) : self { $ this -> checkSaltPositionArgument ( $ position ) ; $ this -> salt = $ salt ; $ this -> saltPosition = $ position ; return $ this ; }
Sets the salt if any was used
58,532
protected function checkSaltPositionArgument ( $ position ) : void { if ( ! in_array ( $ position , [ self :: SALT_BEFORE , self :: SALT_AFTER ] ) ) { throw new InvalidArgumentException ( sprintf ( '`%s` is an invalud argument, it has to be `` or ``' , $ position , self :: SALT_BEFORE , self :: SALT_AFTER ) ) ; } }
Checks the salt position argument
58,533
public function queryBuilder ( ConnectionInterface $ connection , String $ connectionId = null ) : QueryBuilderProvider { return new PdoQueryBuilder ( $ connection , $ connectionId ) ; }
We re using pdo query builder .
58,534
protected function validateDestinationNameCopy ( ) { $ destination = $ this -> getSubmitted ( 'destination' ) ; if ( $ destination !== '' && preg_match ( '/^[\w-]+[\w-\/]*[\w-]+$|^[\w-]$/' , $ destination ) !== 1 ) { $ this -> setErrorInvalid ( 'destination' , $ this -> translation -> text ( 'Destination' ) ) ; } }
Validates a directory name
58,535
protected function validateDestinationDirectoryCopy ( ) { if ( $ this -> isError ( ) ) { return null ; } $ initial_path = $ this -> scanner -> getInitialPath ( true ) ; $ directory = gplcart_path_normalize ( "$initial_path/" . $ this -> getSubmitted ( 'destination' ) ) ; if ( ! file_exists ( $ directory ) && ! mkdir ( ...
Validates a destination directory
58,536
protected function validateDestinationExistanceCopy ( ) { if ( $ this -> isError ( ) ) { return null ; } $ destinations = array ( ) ; $ directory = $ this -> getSubmitted ( 'directory' ) ; $ error = null ; foreach ( ( array ) $ this -> getSubmitted ( 'files' ) as $ index => $ file ) { if ( $ file -> isDir ( ) && gplcar...
Validates file destinations
58,537
public function getGroupedApplications ( ) { $ organizations = $ this -> getEntityManager ( ) -> getRepository ( Organization :: class ) -> findAll ( ) ; $ applications = $ this -> findAll ( ) ; usort ( $ applications , $ this -> applicationSorter ( ) ) ; usort ( $ organizations , $ this -> organizationSorter ( ) ) ; $...
Get all applications sorted into organizations .
58,538
public function sendNotification ( $ scope , $ event , $ nid = null , $ theme = null , $ timestamp = null , $ uid = null ) { if ( $ this -> connector -> getURL ( ) === null ) { return 'Cannot find site URL from configuration.' ; } $ url = $ this -> connector -> getURL ( ) . self :: VERSION . '/notification' ; $ params ...
Send theme notification .
58,539
public function processModification ( $ siteGroupId = null ) { if ( $ this -> connector -> getURL ( ) === null ) { return 'Cannot find site URL from configuration.' ; } $ url = $ this -> connector -> getURL ( ) . self :: VERSION . '/process' ; $ params = [ 'sitegroup_id' => $ siteGroupId , ] ; $ response = $ this -> co...
Process theme modification .
58,540
public function setObjectPrototype ( $ objectPrototype ) { if ( ! is_object ( $ objectPrototype ) || ( ! $ objectPrototype instanceof ArrayObject && ! method_exists ( $ objectPrototype , 'exchangeArray' ) ) ) { throw new Exception \ InvalidArgumentException ( sprintf ( 'Object must be of type %s, or at least implement ...
Set the item object prototype
58,541
public function getConfiguredWriter ( $ fp , Configuration $ config = null ) { if ( ! $ config ) { $ config = $ this -> config ; } $ writerName = $ config -> getOption ( Configuration :: OPT_WRITER ) ; if ( ! $ writerName ) { throw new \ Exception ( 'Writer must be defined in config for getConfiguredWriter()' ) ; } $ w...
Get a writer configured using the default configuration or the one passed in .
58,542
public function getWriterByName ( $ fp , $ writerName ) { $ method = 'get' . $ writerName ; if ( method_exists ( $ this -> getWriterFactory ( ) , $ method ) ) { return $ this -> getWriterFactory ( ) -> $ method ( $ fp ) ; } else { throw new \ InvalidArgumentException ( 'writer not found: ' . $ writerName ) ; } }
Get a writer by it s name . The name is looked up in the writer factory prefixed with get .
58,543
public function editAction ( Image $ image , Request $ request ) { $ form = $ this -> container -> get ( 'form.factory' ) -> createNamed ( 'image' , ImageType :: class , $ image , array ( 'action' => $ this -> container -> get ( 'router' ) -> generate ( 'synapse_admin_image_edition' , array ( 'id' => $ image -> getId (...
Image edition action .
58,544
public function xhrFormatAction ( Image $ image , $ formatName , Request $ request ) { if ( ! $ format = $ this -> container -> get ( 'synapse.image_format.loader' ) -> retrieveOne ( array ( 'name' => $ formatName ) ) ) { return new JsonResponse ( array ( 'error' => 400 , 'error_message' => sprintf ( 'No format found w...
Image formating action through XmlHttpRequest .
58,545
public function renderJavascript ( FormView $ view , $ prototype = false ) { $ block = $ prototype ? 'js_prototype' : 'js' ; return $ this -> renderer -> searchAndRenderBlock ( $ view , $ block ) ; }
Render Function Form Javascript
58,546
public function confirmDestroy ( Message $ message ) { $ this -> authorize ( 'delete' , $ message ) ; return view ( 'laralum::pages.confirmation' , [ 'method' => 'DELETE' , 'message' => __ ( 'laralum_tickets::general.sure_del_message' , [ 'id' => $ message -> id ] ) , 'action' => route ( 'laralum::tickets.messages.dest...
View for cofirm delete message .
58,547
public function make ( $ key , $ params = [ ] ) { if ( $ this -> aliasExist ( $ key ) ) { return $ this -> make ( $ this -> aliases [ $ key ] , $ params ) ; } if ( is_callable ( $ key ) ) { return call_user_func_array ( $ key , $ this -> resolveCallback ( $ key , $ params ) ) ; } return $ this -> resolveClass ( $ key ,...
Resolved dependencies for a key .
58,548
public function need ( $ key ) { if ( ! isset ( $ this -> resolved [ $ key ] ) ) { return $ this -> make ( $ key ) ; } return $ this -> resolved [ $ key ] ; }
Get the resolved type for a key that already resolved by the container . If the key does not resolve at first resolved it then returns the resolved type .
58,549
public function bind ( $ key , $ value ) { if ( is_callable ( $ value ) ) { $ this -> aliases [ $ key ] = $ value ; } elseif ( is_object ( $ value ) ) { $ this -> resolved [ $ key ] = $ value ; } else { if ( class_exists ( $ value ) ) $ this -> aliases [ $ key ] = $ value ; else throw new Exception ( "Class [ $value ] ...
Bind a value for a key .
58,550
public function resolveCallback ( Closure $ callback , $ params = [ ] ) { $ reflectionParameter = new ReflectionFunction ( $ callback ) ; $ dependencies = $ reflectionParameter -> getParameters ( ) ; return $ this -> getDependencies ( $ dependencies , $ params ) ; }
Resolve dependencies for a callback .
58,551
public function resolveMethod ( $ class , $ method , $ params = [ ] , $ isRoute = false ) { $ reflectionMethod = new ReflectionMethod ( $ class , $ method ) ; $ dependencies = $ reflectionMethod -> getParameters ( ) ; return $ this -> getDependencies ( $ dependencies , $ params , $ isRoute ) ; }
Resolve dependencies for a method .
58,552
public function resolveClass ( $ name , $ params = [ ] ) { $ reflectionClass = new ReflectionClass ( $ name ) ; if ( ! $ reflectionClass -> isInstantiable ( ) ) { throw new Exception ( "The [ {$name} ] is not instantiable." ) ; } $ constructor = $ reflectionClass -> getConstructor ( ) ; if ( ! is_null ( $ constructor )...
Resolve dependencies for a class .
58,553
protected function getDependencies ( $ dependencies , $ params = [ ] , $ isRoute = false ) { $ resolving = [ ] ; foreach ( $ dependencies as $ dependency ) { if ( $ dependency -> isDefaultValueAvailable ( ) ) { $ resolving = $ this -> getDependencyDefaultValue ( $ dependency , $ params , $ resolving , $ isRoute ) ; } e...
Get all required dependencies .
58,554
public function has ( $ key ) { if ( array_key_exists ( $ key , $ this -> aliases ) || array_key_exists ( $ key , $ this -> resolved ) ) { return true ; } else { return false ; } }
Check a key is already exists .
58,555
protected function getDependencyDefaultValue ( $ dependency , $ params , $ resolving , $ isRoute ) { if ( $ isRoute ) { if ( isset ( $ params [ $ dependency -> name ] ) ) { $ resolving [ ] = $ params [ $ dependency -> name ] ; } else { $ resolving [ ] = $ dependency -> getDefaultValue ( ) ; } return $ resolving ; } els...
Get dependency default value .
58,556
public function cell ( $ value , array $ attributes = null ) { $ cell = new self ; $ cell -> setValue ( $ value ) ; if ( null !== $ attributes ) { $ cell -> setAttributes ( $ attributes ) ; } return $ cell ; }
Generates a new table cell
58,557
protected function _getIterator ( ) { if ( is_null ( $ this -> iterator ) ) { $ this -> iterator = $ this -> _resolveIterator ( $ this -> _getDataStore ( ) ) ; } return $ this -> iterator ; }
Retrieves the iterator of this instance s data store .
58,558
public function fmap ( \ Closure $ trans ) { return $ this -> flightcontrol ( ) -> newFDirectory ( $ this , function ( ) use ( $ trans ) { return array_map ( $ trans , $ this -> fcontents ( ) ) ; } ) ; }
As this is as functor we could map over it .
58,559
public function fold ( $ start_value , $ iteration ) { return $ this -> outer_fmap ( function ( $ contents ) use ( $ start_value , $ iteration ) { $ value = $ start_value ; foreach ( $ contents as $ content ) { $ value = $ iteration ( $ value , $ content ) ; } return $ value ; } ) ; }
Define the function to be iterated with and close this level of iteration .
58,560
public function fcontents ( ) { if ( $ this -> contents === null ) { $ cl = $ this -> contents_lazy ; $ this -> contents = $ cl ( ) ; } return $ this -> contents ; }
The contents of this directory .
58,561
public function checkSession ( ) { $ session_token = isset ( $ _COOKIE [ $ this -> cookie_name ] ) ? $ _COOKIE [ $ this -> cookie_name ] : ( isset ( $ _SERVER [ 'HTTP_AUTH_TOKEN' ] ) ? $ _SERVER [ 'HTTP_AUTH_TOKEN' ] : null ) ; if ( $ session_token ) { $ session_id = ( array ) $ this -> session_machine_ref_prefix ; $ s...
Check session - read & update cookies setup session state machine and register callbacks .
58,562
public function consumerId ( ) { if ( isset ( $ this -> session -> data [ 'customer_id' ] ) === true ) { return $ this -> session -> data [ 'customer_id' ] ; } return null ; }
- > NEW
58,563
protected function defaultDomain ( ) { if ( $ suffix = $ this -> parser -> getDomainSuffix ( ) ) { return strtolower ( camel_case ( basename ( getcwd ( ) ) ) ) . '.' . $ suffix ; } return '' ; }
Default domain .
58,564
public function _init ( ) { parent :: _init ( ) ; if ( ! $ model = $ this -> _model ) { throw new ConfigException ( "`'model'` option needs to be defined." ) ; } $ behavior = $ this ; $ model :: applyFilter ( 'save' , function ( $ self , $ params , $ chain ) use ( $ behavior ) { if ( $ behavior -> invokeMethod ( '_befo...
Initializer function called by the constructor unless the constructor init flag is set to false .
58,565
protected function _scope ( $ entity ) { $ scope = [ ] ; foreach ( $ this -> _config [ 'scope' ] as $ key => $ value ) { if ( is_numeric ( $ key ) ) { if ( isset ( $ entity , $ value ) ) { $ scope [ $ value ] = $ entity -> $ value ; } else { $ message = "The `{$value}` scope in not present in the entity." ; throw new U...
Setting a scope to an entity node .
58,566
protected function _insertParent ( $ entity ) { extract ( $ this -> _config ) ; $ parent = $ this -> _getById ( $ entity -> $ parent ) ; if ( $ parent ) { $ r = $ parent -> $ right ; $ this -> _update ( $ r , '+' , 2 , $ this -> _scope ( $ entity ) ) ; $ entity -> set ( [ $ left => $ r , $ right => $ r + 1 ] ) ; } }
Insert a parent
58,567
protected function _deleteFromTree ( $ entity ) { extract ( $ this -> _config ) ; $ span = 1 ; if ( $ entity -> $ right - $ entity -> $ left !== 1 ) { $ span = $ entity -> $ right - $ entity -> $ left ; $ model :: remove ( [ $ parent => $ entity -> data ( $ model :: key ( ) ) ] ) ; } $ this -> _update ( $ entity -> $ r...
Delete from tree
58,568
protected function _update ( $ rght , $ dir = '+' , $ span = 2 , $ scp = [ ] ) { extract ( $ this -> _config ) ; $ model :: update ( [ $ right => ( object ) ( $ right . $ dir . $ span ) ] , [ $ right => [ '>=' => $ rght ] ] + $ scp ) ; $ model :: update ( [ $ left => ( object ) ( $ left . $ dir . $ span ) ] , [ $ left ...
Update node indices
58,569
protected function _updateBetween ( $ range , $ dir = '+' , $ span = 2 , $ scp = [ ] , $ data = [ ] ) { extract ( $ this -> _config ) ; $ model :: update ( [ $ right => ( object ) ( $ right . $ dir . $ span ) ] , [ $ right => [ '>=' => $ range [ 'floor' ] , '<=' => $ range [ 'ceiling' ] ] ] + $ scp ) ; $ model :: updat...
Update node indices between
58,570
public function moveDown ( $ entity ) { extract ( $ this -> _config ) ; $ next = $ model :: find ( 'first' , [ 'conditions' => [ $ parent => $ entity -> $ parent , $ left => $ entity -> $ right + 1 ] ] ) ; if ( $ next !== null ) { $ spanToZero = $ entity -> $ right ; $ rangeX = [ 'floor' => $ entity -> $ left , 'ceilin...
Moves an element down in order
58,571
public function moveUp ( $ entity ) { extract ( $ this -> _config ) ; $ prev = $ model :: find ( 'first' , [ 'conditions' => [ $ parent => $ entity -> $ parent , $ right => $ entity -> $ left - 1 ] ] ) ; if ( ! $ prev ) { return true ; } $ spanToZero = $ entity -> $ right ; $ rangeX = [ 'floor' => $ entity -> $ left , ...
Moves an element up in order
58,572
protected function _getPosition ( $ entity , $ childrenCount = false ) { extract ( $ this -> _config ) ; $ parent = $ this -> _getById ( $ entity -> $ parent ) ; if ( $ entity -> $ left === ( $ parent -> $ left + 1 ) ) { return 0 ; } if ( ( $ entity -> $ right + 1 ) === $ parent -> $ right ) { if ( $ childrenCount === ...
Returns the current position number of an element at the same level where 0 is first position
58,573
public function queueStatus ( $ manager ) { $ socket = $ this -> getSocket ( $ manager ) ; $ stream = $ socket -> getStream ( ) ; $ stream -> send ( new QueueStatusRequest ( ) ) ; $ msg = $ stream -> read ( new TimeoutTimer ( 1500 ) ) ; if ( ! $ msg instanceof QueueStatusResponse ) { throw new RuntimeException ( 'Inval...
Requests the queue status .
58,574
public function optimize ( stdClass $ data ) { $ data -> formValidationName = $ data -> serviceName . 'Validator' ; $ data -> formValidationNameSpace = str_replace ( '\\http\\controllers' , '\\validators' , $ data -> controllerNamespace ) ; $ data -> formValidationDestination = str_replace ( '/http/controllers' , '/val...
Optimizing configuration for form creation
58,575
public function generate ( stdClass $ data ) { $ files = [ ] ; $ this -> createFileFromTemplate ( [ "destination" => $ data -> formValidationDestination , "templateDestination" => __DIR__ . '/../templates/service/validator.hctpl' , "content" => [ "formValidationNameSpace" => $ data -> formValidationNameSpace , "formVal...
Generating validator files
58,576
public static function getConsoleDir ( ) { $ rootDir = sprintf ( '%s/../../../../../../../..' , __DIR__ ) ; $ paths = [ 'bin' , 'app' , ] ; foreach ( $ paths as $ path ) { $ fullPath = sprintf ( '%s/%s' , $ rootDir , $ path ) ; if ( true === is_dir ( $ fullPath ) && true === file_exists ( sprintf ( '%s/console' , $ ful...
Get Console Dir
58,577
public static function start ( $ name ) { $ status = self :: status ( $ name ) ; if ( $ status == self :: STOPPED ) { return self :: runCommand ( 'start' , [ $ name ] ) -> isSuccessful ( ) ; } return $ status == Machine :: RUNNING ; }
Start a machine .
58,578
public static function getEnv ( $ name ) { $ envs = [ ] ; $ output = self :: runCommand ( 'env' , [ $ name ] ) ; if ( trim ( $ output -> getOutput ( ) ) == "$name is not running. Please start this with docker-machine start $name" ) { throw new \ Exception ( 'Docker machine has not been started yet.' ) ; } $ envOutput =...
Returns an array of the environment for the Docker client .
58,579
public function buildView ( FormView $ view , FormInterface $ form , array $ options ) { $ parentData = $ form -> getParent ( ) -> getData ( ) ; if ( $ parentData !== null ) { $ accessor = PropertyAccess :: getPropertyAccessor ( ) ; $ url = $ accessor -> getValue ( $ parentData , $ options [ 'image_path' ] ) ; if ( $ u...
Pass the image url to the view
58,580
public function index ( $ area = null , $ locale = null ) { return $ this -> processor -> index ( $ this , ! is_null ( $ area ) ? $ area : area ( ) , $ locale ) ; }
index default action
58,581
public function setApplication ( ApplicationContract $ application = null ) { $ this -> application = $ application ; if ( $ application ) { $ this -> setHelperSet ( $ application -> getHelperSet ( ) ) ; } else { $ this -> helperSet = null ; } }
Sets the ApplicationContract instance .
58,582
public function Subscriber_Update ( $ user_id , $ subscription_state , $ division , $ attributes , $ allow_resubscribe = true , $ append = false ) { $ data = $ this -> _package_subscriber_elements ( $ subscription_state , $ division , $ attributes ) ; if ( is_null ( $ allow_resubscribe ) === false ) { $ data -> allowRe...
Update an existing subscriber .
58,583
public function Subscriber_Get_Id ( $ attributes ) { try { $ ret = $ this -> Subscriber_Lookup ( $ attributes ) ; $ uri = $ ret -> uri ; $ id = ( int ) substr ( strrchr ( $ uri , '/' ) , 1 ) ; } catch ( \ Exception $ e ) { if ( $ e -> getCode ( ) === 404 ) { $ id = false ; } else { throw $ e ; } } return $ id ; }
Look up the id of an existing subscriber .
58,584
public function Subscriber_Retrieve ( $ attributes , $ division ) { $ ret = false ; $ subscriberId = $ this -> Subscriber_Get_Id ( $ attributes ) ; if ( $ subscriberId !== false ) { $ ret = $ this -> _call_api ( 'get' , "{$this->_url}/subscribers/$subscriberId" , array ( 'division' => $ division ) ) ; } return $ ret ; ...
Retrieve all information about a subscriber including attributes division subscription status etc .
58,585
public function Subscribe_And_Send ( $ subscription_state , $ division , $ attributes , $ allow_resubscribe , $ masterId ) { $ data = new \ stdClass ( ) ; $ subscriber = $ this -> _package_subscriber_elements ( $ subscription_state , $ division , $ attributes ) ; if ( is_bool ( $ allow_resubscribe ) === true ) { $ subs...
Subscribe and send
58,586
public function Status_Get ( $ guid , $ nowait = true ) { if ( $ nowait === true ) { $ ret = $ this -> _call_api ( 'get' , "{$this->_url}/statusNoWait/$guid" , array ( ) ) ; } else { do { $ ret = $ this -> _call_api ( 'get' , "{$this->_url}/status/$guid" , array ( ) ) ; switch ( $ ret -> statusCode ) { case 'COMPLETED'...
Get the status of an outstanding request .
58,587
public function Master_Create ( $ envelope , $ targeting , $ scheduling ) { $ ret = false ; $ data = $ this -> _package_master_elements ( $ envelope , $ targeting , $ scheduling ) ; if ( $ data !== false ) { $ ret = $ this -> _call_api ( 'post' , "{$this->_url}/masters" , $ data ) ; } return $ ret ; }
Create a new Master
58,588
public function Master_Update ( $ masterId , $ envelope , $ targeting , $ scheduling ) { $ ret = false ; $ data = $ this -> _package_master_elements ( $ envelope , $ targeting , $ scheduling ) ; if ( $ data !== false ) { $ ret = $ this -> _call_api ( 'put' , "{$this->_url}/masters/$masterId" , $ data ) ; } return $ ret...
Update an existing Master
58,589
public function Master_Get ( $ masterId ) { $ ret = false ; if ( is_int ( $ masterId ) === true ) { try { $ ret = $ this -> _call_api ( 'get' , "{$this->_url}/masters/$masterId" , array ( ) ) ; $ ret = $ this -> _Type_Safe_Yesmail_Master ( $ ret ) ; $ ret -> id = ( int ) $ masterId ; } catch ( \ Exception $ e ) { if ( ...
Get an existing Master
58,590
public function Master_Get_By_Name ( $ masterName ) { $ ret = false ; if ( is_string ( $ masterName ) === true ) { $ pageSize = 50 ; $ begin = 1 ; $ end = $ pageSize ; $ filter = 'active' ; $ more = true ; while ( $ more ) { $ res = $ this -> _call_api ( 'get' , "{$this->_url}/masters" , array ( 'begin' => $ begin , 'e...
Get an existing Master by name
58,591
public function Master_Post_Run_Count ( $ masterId ) { $ ret = false ; if ( is_int ( $ masterId ) === true ) { $ ret = $ this -> _call_api ( 'post' , "{$this->_url}/masters/$masterId/RUN/countData" , array ( ) ) ; } return $ ret ; }
Submit the master s ID and RUN the eAPI service URL to request the the count job for a specific master Run this before doing Master_Post_Run_Count
58,592
public function Master_Get_Count ( $ masterId ) { $ ret = false ; if ( is_int ( $ masterId ) === true ) { do { $ ret = $ this -> _call_api ( 'get' , "{$this->_url}/masters/$masterId/countData" , array ( ) ) ; sleep ( 15 ) ; } while ( ! $ this -> Status_Is_Completed ( $ ret -> status ) ) ; } return $ ret ; }
Get the number of active subscribers based on master s id . Run this after doing Master_Post_Run_Count
58,593
public function Master_Assets_Get ( $ masterId ) { $ ret = false ; if ( is_int ( $ masterId ) === true ) { $ ret = $ this -> _call_api ( 'get' , "{$this->_url}/masters/$masterId/assets" , array ( ) ) ; } return $ ret ; }
Get the assets that belong to a Master
58,594
public function Master_Preview ( $ masterId , $ contentType , $ distributionList , $ userId , $ emails ) { $ ret = false ; $ contentTypes = array ( 'HTML' , 'PLAIN' , 'BOTH' , 'USERPREFERENCE' ) ; if ( in_array ( $ contentType , $ contentTypes ) === true ) { if ( is_string ( $ distributionList ) === true xor ( is_int (...
Provides a way to preview a message by sending it to a group of email addresses following the same semantics as the preview functionality within the Enterprise Application .
58,595
public function ListManagement_Get_Lists ( $ type ) { $ ret = false ; if ( is_string ( $ type ) === true ) { $ type = rawurlencode ( $ type ) ; $ ret = $ this -> _call_api ( 'get' , "{$this->_url}/lists/$type" , array ( ) ) ; } return $ ret ; }
Get a list of lists given a list type
58,596
public function ListManagement_Update_List ( $ modifyList ) { $ ret = false ; if ( $ modifyList instanceof \ Yesmail \ YesmailListManagementModifyList && $ modifyList -> is_valid ( ) === true ) { $ name = rawurlencode ( $ modifyList -> name ) ; $ type = rawurlencode ( $ modifyList -> type ) ; $ ret = $ this -> _call_ap...
Either remove or append the subscribers identified in the payload . For subscriberIds and emails that are submitted as part of a request that cannot be mapped back to existing subscriber data are ignored and a total count of the number added users is returned as part of the status message .
58,597
public function ListManagement_Create_List ( $ modifyList ) { $ ret = false ; if ( $ modifyList instanceof \ Yesmail \ YesmailListManagementModifyList && $ modifyList -> is_valid ( ) === true ) { $ ret = $ this -> _call_api ( 'post' , "{$this->_url}/lists/{$modifyList->type}" , $ modifyList ) ; } return $ ret ; }
Create a new list of the given type
58,598
protected function _package_master_elements ( $ envelope , $ targeting , $ scheduling ) { $ ret = false ; if ( $ envelope instanceof \ Yesmail \ YesmailMasterEnvelope && $ envelope -> is_valid ( ) === true ) { $ ret = new \ stdClass ( ) ; $ ret -> envelope = $ envelope ; if ( $ targeting instanceof \ Yesmail \ YesmailM...
Package a Master s envelope targeting and scheduling for sending in a request
58,599
protected function _call_api ( $ method , $ url , $ params ) { $ raw_response = $ this -> _client -> $ method ( $ url , $ params ) ; $ info = $ this -> _client -> get_info ( ) ; if ( $ info [ 'http_code' ] != null ) { switch ( $ info [ "http_code" ] ) { case 200 : case 202 : $ response = json_decode ( $ raw_response ) ...
Make a call to the Yesmail API