idx
int64
0
60.3k
question
stringlengths
92
4.62k
target
stringlengths
7
635
15,800
public function handleProviderCallback ( $ provider ) { try { $ user = $ this -> socialProvider -> driver ( $ provider ) -> user ( ) ; } catch ( Exception $ e ) { return Redirect :: to ( 'auth/' . $ provider ) ; } $ this -> auth -> login ( $ this -> users -> provider ( $ provider ) -> findOrCreateUser ( $ user ) , true...
Obtain the user information from social network .
15,801
public function getAttributeFromMeta ( $ key ) { if ( ! $ key ) { return ; } if ( method_exists ( self :: class , $ key ) ) { return ; } $ meta = json_decode ( $ this -> getAttribute ( 'meta' ) ) ; if ( isset ( $ meta -> $ key ) ) { return $ meta -> $ key ; } $ user = $ meta -> user ; if ( isset ( $ user -> $ key ) ) {...
Get an attribute from the meta field .
15,802
private function registerSocialProviderManager ( ) { $ this -> app -> singleton ( \ Acacha \ LaravelSocial \ Contracts \ Factory :: class , function ( $ app ) { return new SocialProviderManager ( $ app ) ; } ) ; }
Register social provider manager .
15,803
private function registerConfigureSocialServicesManager ( ) { $ this -> app -> singleton ( \ Acacha \ LaravelSocial \ Contracts \ ConfigureSocialServicesFactory :: class , function ( $ app ) { return new ConfigureSocialServicesManager ( $ app ) ; } ) ; }
Register configure social services manager .
15,804
private function registerOAuthApp ( ) { $ oauth = new OAuthApp ( ) ; $ this -> app -> instance ( \ Acacha \ LaravelSocial \ Services \ OAuthApp :: class , $ oauth ) ; }
Register OAuth App .
15,805
private function registerLaravelSocialiteService ( ) { $ this -> app -> bind ( \ Acacha \ LaravelSocial \ Services \ LaravelSocialiteService :: class , function ( $ app ) { return new LaravelSocialiteService ( new \ Acacha \ Filesystem \ Compiler \ StubFileCompiler ( ) , new \ Acacha \ Filesystem \ Filesystem ( ) ) ; }...
Register Laravel Socialite service .
15,806
private function registerSocialProviders ( ) { foreach ( $ this -> enabled as $ provider ) { $ providerClass = $ provider . 'SocialProvider' ; $ this -> app -> bind ( $ providerClass , function ( $ app ) use ( $ providerClass ) { $ providerClassWithNamespace = 'Acacha\LaravelSocial\SocialProviders\\' . $ providerClass ...
Register social providers .
15,807
protected function showOptionalAdditionalInfo ( ) { $ this -> command -> info ( 'See step by step tutorial at:' ) ; $ url = 'https://blog.damirmiladinov.com/laravel/laravel-5.2-socialite-google-login.html' ; $ this -> command -> info ( ' <question>' . $ url . '</question>' ) ; $ this -> command -> info ( 'Remember to e...
Show optional additional info .
15,808
public function getListCosign ( array $ options = array ( ) ) { $ params = $ options ; $ this -> client = $ this -> setClientSoap ( $ this -> URL_WSDL_COSIGN ) ; $ result = $ this -> client -> call ( 'getListCosign' , $ params , self :: API_NAMESPACE , self :: API_NAMESPACE , $ this -> createHeaders ( ) ) ; if ( $ this...
fonction permettant d obtenir le listing des co - signatures .
15,809
public function updateCosigner ( $ token , array $ signerData ) { $ expectedData = array_intersect_key ( $ signerData , array ( 'firstName' => '' , 'lastName' => '' , 'mail' => '' , 'phone' => '' , 'proofLevel' => '' , 'authenticationMode' => '' ) ) ; if ( count ( $ expectedData ) === 0 ) { throw new \ Exception ( 'Dat...
Modifie les informations d un signataire
15,810
public function archive ( $ fileB64 , $ fileName , $ subject , $ date2 , $ type , $ author , $ comment , $ ref , $ amount , $ tagsLst ) { $ this -> client = $ this -> setClientSoap ( $ this -> URL_WSDL_ARCHIVE ) ; $ fileParam = array ( 'content' => $ fileB64 , 'fileName' => $ fileName , 'subject' => $ subject , 'date1'...
Fonction permettant d archiver un ensemble de documents .
15,811
private function parseParametersFile ( $ pathParametersFile ) { $ this -> parameters = parse_ini_file ( $ pathParametersFile , true ) ; if ( isset ( $ this -> parameters [ 'environment' ] ) ) { $ this -> setEnvironment ( $ this -> parameters [ 'environment' ] ) ; } if ( isset ( $ this -> parameters [ 'login' ] ) ) { $ ...
Parse le fichier de configuration .
15,812
protected function hasRequiredAbility ( $ user , $ ability = null , $ model = null ) { if ( ! $ user ) { return false ; } if ( is_null ( $ ability ) ) { return true ; } if ( is_null ( $ model ) ) { return $ user -> can ( $ ability ) ; } return $ user -> can ( $ ability , $ model ) ; }
Determine if the currently logged in use has the given ability .
15,813
protected function handleUnauthorizedRequest ( $ request , $ ability = null , $ model = null ) { if ( $ request -> ajax ( ) ) { return response ( 'Forbidden.' , Response :: HTTP_FORBIDDEN ) ; } if ( ! $ request -> user ( ) ) { return redirect ( ) -> guest ( config ( 'laravel-authorize.login_url' ) ) ; } throw new HttpE...
Handle the unauthorized request .
15,814
private function getMessages ( ) { $ messages = [ ] ; $ content = '' ; fseek ( $ this -> fh , 0 ) ; while ( ! feof ( $ this -> fh ) ) { $ content .= fgets ( $ this -> fh ) ; } if ( $ content ) { $ messages = json_decode ( $ content , true ) ; } return $ messages ; }
Get action messages from log file
15,815
private function save ( array $ messages ) { fseek ( $ this -> fh , 0 ) ; fwrite ( $ this -> fh , json_encode ( $ messages ) ) ; }
Save action messages to file
15,816
private function getCollection ( $ constraint ) { $ rRule = new RecurrRule ( $ this -> getRrule ( ) , $ this -> getStartDate ( ) ) ; $ rRuleTransformer = new ArrayTransformer ( ) ; return $ rRuleTransformer -> transform ( $ rRule , $ constraint ) ; }
Get recurrence collection by given constraint
15,817
private function hashCallable ( $ callable ) { $ result = '' ; if ( is_string ( $ callable ) ) { $ result = $ callable ; } else if ( is_array ( $ callable ) ) { $ callableEntity = array_shift ( $ callable ) ; $ result = is_object ( $ callableEntity ) ? get_class ( $ callableEntity ) : serialize ( $ callableEntity ) ; $...
Get unique hash from callable
15,818
protected function sortActions ( \ ArrayIterator $ iterator ) { $ iterator -> uasort ( function ( $ a , $ b ) { return $ a -> getTime ( ) -> getTimestamp ( ) - $ b -> getTime ( ) -> getTimestamp ( ) ; } ) ; }
Sort actions by execution time
15,819
private function getSeconds ( DateInterval $ interval ) { $ date = new \ DateTimeImmutable ( 'now' , new \ DateTimeZone ( 'UTC' ) ) ; $ date2 = $ date -> add ( $ interval ) ; return $ date2 -> getTimestamp ( ) - $ date -> getTimestamp ( ) ; }
Get amount of seconds in date interval
15,820
public function canAtLeast ( array $ permissions ) { $ can = false ; if ( auth ( ) -> check ( ) ) { foreach ( $ this -> roles as $ role ) { if ( $ role -> canAtLeast ( $ permissions ) ) { $ can = true ; } } } else { $ guest = Role :: whereSlug ( 'guest' ) -> first ( ) ; if ( $ guest ) { return $ guest -> canAtLeast ( $...
Check if user has at least one of the given permissions
15,821
public function hasRole ( $ role ) { if ( is_string ( $ role ) ) { return $ this -> roles -> contains ( 'slug' , $ role ) ; } if ( is_array ( $ role ) ) { $ roles = $ this -> getRoleSlugs ( ) ; $ intersection = array_intersect ( $ roles , ( array ) $ role ) ; $ intersectionCount = count ( $ intersection ) ; return ( $ ...
Check if user has the given role .
15,822
public function attachRoleBySlug ( $ slug ) { $ role = Role :: where ( 'slug' , $ slug ) -> first ( ) ; return $ this -> attachRole ( $ role ) ; }
Attach a role to user using slug .
15,823
public function scopeHavingRoles ( $ query , array $ roles ) { return $ query -> whereExists ( function ( $ query ) use ( $ roles ) { $ query -> selectRaw ( '1' ) -> from ( 'role_user' ) -> whereRaw ( 'role_user.user_id = users.id' ) -> whereIn ( 'role_id' , $ roles ) ; } ) ; }
Query scope for user having the given roles .
15,824
public function revokeRoleBySlug ( $ slug ) { $ role = Role :: where ( 'slug' , $ slug ) -> first ( ) ; return $ this -> roles ( ) -> detach ( $ role ) ; }
Revokes the given role from the user using slug .
15,825
public function getPermissions ( ) { $ permissions = [ [ ] , [ ] ] ; foreach ( $ this -> roles as $ role ) { $ permissions [ ] = $ role -> getPermissions ( ) ; } return call_user_func_array ( 'array_merge' , $ permissions ) ; }
Get all user role permissions .
15,826
public static function createResource ( $ resource , $ system = false ) { $ group = ucfirst ( $ resource ) ; $ slug = strtolower ( $ group ) ; $ permissions = [ [ 'slug' => $ slug . '.view' , 'resource' => $ group , 'name' => 'View ' . $ group , 'system' => $ system , ] , [ 'slug' => $ slug . '.create' , 'resource' => ...
Create a permissions for a resource .
15,827
public function assignPermission ( $ permissionId = null ) { $ permissions = $ this -> permissions ; if ( ! $ permissions -> contains ( $ permissionId ) ) { $ this -> permissions ( ) -> attach ( $ permissionId ) ; return true ; } return false ; }
Assigns the given permission to the role .
15,828
public function canAtLeast ( array $ permission = [ ] ) { $ permissions = $ this -> getPermissions ( ) ; $ intersection = array_intersect ( $ permissions , $ permission ) ; $ intersectionCount = count ( $ intersection ) ; return ( $ intersectionCount > 0 ) ? true : false ; }
Check if the role has at least one of the given permissions .
15,829
public function handle ( $ role ) { if ( $ this -> auth -> check ( ) ) { return $ this -> auth -> user ( ) -> isRole ( $ role ) ; } else { if ( $ role === 'guest' ) { return true ; } } return false ; }
Is Role blade directive compiler .
15,830
public function handle ( $ roles ) { if ( $ this -> auth -> check ( ) ) { return $ this -> auth -> user ( ) -> hasRole ( $ roles ) ; } return false ; }
Handle hasRole directive .
15,831
public function register ( ) { $ this -> getPermissions ( ) -> each ( function ( Permission $ permission ) { $ ability = $ permission -> slug ; $ policy = function ( $ user ) use ( $ permission ) { return $ user -> hasRole ( $ permission -> roles ) ; } ; if ( Str :: contains ( $ permission -> slug , '@' ) ) { $ policy ...
Handle permission gate registration .
15,832
protected function getPermissions ( ) { try { return $ this -> cache -> rememberForever ( 'permissions.policies' , function ( ) { return Permission :: with ( 'roles' ) -> get ( ) ; } ) ; } catch ( \ Exception $ exception ) { $ this -> cache -> forget ( 'permissions.policies' ) ; return new Collection ; } }
Get all permissions .
15,833
protected function registerCacheListener ( ) { Permission :: saved ( function ( ) { $ this -> app [ 'cache.store' ] -> forget ( 'permissions.policies' ) ; } ) ; Permission :: deleted ( function ( ) { $ this -> app [ 'cache.store' ] -> forget ( 'permissions.policies' ) ; } ) ; Role :: saved ( function ( ) { $ this -> ap...
Register ACL models cache listener .
15,834
protected function registerBladeDirectives ( ) { $ blade = $ this -> app [ 'blade.compiler' ] ; $ blade -> directive ( 'canAtLeast' , function ( $ expression ) { return "<?php if (app('laravel-acl.directives.canAtLeast')->handle({$expression})): ?>" ; } ) ; $ blade -> directive ( 'endCanAtLeast' , function ( $ expressi...
Register custom blade directives .
15,835
public function handle ( $ permissions ) { if ( $ this -> auth -> check ( ) ) { return $ this -> auth -> user ( ) -> canAtLeast ( ( array ) $ permissions ) ; } else { $ guest = Role :: whereSlug ( 'guest' ) -> first ( ) ; if ( $ guest ) { return $ guest -> canAtLeast ( ( array ) $ permissions ) ; } } return false ; }
Can at least blade directive compiler .
15,836
public function bookmarkedJobs ( ) { $ query = self :: _URL_API . '/v1/people/~/job-bookmarks' ; $ response = $ this -> fetch ( 'GET' , $ query ) ; return $ this -> checkResponse ( 200 , $ response ) ; }
Get list of jobs you have bookmarked .
15,837
private function checkResponse ( $ http_code_required , $ response ) { if ( is_array ( $ http_code_required ) ) { array_walk ( $ http_code_required , function ( $ value , $ key ) { if ( ! is_int ( $ value ) ) { throw new LinkedInException ( 'LinkedIn->checkResponse(): $http_code_required must be an integer or an array ...
Used to check whether a response LinkedIn object has the required http_code or not and returns an appropriate LinkedIn object .
15,838
public function closeJob ( $ jid ) { if ( ! is_string ( $ jid ) ) { throw new LinkedInException ( 'LinkedIn->closeJob(): bad data passed, $jid must be of string value.' ) ; } $ query = self :: _URL_API . '/v1/jobs/partner-job-id=' . trim ( $ jid ) ; $ response = $ this -> fetch ( 'DELETE' , $ query ) ; return $ this ->...
Close a job .
15,839
public function comment ( $ uid , $ comment ) { if ( ! is_string ( $ uid ) ) { throw new LinkedInException ( 'LinkedIn->comment(): bad data passed, $uid must be of type string.' ) ; } if ( ! is_string ( $ comment ) ) { throw new LinkedInException ( 'LinkedIn->comment(): bad data passed, $comment must be a non-zero leng...
Share comment posting method .
15,840
public function comments ( $ uid ) { if ( ! is_string ( $ uid ) ) { throw new LinkedInException ( 'LinkedIn->comments(): bad data passed, $uid must be of type string.' ) ; } $ query = self :: _URL_API . '/v1/people/~/network/updates/key=' . $ uid . '/update-comments' ; $ response = $ this -> fetch ( 'GET' , $ query ) ;...
Share comment retrieval .
15,841
public function company ( $ options , $ by_email = FALSE ) { if ( ! is_string ( $ options ) ) { throw new LinkedInException ( 'LinkedIn->company(): bad data passed, $options must be of type string.' ) ; } if ( ! is_bool ( $ by_email ) ) { throw new LinkedInException ( 'LinkedIn->company(): bad data passed, $by_email mu...
Company profile retrieval function .
15,842
public function companyProducts ( $ cid , $ options = '' ) { if ( ! is_string ( $ cid ) ) { throw new LinkedInException ( 'LinkedIn->companyProducts(): bad data passed, $cid must be of type string.' ) ; } if ( ! is_string ( $ options ) ) { throw new LinkedInException ( 'LinkedIn->companyProducts(): bad data passed, $op...
Company products and their associated recommendations .
15,843
public function createPost ( $ gid , $ title , $ summary = '' ) { if ( ! is_string ( $ gid ) ) { throw new LinkedInException ( 'LinkedIn->createPost(): bad data passed, $gid must be of type string.' ) ; } if ( ! is_string ( $ title ) || empty ( $ title ) ) { throw new LinkedInException ( 'LinkedIn->createPost(): bad da...
This creates a post in the specified group with the specified title and specified summary .
15,844
public function deletePost ( $ pid ) { if ( ! is_string ( $ pid ) ) { throw new LinkedInException ( 'LinkedIn->deletePost(): bad data passed, $pid must be of type string' ) ; } $ query = self :: _URL_API . '/v1/posts/' . trim ( $ pid ) ; $ response = $ this -> fetch ( 'DELETE' , $ query ) ; return $ this -> checkRespon...
This deletes the specified post if you are the owner or moderator that post . Otherwise it just flags the post as inappropriate .
15,845
public function editJob ( $ jid , $ xml ) { if ( ! is_string ( $ jid ) ) { throw new LinkedInException ( 'LinkedIn->editJob(): bad data passed, $jid must be of string value.' ) ; } if ( is_string ( $ xml ) ) { $ xml = trim ( stripslashes ( $ xml ) ) ; } else { throw new LinkedInException ( 'LinkedIn->editJob(): bad dat...
Edit a job .
15,846
public function flagPost ( $ pid , $ type ) { if ( ! is_string ( $ pid ) ) { throw new LinkedInException ( 'LinkedIn->flagPost(): bad data passed, $pid must be of type string' ) ; } if ( ! is_string ( $ type ) ) { throw new LinkedInException ( 'LinkedIn->flagPost(): bad data passed, $like must be of type string' ) ; } ...
This flags a specified post as specified by type .
15,847
public function followedCompanies ( ) { $ query = self :: _URL_API . '/v1/people/~/following/companies' ; $ response = $ this -> fetch ( 'GET' , $ query ) ; return $ this -> checkResponse ( 200 , $ response ) ; }
Get list of companies you follow .
15,848
public function groupPostComments ( $ pid , $ options = '' ) { if ( ! is_string ( $ pid ) ) { throw new LinkedInException ( 'LinkedIn->groupPostComments(): bad data passed, $pid must be of type string.' ) ; } if ( ! is_string ( $ options ) ) { throw new LinkedInException ( 'LinkedIn->groupPostComments(): bad data passe...
This returns all the comments made on the specified post within a group .
15,849
public function groupPosts ( $ gid , $ options = '' ) { if ( ! is_string ( $ gid ) ) { throw new LinkedInException ( 'LinkedIn->groupPosts(): bad data passed, $gid must be of type string' ) ; } if ( ! is_string ( $ options ) ) { throw new LinkedInException ( 'LinkedIn->groupPosts(): bad data passed, $options must be of...
This returns all the posts within a group .
15,850
public static function isId ( $ id ) { if ( ! is_string ( $ id ) ) { throw new LinkedInException ( 'LinkedIn->isId(): bad data passed, $id must be of type string.' ) ; } $ pattern = '/^[a-z0-9_\-]{10}$/i' ; if ( $ match = preg_match ( $ pattern , $ id ) ) { $ return_data = TRUE ; } else { $ return_data = FALSE ; } retu...
LinkedIn ID validation .
15,851
public static function isThrottled ( $ response ) { $ return_data = FALSE ; if ( ! empty ( $ response ) && is_string ( $ response ) ) { $ temp_response = self :: xmlToArray ( $ response ) ; if ( $ temp_response !== FALSE ) { if ( array_key_exists ( 'error' , $ temp_response ) && ( $ temp_response [ 'error' ] [ 'childre...
Throttling check .
15,852
public function job ( $ jid , $ options = '' ) { if ( ! is_string ( $ jid ) ) { throw new LinkedInException ( 'LinkedIn->job(): bad data passed, $jid must be of type string.' ) ; } if ( ! is_string ( $ options ) ) { throw new LinkedInException ( 'LinkedIn->job(): bad data passed, $options must be of type string.' ) ; }...
Job posting detail info retrieval function .
15,853
public function message ( $ recipients , $ subject , $ body , $ copy_self = FALSE ) { if ( ! empty ( $ subject ) && is_string ( $ subject ) ) { $ subject = trim ( strip_tags ( stripslashes ( $ subject ) ) ) ; } else { throw new LinkedInException ( 'LinkedIn->message(): bad data passed, $subject must be of type string.'...
Connection messaging method .
15,854
public function raw ( $ method , $ url , $ body = NULL ) { if ( ! is_string ( $ method ) ) { throw new LinkedInException ( 'LinkedIn->raw(): bad data passed, $method must be of string value.' ) ; } if ( ! is_string ( $ url ) ) { throw new LinkedInException ( 'LinkedIn->raw(): bad data passed, $url must be of string val...
Manual API call method allowing for support for un - implemented API functionality to be supported .
15,855
public function renewJob ( $ jid , $ cid ) { if ( ! is_string ( $ jid ) ) { throw new LinkedInException ( 'LinkedIn->renewJob(): bad data passed, $jid must be of string value.' ) ; } if ( ! is_string ( $ cid ) ) { throw new LinkedInException ( 'LinkedIn->renewJob(): bad data passed, $cid must be of string value.' ) ; }...
Renew a job .
15,856
public function retrieveTokenAccess ( $ token , $ secret , $ verifier ) { if ( ! is_string ( $ token ) || ! is_string ( $ secret ) || ! is_string ( $ verifier ) ) { throw new LinkedInException ( 'LinkedIn->retrieveTokenAccess(): bad data passed, string type is required for $token, $secret and $verifier.' ) ; } $ this -...
Access token retrieval .
15,857
public function retrieveTokenRequest ( array $ scope = array ( ) ) { $ parameters = array ( 'oauth_callback' => $ this -> getCallbackUrl ( ) ) ; $ requestUrl = self :: _URL_REQUEST ; if ( ! empty ( $ scope ) ) { $ requestUrl .= '?scope=' . implode ( '+' , $ scope ) ; } $ response = $ this -> fetch ( self :: _METHOD_TOK...
Request token retrieval .
15,858
public function searchCompanies ( $ options = '' ) { if ( ! is_string ( $ options ) ) { throw new LinkedInException ( 'LinkedIn->searchCompanies(): bad data passed, $options must be of type string.' ) ; } $ query = self :: _URL_API . '/v1/company-search' . trim ( $ options ) ; $ response = $ this -> fetch ( 'GET' , $ q...
Company search .
15,859
public function searchPeople ( $ options = NULL ) { if ( ! is_null ( $ options ) && ! is_string ( $ options ) ) { throw new LinkedInException ( 'LinkedIn->search(): bad data passed, $options must be of type string.' ) ; } $ query = self :: _URL_API . '/v1/people-search' . trim ( $ options ) ; $ response = $ this -> fet...
General people search function .
15,860
public function setGroupSettings ( $ gid , $ xml ) { if ( ! is_string ( $ gid ) ) { throw new LinkedInException ( 'LinkedIn->setGroupSettings(): bad data passed, $token_access should be in array format.' ) ; } if ( ! is_string ( $ xml ) ) { throw new LinkedInException ( 'LinkedIn->setGroupSettings(): bad data passed, $...
This sets the group settings of the specified group .
15,861
public function setToken ( $ token ) { if ( ! is_null ( $ token ) && ! is_array ( $ token ) ) { throw new LinkedInException ( 'LinkedIn->setToken(): bad data passed, $token_access should be in array format.' ) ; } $ this -> token = $ token ; }
Set the token property .
15,862
public function statistics ( ) { $ query = self :: _URL_API . '/v1/people/~/network/network-stats' ; $ response = $ this -> fetch ( 'GET' , $ query ) ; return $ this -> checkResponse ( 200 , $ response ) ; }
Network statistics .
15,863
public function suggestedCompanies ( ) { $ query = self :: _URL_API . '/v1/people/~/suggestions/to-follow/companies' ; $ response = $ this -> fetch ( 'GET' , $ query ) ; return $ this -> checkResponse ( 200 , $ response ) ; }
Companies you may want to follow .
15,864
public function unfollowCompany ( $ cid ) { if ( ! is_string ( $ cid ) ) { throw new LinkedInException ( 'LinkedIn->unfollowCompany(): bad data passed, $cid must be of string value.' ) ; } $ query = self :: _URL_API . '/v1/people/~/following/companies/id=' . trim ( $ cid ) ; $ response = $ this -> fetch ( 'DELETE' , $ ...
Unfollow a company .
15,865
public function unlike ( $ uid ) { if ( ! is_string ( $ uid ) ) { throw new LinkedInException ( 'LinkedIn->unlike(): bad data passed, $uid must be of type string.' ) ; } $ data = '<?xml version="1.0" encoding="UTF-8"?> <is-liked>false</is-liked>' ; $ query = self :: _URL_API . '/v1/people/~/network/updates/ke...
Unlike a network update .
15,866
public function updateNetwork ( $ update ) { if ( ! is_string ( $ update ) ) { throw new LinkedInException ( 'LinkedIn->updateNetwork(): bad data passed, $update must be a non-zero length string.' ) ; } $ response = self :: profile ( '~:(first-name,last-name,site-standard-profile-request)' ) ; if ( $ response [ 'succes...
Post network update .
15,867
public function updates ( $ options = NULL , $ id = NULL ) { if ( ! is_null ( $ options ) && ! is_string ( $ options ) ) { throw new LinkedInException ( 'LinkedIn->updates(): bad data passed, $options must be of type string.' ) ; } if ( ! is_null ( $ id ) && ! is_string ( $ id ) ) { throw new LinkedInException ( 'Linke...
General network update retrieval function .
15,868
public static function xmlToArray ( $ xml ) { if ( ! is_string ( $ xml ) ) { throw new LinkedInException ( 'LinkedIn->xmlToArray(): bad data passed, $xml must be a non-zero length string.' ) ; } $ parser = xml_parser_create ( ) ; xml_parser_set_option ( $ parser , XML_OPTION_CASE_FOLDING , 0 ) ; xml_parser_set_option (...
Converts passed XML data to an array .
15,869
public function authorizePermissionResource ( $ resource , array $ options = [ ] ) { $ permissions = $ this -> resourcePermissionMap ( ) ; $ collection = new Collection ; foreach ( $ permissions as $ method => $ ability ) { $ collection -> push ( new Fluent ( [ 'ability' => $ ability , 'method' => $ method , ] ) ) ; } ...
Authorize a permission resource action based on the incoming request .
15,870
public function registerClientEvents ( $ id ) { $ view = $ this -> getView ( ) ; $ js = [ ] ; foreach ( $ this -> clientEvents as $ event => $ handler ) { $ js [ ] = "jQuery('$id').on('$event', $handler);" ; } $ view -> registerJs ( implode ( "\n" , $ js ) ) ; }
Register client events
15,871
protected function getLinkText ( ) { $ value = $ this -> value ; if ( $ this -> hasModel ( ) ) { $ model = $ this -> model ; if ( $ value !== null ) { if ( is_string ( $ value ) ) { $ linkText = ArrayHelper :: getValue ( $ model , $ value ) ; } else { $ linkText = call_user_func ( $ value , $ model ) ; } } else { $ lin...
Return link text
15,872
protected function registerClientScript ( ) { $ view = $ this -> grid -> getView ( ) ; switch ( $ this -> type ) { case 'address' : EditableAddressAsset :: register ( $ view ) ; break ; case 'combodate' : EditableComboDateAsset :: register ( $ view ) ; break ; case 'date' : EditableDatePickerAsset :: register ( $ view ...
Registers required script to the columns work
15,873
public static function fromText ( $ text , $ mode = null ) { $ text = nl2br ( htmlentities ( $ text , null , 'utf-8' ) ) ; $ text = self :: createLinks ( $ text ) ; return $ text ; }
Creates HTML from a text string typically for formatting comments .
15,874
public function run ( $ runnable , & $ ran = null ) { $ ran = false ; $ fd = call_user_func ( $ this -> filesystem [ 'fopen' ] , $ this -> file , 'w' ) ; if ( ! $ fd ) { throw new \ RuntimeException ( "Could not open file {$this->file}" ) ; } $ hasLock = call_user_func ( $ this -> filesystem [ 'flock' ] , $ fd , $ this...
Run the runnable code typically a closure .
15,875
public function assert ( Acl $ acl , RoleInterface $ role = null , ResourceInterface $ resource = null , $ privilege = null ) { if ( ! $ role instanceof UserInterface || ! $ resource instanceof ApplicationInterface ) { return false ; } $ permissions = $ resource -> getPermissions ( ) ; if ( $ resource -> isDraft ( ) ) ...
Checks permissions based on resources permissions .
15,876
public function generate ( ) { $ generator = $ this -> generator ; $ data = $ this -> data ; $ fgm = new FileGeneratorManager ( ) ; $ fm = new FileManager ( ) ; $ tm = new TemplateManager ( ) ; $ dbm = new DataBuilderManager ( ) ; $ result = $ dbm -> build ( $ generator -> data_builder , $ data ) ; if ( ! $ result -> o...
Generate a file .
15,877
protected static function readIPTC ( $ iptc , $ value , $ glue = ", " ) { if ( isset ( $ iptc [ $ value ] ) ) { return implode ( $ glue , $ iptc [ $ value ] ) ; } else { return null ; } }
reads the iptc information of a certain value
15,878
public function createMail ( $ to , array $ args ) { $ keys = array ( ) ; $ values = array ( ) ; foreach ( $ args as $ key => $ value ) { $ keys [ ] = '{' . $ key . '}' ; $ values [ ] = $ value ; } $ subject = str_replace ( $ keys , $ values , $ this -> subject ) ; $ message = str_replace ( $ keys , $ values , $ this -...
creates a mail object for a given sender
15,879
public function listAction ( ) { $ repository = $ this -> repositories -> get ( 'Applications/Application' ) ; $ applicationId = $ this -> params ( ) -> fromQuery ( 'applicationId' , 0 ) ; $ application = $ repository -> find ( $ applicationId ) ; $ this -> acl ( $ application , 'read' ) ; return array ( 'comments' => ...
Lists comments of an application
15,880
public function formAction ( ) { $ repository = $ this -> repositories -> get ( 'Applications/Application' ) ; $ mode = $ this -> params ( ) -> fromQuery ( 'mode' , 'new' ) ; $ appId = $ this -> params ( ) -> fromQuery ( 'id' ) ; $ application = $ repository -> find ( $ appId ) ; $ viewModel = new ViewModel ( ) ; if ( ...
Processes formular data
15,881
public function findByUri ( $ uri , $ create = false ) { $ subscriber = $ this -> findOneBy ( array ( "uri" => $ uri ) ) ; if ( ! isset ( $ subscriber ) && $ create ) { $ subscriber = $ this -> create ( ) ; $ subscriber -> uri = $ uri ; $ this -> dm -> persist ( $ subscriber ) ; $ this -> dm -> flush ( ) ; } return $ s...
Find a subscriber by an uri
15,882
public function listColumns ( ) { if ( ! is_null ( $ this -> listColumns ) ) { return $ this -> listColumns ; } AnnotationManager :: autoLoadAnnotation ( ) ; $ properties = $ this -> reflection -> getProperties ( ) ; $ haveIndex = false ; $ columns = array ( ) ; foreach ( $ properties as $ property ) { $ propertyAnnota...
List the Ldap Columns of an Entity Class
15,883
public function listRequiredMethod ( ) { if ( ! is_null ( $ this -> listRequiredMethod ) ) return $ this -> listRequiredMethod ; $ columns = $ this -> listColumns ( ) ; $ methodList = array ( ) ; foreach ( $ columns as $ name => $ schema ) { $ this -> methodGetter ( $ methodList , $ name ) ; switch ( $ schema [ 'type' ...
Get the list of require method
15,884
public function listMissingMethod ( ) { if ( ! is_null ( $ this -> listMissingMethod ) ) return $ this -> listMissingMethod ; $ required = $ this -> listRequiredMethod ( ) ; $ missing = array ( ) ; foreach ( $ required as $ methodName => $ data ) { if ( ! $ this -> reflection -> hasMethod ( $ methodName ) ) { $ missing...
Get the list of missing require method
15,885
private static function haveAnnotation ( $ annotationClass , array $ annotationList ) { foreach ( $ annotationList as $ annotation ) { if ( is_a ( $ annotation , $ annotationClass ) ) { return $ annotation ; } } return false ; }
Get the annotation of the class in the list or return false
15,886
public function isValid ( $ value ) { if ( ! $ value instanceof ApplicationInterface ) { $ this -> error ( 'NO_APPLICATION' ) ; return false ; } $ error = false ; if ( '' == $ value -> getContact ( ) -> getEmail ( ) ) { $ error = true ; $ this -> error ( 'NO_EMAIL' ) ; } if ( ! $ value -> getAttributes ( ) -> getAccept...
Returns true if and only if there s at least an email address set and the privacy policy accepted in the application .
15,887
public function toObject ( $ string ) : stdClass { if ( is_string ( $ string ) ) { return $ this -> jsonDecode ( $ string ) ; } return $ this -> jsonDecode ( $ this -> jsonEncode ( $ string ) ) ; }
Convert to object .
15,888
public function init ( ) { $ this -> setIsDisableCapable ( false ) -> setIsDisableElementsCapable ( false ) -> setAttribute ( 'data-submit-on' , 'checkbox' ) ; $ this -> add ( array ( 'type' => 'checkbox' , 'name' => 'sendCarbonCopy' , 'options' => array ( 'headline' => 'Carbon Copy' , 'long_label' => 'send me a carbon...
initialize attributes form
15,889
public function init ( ) { $ this -> setHydrator ( new \ Core \ Entity \ Hydrator \ EntityHydrator ( ) ) -> setName ( 'base' ) ; $ this -> add ( array ( 'name' => 'willingnessToTravel' , 'type' => '\Core\Form\Element\Select' , 'options' => array ( 'value_options' => array ( '' => '' , "yes" => "Yes" , "conditioned" => ...
initialize facts fieldset
15,890
public function moveAction ( ) { $ ids = ( array ) $ this -> params ( ) -> fromPost ( 'ids' ) ; $ moved = 0 ; if ( $ ids ) { $ serviceManager = $ this -> serviceLocator ; $ repositories = $ serviceManager -> get ( 'repositories' ) ; $ applicationRepository = $ repositories -> get ( 'Applications/Application' ) ; $ cvRe...
Move given applications to Talent Pool
15,891
public function getApplyFormSettings ( ) { if ( ! $ this -> applyFormSettings ) { $ settings = new DisableElementsCapableFormSettings ( ) ; $ settings -> setForm ( 'Applications/Apply' ) ; $ this -> applyFormSettings = $ settings ; } return $ this -> applyFormSettings ; }
Gets the disabled apply form elements settings .
15,892
public function init ( ) { $ this -> setIsDisableCapable ( false ) -> setIsDisableElementsCapable ( false ) ; $ this -> setForms ( array ( 'contact' => array ( 'type' => 'Auth/UserInfo' , 'property' => true , ) , 'image' => array ( 'type' => 'Applications/ContactImage' , 'property' => true , 'use_files_array' => true ,...
initialize contact container
15,893
public static function format ( $ str ) { $ dom = new \ DOMDocument ( ) ; $ dom -> loadXML ( $ str ) ; $ dom -> formatOutput = true ; return $ dom -> saveXML ( ) ; }
Format an XML string using libxml s domdocument formatter
15,894
public function init ( ) { $ this -> options [ 'disable_capable' ] = array ( 'description' => 'Request additional facts from the Applicant. Selected Fields will be added to the application Form.' , ) ; $ this -> setLabel ( 'Facts' ) ; $ this -> setIsDescriptionsEnabled ( true ) ; $ this -> setDescription ( 'Please prov...
initialize facts form
15,895
public static function htmlToText ( $ html , $ eol = "\n" ) { if ( strpos ( $ html , '<body>' ) ) { $ html = substr ( $ html , ( strpos ( $ html , '<body>' ) + 6 ) ) ; } $ html = str_replace ( array ( "\r\n" , "\n" , "\r" ) , '' , $ html ) ; $ html = str_replace ( array ( '<p>' , '<div>' , '<pre>' , '<table>' , '<ul>' ...
converts html into text
15,896
public static function encodeString ( $ string , $ encoding , $ eol = "\n" ) { $ encoding = strtolower ( $ encoding ) ; switch ( $ encoding ) { case self :: ENCODING_BASE64 : return chunk_split ( base64_encode ( $ string ) , 76 , $ eol ) ; case self :: ENCODING_7BIT : case self :: ENCODING_8BIT : $ encoded = self :: cl...
encodes a string to the given encoding
15,897
private static function encodeBoundaryBlock ( $ boundary , $ contentType , $ charset , $ encoding , $ content , $ eol = "\n" ) { return '--' . $ boundary . $ eol . 'Content-Type: ' . $ contentType . '; charset="' . $ charset . '"' . $ eol . 'Content-Transfer-Encoding: ' . $ encoding . $ eol . $ eol . self :: encodeStri...
encodes a boundary block
15,898
private static function encodeAttachment ( $ boundary , FsPath $ path , $ fileName , $ charset , $ encoding , $ eol = "\n" ) { $ file = new FsPath ( $ fileName ) ; $ string = "--{$boundary}{$eol}" . "Content-Type: " . self :: getMimeType ( $ file -> getExtension ( ) ) . "; name=\"" . mb_encode_mimeheader ( $ file -> ge...
encodes an attachment
15,899
public static function getMimeType ( $ ext ) { $ ext = strtolower ( $ ext ) ; $ mimes = array ( 'hqx' => 'application/mac-binhex40' , 'cpt' => 'application/mac-compactpro' , 'doc' => 'application/msword' , 'bin' => 'application/macbinary' , 'dms' => 'application/octet-stream' , 'lha' => 'application/octet-stream' , 'lz...
returns a mime type of a file