repo
stringlengths
6
63
path
stringlengths
5
140
func_name
stringlengths
3
151
original_string
stringlengths
84
13k
language
stringclasses
1 value
code
stringlengths
84
13k
code_tokens
list
docstring
stringlengths
3
47.2k
docstring_tokens
list
sha
stringlengths
40
40
url
stringlengths
91
247
partition
stringclasses
1 value
Stillat/Common
src/Stillat/Common/Traits/Expectations.php
Expectations.expectNumberNotZeroForDivision
protected function expectNumberNotZeroForDivision($number, $message = '') { $this->expectValidNumber($number, $message); if ($number == 0) { throw new DivideByZeroException($message); } }
php
protected function expectNumberNotZeroForDivision($number, $message = '') { $this->expectValidNumber($number, $message); if ($number == 0) { throw new DivideByZeroException($message); } }
[ "protected", "function", "expectNumberNotZeroForDivision", "(", "$", "number", ",", "$", "message", "=", "''", ")", "{", "$", "this", "->", "expectValidNumber", "(", "$", "number", ",", "$", "message", ")", ";", "if", "(", "$", "number", "==", "0", ")", ...
Expects a number not to be zero when using for division. @param $number @param string $message @throws \Stillat\Common\Exceptions\Arithmetic\DivideByZeroException @throws \Stillat\Common\Exceptions\Arithmetic\NotFiniteNumberException
[ "Expects", "a", "number", "not", "to", "be", "zero", "when", "using", "for", "division", "." ]
9f69105292740c307aece588cf58a85892bad350
https://github.com/Stillat/Common/blob/9f69105292740c307aece588cf58a85892bad350/src/Stillat/Common/Traits/Expectations.php#L68-L74
train
joegreen88/zf1-component-validate
src/Zend/Validate/File/Hash.php
Zend_Validate_File_Hash.addHash
public function addHash($options) { if (is_string($options)) { $options = array($options); } else if (!is_array($options)) { throw new Zend_Validate_Exception("False parameter given"); } $known = hash_algos(); if (!isset($options['algorithm'])) { ...
php
public function addHash($options) { if (is_string($options)) { $options = array($options); } else if (!is_array($options)) { throw new Zend_Validate_Exception("False parameter given"); } $known = hash_algos(); if (!isset($options['algorithm'])) { ...
[ "public", "function", "addHash", "(", "$", "options", ")", "{", "if", "(", "is_string", "(", "$", "options", ")", ")", "{", "$", "options", "=", "array", "(", "$", "options", ")", ";", "}", "else", "if", "(", "!", "is_array", "(", "$", "options", ...
Adds the hash for one or multiple files @param string|array $options @return Zend_Validate_File_Hash Provides a fluent interface
[ "Adds", "the", "hash", "for", "one", "or", "multiple", "files" ]
88d9ea016f73d48ff0ba7d06ecbbf28951fd279e
https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/File/Hash.php#L114-L141
train
ARCANESOFT/Blog
src/Http/Controllers/Admin/DashboardController.php
DashboardController.index
public function index() { $this->authorize(DashboardPolicy::PERMISSION_STATS); $this->setTitle(trans('blog::dashboard.titles.statistics')); return $this->view('admin.dashboard'); }
php
public function index() { $this->authorize(DashboardPolicy::PERMISSION_STATS); $this->setTitle(trans('blog::dashboard.titles.statistics')); return $this->view('admin.dashboard'); }
[ "public", "function", "index", "(", ")", "{", "$", "this", "->", "authorize", "(", "DashboardPolicy", "::", "PERMISSION_STATS", ")", ";", "$", "this", "->", "setTitle", "(", "trans", "(", "'blog::dashboard.titles.statistics'", ")", ")", ";", "return", "$", "...
Get the dashboard page. @return \Illuminate\View\View
[ "Get", "the", "dashboard", "page", "." ]
2078fdfdcbccda161c02899b9e1f344f011b2859
https://github.com/ARCANESOFT/Blog/blob/2078fdfdcbccda161c02899b9e1f344f011b2859/src/Http/Controllers/Admin/DashboardController.php#L39-L46
train
Marwelln/Notifier
src/Marwelln/Notifier/Notify.php
Notify.flash
public function flash($message = null, $type = null) { if ($message !== null) $this->attributes['message'] = (array) $message; if ($type !== null) $this->attributes['type'] = $type; $this->session->flash('notifier', $this->attributes); }
php
public function flash($message = null, $type = null) { if ($message !== null) $this->attributes['message'] = (array) $message; if ($type !== null) $this->attributes['type'] = $type; $this->session->flash('notifier', $this->attributes); }
[ "public", "function", "flash", "(", "$", "message", "=", "null", ",", "$", "type", "=", "null", ")", "{", "if", "(", "$", "message", "!==", "null", ")", "$", "this", "->", "attributes", "[", "'message'", "]", "=", "(", "array", ")", "$", "message",...
Save the setup to a session flash. @return void
[ "Save", "the", "setup", "to", "a", "session", "flash", "." ]
f3a17802f4bd0ce13f23ca54d32c254617cf2f17
https://github.com/Marwelln/Notifier/blob/f3a17802f4bd0ce13f23ca54d32c254617cf2f17/src/Marwelln/Notifier/Notify.php#L91-L96
train
RocketPropelledTortoise/Core
src/Taxonomy/Utils/CommonTableExpressionQuery.php
CommonTableExpressionQuery.runQuery
protected function runQuery($raw_query, $id) { $query = str_replace(':id', $id, $raw_query); $start = microtime(true); // Does not work as a prepared statement; we have to execute it directly $results = DB::getReadPdo()->query($query)->fetchAll(\PDO::FETCH_OBJ); // Log the...
php
protected function runQuery($raw_query, $id) { $query = str_replace(':id', $id, $raw_query); $start = microtime(true); // Does not work as a prepared statement; we have to execute it directly $results = DB::getReadPdo()->query($query)->fetchAll(\PDO::FETCH_OBJ); // Log the...
[ "protected", "function", "runQuery", "(", "$", "raw_query", ",", "$", "id", ")", "{", "$", "query", "=", "str_replace", "(", "':id'", ",", "$", "id", ",", "$", "raw_query", ")", ";", "$", "start", "=", "microtime", "(", "true", ")", ";", "// Does not...
Execute the query with the current PDO connection. Will log the time taken manually @param string $raw_query @param int $id @return \Illuminate\Support\Collection
[ "Execute", "the", "query", "with", "the", "current", "PDO", "connection", ".", "Will", "log", "the", "time", "taken", "manually" ]
78b65663fc463e21e494257140ddbed0a9ccb3c3
https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Utils/CommonTableExpressionQuery.php#L27-L40
train
RocketPropelledTortoise/Core
src/Taxonomy/Utils/CommonTableExpressionQuery.php
CommonTableExpressionQuery.assembleQuery
protected function assembleQuery($initial, $recursive) { $tmp_tbl = 'name_tree'; $recursive = str_replace(':tmp_tbl', $tmp_tbl, $recursive); $final = "select distinct * from $tmp_tbl"; if (DB::connection()->getDriverName() == 'mysql') { return "Call WITH_EMULATOR('$tmp_...
php
protected function assembleQuery($initial, $recursive) { $tmp_tbl = 'name_tree'; $recursive = str_replace(':tmp_tbl', $tmp_tbl, $recursive); $final = "select distinct * from $tmp_tbl"; if (DB::connection()->getDriverName() == 'mysql') { return "Call WITH_EMULATOR('$tmp_...
[ "protected", "function", "assembleQuery", "(", "$", "initial", ",", "$", "recursive", ")", "{", "$", "tmp_tbl", "=", "'name_tree'", ";", "$", "recursive", "=", "str_replace", "(", "':tmp_tbl'", ",", "$", "tmp_tbl", ",", "$", "recursive", ")", ";", "$", "...
Prepare the complete query to run on the DB to get the data recursively. @param string $initial The initial query bootstrapping the recursive query @param string $recursive The query to dig deeper in the hierarchy @return string
[ "Prepare", "the", "complete", "query", "to", "run", "on", "the", "DB", "to", "get", "the", "data", "recursively", "." ]
78b65663fc463e21e494257140ddbed0a9ccb3c3
https://github.com/RocketPropelledTortoise/Core/blob/78b65663fc463e21e494257140ddbed0a9ccb3c3/src/Taxonomy/Utils/CommonTableExpressionQuery.php#L49-L61
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.getConfig
public function getConfig() { $config = false; if (file_exists(realpath(__DIR__ . "/../ExactTargetLaravelConfig.php"))) { $config = include __DIR__ . "/../ExactTargetLaravelConfig.php"; return $config; } return $config; }
php
public function getConfig() { $config = false; if (file_exists(realpath(__DIR__ . "/../ExactTargetLaravelConfig.php"))) { $config = include __DIR__ . "/../ExactTargetLaravelConfig.php"; return $config; } return $config; }
[ "public", "function", "getConfig", "(", ")", "{", "$", "config", "=", "false", ";", "if", "(", "file_exists", "(", "realpath", "(", "__DIR__", ".", "\"/../ExactTargetLaravelConfig.php\"", ")", ")", ")", "{", "$", "config", "=", "include", "__DIR__", ".", "...
Gets the Configuration @return array
[ "Gets", "the", "Configuration" ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L239-L247
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.refreshToken
public function refreshToken($forceRefresh = false) { if (property_exists($this, "sdl") && $this->sdl == 0) { parent::__construct($this->xmlLoc, array('trace'=>1, 'exceptions'=>0)); } try { $currentTime = new DateTime(); if (is_null($this->getAuthTokenExpi...
php
public function refreshToken($forceRefresh = false) { if (property_exists($this, "sdl") && $this->sdl == 0) { parent::__construct($this->xmlLoc, array('trace'=>1, 'exceptions'=>0)); } try { $currentTime = new DateTime(); if (is_null($this->getAuthTokenExpi...
[ "public", "function", "refreshToken", "(", "$", "forceRefresh", "=", "false", ")", "{", "if", "(", "property_exists", "(", "$", "this", ",", "\"sdl\"", ")", "&&", "$", "this", "->", "sdl", "==", "0", ")", "{", "parent", "::", "__construct", "(", "$", ...
Gets the refresh token using the authentication URL. @param boolean $forceRefresh Flag to indicate a force refresh of authentication toekn. @return void
[ "Gets", "the", "refresh", "token", "using", "the", "authentication", "URL", "." ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L255-L300
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.setAuthToken
public function setAuthToken($tenantKey, $authToken, $authTokenExpiration) { if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } $this->tenantTokens[$tenantKey]['authToken'] = $authToken; $this->tenantTokens[$tenantKey]['authTokenEx...
php
public function setAuthToken($tenantKey, $authToken, $authTokenExpiration) { if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } $this->tenantTokens[$tenantKey]['authToken'] = $authToken; $this->tenantTokens[$tenantKey]['authTokenEx...
[ "public", "function", "setAuthToken", "(", "$", "tenantKey", ",", "$", "authToken", ",", "$", "authTokenExpiration", ")", "{", "if", "(", "$", "this", "->", "tenantTokens", "[", "$", "tenantKey", "]", "==", "null", ")", "{", "$", "this", "->", "tenantTok...
Set the authentication token in the tenantTokens array. @param string $tenantKey Tenant key for which auth toke to be set @param string $authToken Authentication token to be set @param string $authTokenExpiration Authentication token expiration value
[ "Set", "the", "authentication", "token", "in", "the", "tenantTokens", "array", "." ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L474-L481
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.getAuthTokenExpiration
public function getAuthTokenExpiration($tenantKey) { $tenantKey = $tenantKey == null ? $this->tenantKey : $tenantKey; if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } return isset($this->tenantTokens[$tenantKey]['authTokenExpirat...
php
public function getAuthTokenExpiration($tenantKey) { $tenantKey = $tenantKey == null ? $this->tenantKey : $tenantKey; if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } return isset($this->tenantTokens[$tenantKey]['authTokenExpirat...
[ "public", "function", "getAuthTokenExpiration", "(", "$", "tenantKey", ")", "{", "$", "tenantKey", "=", "$", "tenantKey", "==", "null", "?", "$", "this", "->", "tenantKey", ":", "$", "tenantKey", ";", "if", "(", "$", "this", "->", "tenantTokens", "[", "$...
Get the Auth Token Expiration. @param string $tenantKey Tenant key for which authenication token is returned @return string Authenticaiton token for the tenant key
[ "Get", "the", "Auth", "Token", "Expiration", "." ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L488-L497
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.setInternalAuthToken
public function setInternalAuthToken($tenantKey, $internalAuthToken) { if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } $this->tenantTokens[$tenantKey]['internalAuthToken'] = $internalAuthToken; }
php
public function setInternalAuthToken($tenantKey, $internalAuthToken) { if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } $this->tenantTokens[$tenantKey]['internalAuthToken'] = $internalAuthToken; }
[ "public", "function", "setInternalAuthToken", "(", "$", "tenantKey", ",", "$", "internalAuthToken", ")", "{", "if", "(", "$", "this", "->", "tenantTokens", "[", "$", "tenantKey", "]", "==", "null", ")", "{", "$", "this", "->", "tenantTokens", "[", "$", "...
Set the internal auth tokan. @param string $tenantKey @param string $internalAuthToken
[ "Set", "the", "internal", "auth", "tokan", "." ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L520-L526
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.setRefreshToken
public function setRefreshToken($tenantKey, $refreshToken) { if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } $this->tenantTokens[$tenantKey]['refreshToken'] = $refreshToken; }
php
public function setRefreshToken($tenantKey, $refreshToken) { if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } $this->tenantTokens[$tenantKey]['refreshToken'] = $refreshToken; }
[ "public", "function", "setRefreshToken", "(", "$", "tenantKey", ",", "$", "refreshToken", ")", "{", "if", "(", "$", "this", "->", "tenantTokens", "[", "$", "tenantKey", "]", "==", "null", ")", "{", "$", "this", "->", "tenantTokens", "[", "$", "tenantKey"...
Set the refresh authentication token. @param string $tenantKey Tenant key to which refresh token is set @param string $refreshToken Refresh authenication token
[ "Set", "the", "refresh", "authentication", "token", "." ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L533-L539
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.getRefreshToken
public function getRefreshToken($tenantKey) { $tenantKey = $tenantKey == null ? $this->tenantKey : $tenantKey; if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } return isset($this->tenantTokens[$tenantKey]['refreshToken']) ...
php
public function getRefreshToken($tenantKey) { $tenantKey = $tenantKey == null ? $this->tenantKey : $tenantKey; if ($this->tenantTokens[$tenantKey] == null) { $this->tenantTokens[$tenantKey] = array(); } return isset($this->tenantTokens[$tenantKey]['refreshToken']) ...
[ "public", "function", "getRefreshToken", "(", "$", "tenantKey", ")", "{", "$", "tenantKey", "=", "$", "tenantKey", "==", "null", "?", "$", "this", "->", "tenantKey", ":", "$", "tenantKey", ";", "if", "(", "$", "this", "->", "tenantTokens", "[", "$", "t...
Get the refresh token for the tenant. @param string $tenantKey @return string Refresh token for the tenant
[ "Get", "the", "refresh", "token", "for", "the", "tenant", "." ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L547-L556
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.AddSubscriberToList
public function AddSubscriberToList($emailAddress, $listIDs, $subscriberKey = null) { $newSub = new ET_Subscriber; $newSub->authStub = $this; $lists = array(); foreach ($listIDs as $key => $value) { $lists[] = array("ID" => $value); } //if (is_string($em...
php
public function AddSubscriberToList($emailAddress, $listIDs, $subscriberKey = null) { $newSub = new ET_Subscriber; $newSub->authStub = $this; $lists = array(); foreach ($listIDs as $key => $value) { $lists[] = array("ID" => $value); } //if (is_string($em...
[ "public", "function", "AddSubscriberToList", "(", "$", "emailAddress", ",", "$", "listIDs", ",", "$", "subscriberKey", "=", "null", ")", "{", "$", "newSub", "=", "new", "ET_Subscriber", ";", "$", "newSub", "->", "authStub", "=", "$", "this", ";", "$", "l...
Add subscriber to list. @param string $emailAddress Email address of the subscriber @param array $listIDs Array of list id to which the subscriber is added @param string $subscriberKey Newly added subscriber key @return mixed post or patch response object. If the subscriber already existing patch response is returned ...
[ "Add", "subscriber", "to", "list", "." ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L566-L593
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.CreateDataExtensions
public function CreateDataExtensions($dataExtensionDefinitions) { $newDEs = new ET_DataExtension(); $newDEs->authStub = $this; $newDEs->props = $dataExtensionDefinitions; $postResponse = $newDEs->post(); return $postResponse; }
php
public function CreateDataExtensions($dataExtensionDefinitions) { $newDEs = new ET_DataExtension(); $newDEs->authStub = $this; $newDEs->props = $dataExtensionDefinitions; $postResponse = $newDEs->post(); return $postResponse; }
[ "public", "function", "CreateDataExtensions", "(", "$", "dataExtensionDefinitions", ")", "{", "$", "newDEs", "=", "new", "ET_DataExtension", "(", ")", ";", "$", "newDEs", "->", "authStub", "=", "$", "this", ";", "$", "newDEs", "->", "props", "=", "$", "dat...
Create a new data extension based on the definition passed @param array $dataExtensionDefinitions Data extension definition properties as an array @return mixed post response object
[ "Create", "a", "new", "data", "extension", "based", "on", "the", "definition", "passed" ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L623-L631
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.SendTriggeredSends
public function SendTriggeredSends($arrayOfTriggeredRecords) { $sendTS = new ET_TriggeredSend(); $sendTS->authStub = $this; $sendTS->props = $arrayOfTriggeredRecords; $sendResponse = $sendTS->send(); return $sendResponse; }
php
public function SendTriggeredSends($arrayOfTriggeredRecords) { $sendTS = new ET_TriggeredSend(); $sendTS->authStub = $this; $sendTS->props = $arrayOfTriggeredRecords; $sendResponse = $sendTS->send(); return $sendResponse; }
[ "public", "function", "SendTriggeredSends", "(", "$", "arrayOfTriggeredRecords", ")", "{", "$", "sendTS", "=", "new", "ET_TriggeredSend", "(", ")", ";", "$", "sendTS", "->", "authStub", "=", "$", "this", ";", "$", "sendTS", "->", "props", "=", "$", "arrayO...
Starts an send operation for the TriggerredSend records @param array $arrayOfTriggeredRecords Array of TriggeredSend records @return mixed Send reponse object
[ "Starts", "an", "send", "operation", "for", "the", "TriggerredSend", "records" ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L638-L645
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.SendEmailToDataExtension
public function SendEmailToDataExtension($emailID, $sendableDataExtensionCustomerKey, $sendClassficationCustomerKey) { $email = new ET_Email_SendDefinition(); $email->props = array("Name"=>uniqid(), "CustomerKey"=>uniqid(), "Description"=>"Created with FuelSDK"); $email->props["SendClassific...
php
public function SendEmailToDataExtension($emailID, $sendableDataExtensionCustomerKey, $sendClassficationCustomerKey) { $email = new ET_Email_SendDefinition(); $email->props = array("Name"=>uniqid(), "CustomerKey"=>uniqid(), "Description"=>"Created with FuelSDK"); $email->props["SendClassific...
[ "public", "function", "SendEmailToDataExtension", "(", "$", "emailID", ",", "$", "sendableDataExtensionCustomerKey", ",", "$", "sendClassficationCustomerKey", ")", "{", "$", "email", "=", "new", "ET_Email_SendDefinition", "(", ")", ";", "$", "email", "->", "props", ...
Create an email send definition, send the email based on the definition and delete the definition. @param string $emailID Email identifier for which the email is sent @param string $sendableDataExtensionCustomerKey Sendable data extension customer key @param string $sendClassficationCustomerKey Send classification cus...
[ "Create", "an", "email", "send", "definition", "send", "the", "email", "based", "on", "the", "definition", "and", "delete", "the", "definition", "." ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L684-L704
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.CreateProfileAttributes
public function CreateProfileAttributes($allAttributes) { $attrs = new ET_ProfileAttribute(); $attrs->authStub = $this; $attrs->props = $allAttributes; return $attrs->post(); }
php
public function CreateProfileAttributes($allAttributes) { $attrs = new ET_ProfileAttribute(); $attrs->authStub = $this; $attrs->props = $allAttributes; return $attrs->post(); }
[ "public", "function", "CreateProfileAttributes", "(", "$", "allAttributes", ")", "{", "$", "attrs", "=", "new", "ET_ProfileAttribute", "(", ")", ";", "$", "attrs", "->", "authStub", "=", "$", "this", ";", "$", "attrs", "->", "props", "=", "$", "allAttribut...
Create a profile attribute @param array $allAttributes Profile attribute properties as an array. @return mixed Post operation result
[ "Create", "a", "profile", "attribute" ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L775-L781
train
patrickisgreat/da-php-fuel-sdk
src/ET_Client.php
ET_Client.CreateContentAreas
public function CreateContentAreas($arrayOfContentAreas) { $postC = new ET_ContentArea(); $postC->authStub = $this; $postC->props = $arrayOfContentAreas; $sendResponse = $postC->post(); return $sendResponse; }
php
public function CreateContentAreas($arrayOfContentAreas) { $postC = new ET_ContentArea(); $postC->authStub = $this; $postC->props = $arrayOfContentAreas; $sendResponse = $postC->post(); return $sendResponse; }
[ "public", "function", "CreateContentAreas", "(", "$", "arrayOfContentAreas", ")", "{", "$", "postC", "=", "new", "ET_ContentArea", "(", ")", ";", "$", "postC", "->", "authStub", "=", "$", "this", ";", "$", "postC", "->", "props", "=", "$", "arrayOfContentA...
Create one or more content areas @param array $arrayOfContentAreas Content areas properties as an array @return void
[ "Create", "one", "or", "more", "content", "areas" ]
6935f51b4d3dbd0923aed746620955fd63789549
https://github.com/patrickisgreat/da-php-fuel-sdk/blob/6935f51b4d3dbd0923aed746620955fd63789549/src/ET_Client.php#L788-L795
train
SagittariusX/Beluga.IO
src/Beluga/IO/Folder.php
Folder.Create
public static function Create( string $folder, int $mode = 0700 ) { if ( \is_dir( $folder ) ) { // No folder = do nothing return; } if ( ! static::CanCreate( $folder ) ) { // No rights to create the required folder throw new FolderAccessError( ...
php
public static function Create( string $folder, int $mode = 0700 ) { if ( \is_dir( $folder ) ) { // No folder = do nothing return; } if ( ! static::CanCreate( $folder ) ) { // No rights to create the required folder throw new FolderAccessError( ...
[ "public", "static", "function", "Create", "(", "string", "$", "folder", ",", "int", "$", "mode", "=", "0700", ")", "{", "if", "(", "\\", "is_dir", "(", "$", "folder", ")", ")", "{", "// No folder = do nothing", "return", ";", "}", "if", "(", "!", "st...
Creates a new folder with defined mode. The mode only works on unixoid systems. @param string $folder The folder to create. @param integer $mode Mode for new folder (0700) only used for unixoide systems @throws \Beluga\IO\FolderAccessError If creation fails
[ "Creates", "a", "new", "folder", "with", "defined", "mode", ".", "The", "mode", "only", "works", "on", "unixoid", "systems", "." ]
c8af09a1b3cc8a955e43c89b70779d11b30ae29e
https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/Folder.php#L136-L195
train
SagittariusX/Beluga.IO
src/Beluga/IO/Folder.php
Folder.ListFilteredFiles
public static function ListFilteredFiles( string $folder, $filter, bool $recursive = false ) : array { // Init the array that should contain the resulting file paths $files = array(); if ( ! \is_dir( $folder ) ) { // No folder = we are done here return $files; } ...
php
public static function ListFilteredFiles( string $folder, $filter, bool $recursive = false ) : array { // Init the array that should contain the resulting file paths $files = array(); if ( ! \is_dir( $folder ) ) { // No folder = we are done here return $files; } ...
[ "public", "static", "function", "ListFilteredFiles", "(", "string", "$", "folder", ",", "$", "filter", ",", "bool", "$", "recursive", "=", "false", ")", ":", "array", "{", "// Init the array that should contain the resulting file paths", "$", "files", "=", "array", ...
Returns all files, matching the defined filter. If $recursive is TRUE, it also includes al sub folders. If the filter is a callback function/method, so it must accept 2 parameters. - string $itemName The name of the current filter item - string $itemPath THe absolute path of the item. @param string $folde...
[ "Returns", "all", "files", "matching", "the", "defined", "filter", "." ]
c8af09a1b3cc8a955e43c89b70779d11b30ae29e
https://github.com/SagittariusX/Beluga.IO/blob/c8af09a1b3cc8a955e43c89b70779d11b30ae29e/src/Beluga/IO/Folder.php#L323-L378
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.slice
final public function slice($offset, $length = null, $preserve_keys = false) { $arr = array_unshift($this->{self::MAGIC_PROPERTY}, $offset, $length, $preserve_keys); return static::createFromArray($arr); }
php
final public function slice($offset, $length = null, $preserve_keys = false) { $arr = array_unshift($this->{self::MAGIC_PROPERTY}, $offset, $length, $preserve_keys); return static::createFromArray($arr); }
[ "final", "public", "function", "slice", "(", "$", "offset", ",", "$", "length", "=", "null", ",", "$", "preserve_keys", "=", "false", ")", "{", "$", "arr", "=", "array_unshift", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "...
Extract a slice of the array @param int $offset Starting position in the array @param int $length Number of items to include, starting from $offset @param bool $preserve_keys Prevent override of indices @return [type] Returns the slice. @see https://secure.php.net/manual/en/funct...
[ "Extract", "a", "slice", "of", "the", "array" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L110-L114
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.chunk
final public function chunk($size, $preserve_keys = false) { $arr = array_chunk($this->{self::MAGIC_PROPERTY}, $size, $preserve_keys); return static::createFromArray($arr); }
php
final public function chunk($size, $preserve_keys = false) { $arr = array_chunk($this->{self::MAGIC_PROPERTY}, $size, $preserve_keys); return static::createFromArray($arr); }
[ "final", "public", "function", "chunk", "(", "$", "size", ",", "$", "preserve_keys", "=", "false", ")", "{", "$", "arr", "=", "array_chunk", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", "size", ",", "$", "preserve_keys", ...
Split an array into chunks @param int $size The size of each chunk @param bool $preserve_keys Whether or not to preserve array keys @return [type] Multidimensional numerically indexed array of size $size @see https://secure.php.net/manual/en/function.array-chunk.php
[ "Split", "an", "array", "into", "chunks" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L137-L141
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.search
final public function search($needle, $strict = false) { return array_search($needle, $this->{self::MAGIC_PROPERTY}, $strict); }
php
final public function search($needle, $strict = false) { return array_search($needle, $this->{self::MAGIC_PROPERTY}, $strict); }
[ "final", "public", "function", "search", "(", "$", "needle", ",", "$", "strict", "=", "false", ")", "{", "return", "array_search", "(", "$", "needle", ",", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", "strict", ")", ";", "}"...
Searches the array for a given value and returns the corresponding key if successful @param mixed $needle [description] @param bool $strict [description] @return mixed Returns the key for needle if it is found in the array, FALSE otherwise. @see https://secure.php.net/manual/en/function.array-search.php
[ "Searches", "the", "array", "for", "a", "given", "value", "and", "returns", "the", "corresponding", "key", "if", "successful" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L158-L161
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.keys
final public function keys($search_value = null, $strict = false) { if (isset($search_value)) { return static::createFromArray(array_keys($this->{self::MAGIC_PROPERTY}, $search_value, $strict)); } else { return static::createFromArray(array_keys($this->{self::MAGIC_PROPERTY})); } }
php
final public function keys($search_value = null, $strict = false) { if (isset($search_value)) { return static::createFromArray(array_keys($this->{self::MAGIC_PROPERTY}, $search_value, $strict)); } else { return static::createFromArray(array_keys($this->{self::MAGIC_PROPERTY})); } }
[ "final", "public", "function", "keys", "(", "$", "search_value", "=", "null", ",", "$", "strict", "=", "false", ")", "{", "if", "(", "isset", "(", "$", "search_value", ")", ")", "{", "return", "static", "::", "createFromArray", "(", "array_keys", "(", ...
Return all the keys or a subset of the keys of an array @param mixed $search_value If specified, then only keys containing these values are returned. @param bool $strict Determines if strict comparison (===) should be used during the search. @return array Returns an array of all the keys in ar...
[ "Return", "all", "the", "keys", "or", "a", "subset", "of", "the", "keys", "of", "an", "array" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L179-L186
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.replace
final public function replace() { $args = func_get_args(); array_unshift($this->{self::MAGIC_PROPERTY}, $args); $arr = call_user_func_array('array_replace', $args); return static::createFromArray($arr); }
php
final public function replace() { $args = func_get_args(); array_unshift($this->{self::MAGIC_PROPERTY}, $args); $arr = call_user_func_array('array_replace', $args); return static::createFromArray($arr); }
[ "final", "public", "function", "replace", "(", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "array_unshift", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", "args", ")", ";", "$", "arr", "=", "call_user_func_a...
Replaces elements from passed arrays into the first array @param array ... Arrays with values to be extracted @return [type] Returns an array, or NULL if an error occurs. @see https://secure.php.net/manual/en/function.array-replace.php
[ "Replaces", "elements", "from", "passed", "arrays", "into", "the", "first", "array" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L217-L223
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.pad
final public function pad($size, $value) { return static::createFromArray(array_pad($this->{self::MAGIC_PROPERTY}, $size, $value)); }
php
final public function pad($size, $value) { return static::createFromArray(array_pad($this->{self::MAGIC_PROPERTY}, $size, $value)); }
[ "final", "public", "function", "pad", "(", "$", "size", ",", "$", "value", ")", "{", "return", "static", "::", "createFromArray", "(", "array_pad", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", "size", ",", "$", "value", ...
Pad array to the specified length with a value @param int $size New size of the array. @param mixed $value Value to pad if array is less than size. @return [type] Copy of the array padded to size specified by size with value value.
[ "Pad", "array", "to", "the", "specified", "length", "with", "a", "value" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L231-L234
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.multisort
final public function multisort( $array1_sort_order = SORT_ASC, $array1_sort_flags = SORT_REGULAR ) { return array_multisort($this->{self::MAGIC_PROPERTY}, $array1_sort_order, $array1_sort_flags); }
php
final public function multisort( $array1_sort_order = SORT_ASC, $array1_sort_flags = SORT_REGULAR ) { return array_multisort($this->{self::MAGIC_PROPERTY}, $array1_sort_order, $array1_sort_flags); }
[ "final", "public", "function", "multisort", "(", "$", "array1_sort_order", "=", "SORT_ASC", ",", "$", "array1_sort_flags", "=", "SORT_REGULAR", ")", "{", "return", "array_multisort", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", ...
Sort multiple or multi-dimensional arrays @param mixed $array1_sort_order SORT_ASC or SORT_DESC @param mixed $array1_sort_flags Sorting type flags @return [type] Returns TRUE on success or FALSE on failure. @see https://secure.php.net/manual/en/function.array-multisort.php
[ "Sort", "multiple", "or", "multi", "-", "dimensional", "arrays" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L255-L261
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.unique
final public function unique($sort_flags = SORT_STRING) { $arr = array_unique($this->{self::MAGIC_PROPERTY}, $sort_flags); return static::createFromArray($arr); }
php
final public function unique($sort_flags = SORT_STRING) { $arr = array_unique($this->{self::MAGIC_PROPERTY}, $sort_flags); return static::createFromArray($arr); }
[ "final", "public", "function", "unique", "(", "$", "sort_flags", "=", "SORT_STRING", ")", "{", "$", "arr", "=", "array_unique", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", "sort_flags", ")", ";", "return", "static", "::", ...
Removes duplicate values from an array @param int $sort_flags May be used to modify the sorting behavior @return [type] Returns the filtered array. @see https://secure.php.net/manual/en/function.array-unique.php
[ "Removes", "duplicate", "values", "from", "an", "array" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L269-L273
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.map
final public function map(Callable $callback) { $arr = array_map( $callback, array_values($this->{self::MAGIC_PROPERTY}), array_keys($this->{self::MAGIC_PROPERTY}) ); return static::createFromArray($arr); }
php
final public function map(Callable $callback) { $arr = array_map( $callback, array_values($this->{self::MAGIC_PROPERTY}), array_keys($this->{self::MAGIC_PROPERTY}) ); return static::createFromArray($arr); }
[ "final", "public", "function", "map", "(", "Callable", "$", "callback", ")", "{", "$", "arr", "=", "array_map", "(", "$", "callback", ",", "array_values", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ")", ",", "array_keys", "(", "$...
Applies the callback to the elements of the array @param Callable $callback Callback function to run for each element in the array. @return self An array containing elements from current array with callback applied
[ "Applies", "the", "callback", "to", "the", "elements", "of", "the", "array" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L312-L320
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.walk
final public function walk(Callable $callback, $userdata = null) { array_walk($this->{self::MAGIC_PROPERTY}, $callback); return $this; }
php
final public function walk(Callable $callback, $userdata = null) { array_walk($this->{self::MAGIC_PROPERTY}, $callback); return $this; }
[ "final", "public", "function", "walk", "(", "Callable", "$", "callback", ",", "$", "userdata", "=", "null", ")", "{", "array_walk", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", "callback", ")", ";", "return", "$", "this",...
Apply a user supplied function to every member of an array @param Callable $callback Typically, callback takes on two parameters. ($value, $index) @param mixed $userdata Optional third paramater for third paramater of $callback @return self
[ "Apply", "a", "user", "supplied", "function", "to", "every", "member", "of", "an", "array" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L328-L332
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.filter
final public function filter(Callable $callback, $flags = 0) { $arr = array_filter($this->{self::MAGIC_PROPERTY}, $callback); return static::createFromArray($arr); }
php
final public function filter(Callable $callback, $flags = 0) { $arr = array_filter($this->{self::MAGIC_PROPERTY}, $callback); return static::createFromArray($arr); }
[ "final", "public", "function", "filter", "(", "Callable", "$", "callback", ",", "$", "flags", "=", "0", ")", "{", "$", "arr", "=", "array_filter", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", "callback", ")", ";", "retu...
Filters elements of an array using a callback function @param Callable $callback The callback function to use @param int $flags Flag determining what arguments are sent to callback @return array Returns the filtered array. @see https://secure.php.net/manual/en/function.array-filter.php
[ "Filters", "elements", "of", "an", "array", "using", "a", "callback", "function" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L341-L345
train
shgysk8zer0/core_api
traits/arraymethods.php
ArrayMethods.reduce
final public function reduce(Callable $callback, $initial = null) { $result = array_reduce($this->{self::MAGIC_PROPERTY}, $callback, $initial); return static::from($result); }
php
final public function reduce(Callable $callback, $initial = null) { $result = array_reduce($this->{self::MAGIC_PROPERTY}, $callback, $initial); return static::from($result); }
[ "final", "public", "function", "reduce", "(", "Callable", "$", "callback", ",", "$", "initial", "=", "null", ")", "{", "$", "result", "=", "array_reduce", "(", "$", "this", "->", "{", "self", "::", "MAGIC_PROPERTY", "}", ",", "$", "callback", ",", "$",...
Iteratively reduce the array to a single value using a callback function @param Callable $callback mixed callback ( mixed $carry , mixed $item ) @param mixed $initial Optional intitial value of $carry in $callback @return mixed Returns the resulting value.
[ "Iteratively", "reduce", "the", "array", "to", "a", "single", "value", "using", "a", "callback", "function" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/arraymethods.php#L353-L358
train
gplcart/cli
controllers/commands/Payment.php
Payment.cmdGetPayment
public function cmdGetPayment() { $result = $this->getListPayment(); $this->outputFormat($result); $this->outputFormatTablePayment($result); $this->output(); }
php
public function cmdGetPayment() { $result = $this->getListPayment(); $this->outputFormat($result); $this->outputFormatTablePayment($result); $this->output(); }
[ "public", "function", "cmdGetPayment", "(", ")", "{", "$", "result", "=", "$", "this", "->", "getListPayment", "(", ")", ";", "$", "this", "->", "outputFormat", "(", "$", "result", ")", ";", "$", "this", "->", "outputFormatTablePayment", "(", "$", "resul...
Callback for "payment-get" command
[ "Callback", "for", "payment", "-", "get", "command" ]
e57dba53e291a225b4bff0c0d9b23d685dd1c125
https://github.com/gplcart/cli/blob/e57dba53e291a225b4bff0c0d9b23d685dd1c125/controllers/commands/Payment.php#L40-L46
train
DreadLabs/VantomasWebsite
src/Disqus/Response/AbstractResponse.php
AbstractResponse.getErrorCode
protected function getErrorCode() { $content = $this->content; return is_object($content) && property_exists($content, 'code') ? (integer) $content->code : 0; }
php
protected function getErrorCode() { $content = $this->content; return is_object($content) && property_exists($content, 'code') ? (integer) $content->code : 0; }
[ "protected", "function", "getErrorCode", "(", ")", "{", "$", "content", "=", "$", "this", "->", "content", ";", "return", "is_object", "(", "$", "content", ")", "&&", "property_exists", "(", "$", "content", ",", "'code'", ")", "?", "(", "integer", ")", ...
returns the response error code @return int
[ "returns", "the", "response", "error", "code" ]
7f85f2b45bdf5ed9fa9d320c805c416bf99cd668
https://github.com/DreadLabs/VantomasWebsite/blob/7f85f2b45bdf5ed9fa9d320c805c416bf99cd668/src/Disqus/Response/AbstractResponse.php#L81-L85
train
SlabPHP/cache-manager
src/Providers/Memcache.php
Memcache.flush
public function flush() { if (empty($this->memcache)) { return false; } $flushStatus = $this->memcache->flush(); return $flushStatus; }
php
public function flush() { if (empty($this->memcache)) { return false; } $flushStatus = $this->memcache->flush(); return $flushStatus; }
[ "public", "function", "flush", "(", ")", "{", "if", "(", "empty", "(", "$", "this", "->", "memcache", ")", ")", "{", "return", "false", ";", "}", "$", "flushStatus", "=", "$", "this", "->", "memcache", "->", "flush", "(", ")", ";", "return", "$", ...
Flush the server @return boolean
[ "Flush", "the", "server" ]
7bbf9fe6519071fe14d382e98925cd3e10010a3a
https://github.com/SlabPHP/cache-manager/blob/7bbf9fe6519071fe14d382e98925cd3e10010a3a/src/Providers/Memcache.php#L113-L122
train
dms-org/common.structure
src/FileSystem/File.php
File.createTemporary
public static function createTemporary(string $data, string $clientFileName = null) : File { $tempFilePath = tempnam(sys_get_temp_dir(), 'dms'); file_put_contents($tempFilePath, $data); return new self($tempFilePath, $clientFileName); }
php
public static function createTemporary(string $data, string $clientFileName = null) : File { $tempFilePath = tempnam(sys_get_temp_dir(), 'dms'); file_put_contents($tempFilePath, $data); return new self($tempFilePath, $clientFileName); }
[ "public", "static", "function", "createTemporary", "(", "string", "$", "data", ",", "string", "$", "clientFileName", "=", "null", ")", ":", "File", "{", "$", "tempFilePath", "=", "tempnam", "(", "sys_get_temp_dir", "(", ")", ",", "'dms'", ")", ";", "file_p...
Create a temporary temporary file. @param string $data @param string|null $clientFileName @return File
[ "Create", "a", "temporary", "temporary", "file", "." ]
23f122182f60df5ec847047a81a39c8aab019ff1
https://github.com/dms-org/common.structure/blob/23f122182f60df5ec847047a81a39c8aab019ff1/src/FileSystem/File.php#L76-L82
train
koolkode/stream
src/ChunkDecodedOutputStream.php
ChunkDecodedOutputStream.readChunkHeader
protected function readChunkHeader() { static $m = NULL; if(preg_match("'([a-fA-F0-9]+).*\r\n'", $this->buffer, $m)) { $this->remainder = hexdec($m[1]); $this->buffer = (string)substr($this->buffer, strlen($m[0])); } else { $this->remainder = 0; } }
php
protected function readChunkHeader() { static $m = NULL; if(preg_match("'([a-fA-F0-9]+).*\r\n'", $this->buffer, $m)) { $this->remainder = hexdec($m[1]); $this->buffer = (string)substr($this->buffer, strlen($m[0])); } else { $this->remainder = 0; } }
[ "protected", "function", "readChunkHeader", "(", ")", "{", "static", "$", "m", "=", "NULL", ";", "if", "(", "preg_match", "(", "\"'([a-fA-F0-9]+).*\\r\\n'\"", ",", "$", "this", "->", "buffer", ",", "$", "m", ")", ")", "{", "$", "this", "->", "remainder",...
Compute number of remaining bytes using chunk header
[ "Compute", "number", "of", "remaining", "bytes", "using", "chunk", "header" ]
05e83efd76e1cb9e40a972711986b4a7e38bc141
https://github.com/koolkode/stream/blob/05e83efd76e1cb9e40a972711986b4a7e38bc141/src/ChunkDecodedOutputStream.php#L87-L100
train
agentmedia/phine-core
src/Core/Modules/Backend/JsonAreaList.php
JsonAreaList.BeforeDelete
protected function BeforeDelete() { foreach (self::$deleteHooks as $hook) { $hook->BeforeDelete($this->item); } $logger = new Logger(BackendModule::Guard()->GetUser()); $logger->ReportAreaAction($this->item, Action::Delete()); }
php
protected function BeforeDelete() { foreach (self::$deleteHooks as $hook) { $hook->BeforeDelete($this->item); } $logger = new Logger(BackendModule::Guard()->GetUser()); $logger->ReportAreaAction($this->item, Action::Delete()); }
[ "protected", "function", "BeforeDelete", "(", ")", "{", "foreach", "(", "self", "::", "$", "deleteHooks", "as", "$", "hook", ")", "{", "$", "hook", "->", "BeforeDelete", "(", "$", "this", "->", "item", ")", ";", "}", "$", "logger", "=", "new", "Logge...
Execute delete hooks
[ "Execute", "delete", "hooks" ]
38c1be8d03ebffae950d00a96da3c612aff67832
https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/JsonAreaList.php#L45-L53
train
wobblecode/WobbleCodeUserBundle
OAuth/OAuthMapper.php
OAuthMapper.normalizeData
public function normalizeData(PathUserResponse $response) { $return = $response->getResponse(); $provider = $response->getResourceOwner()->getName(); $token = $response->getAccessToken(); switch ($provider) { case 'google': $data = $this->normalizeGo...
php
public function normalizeData(PathUserResponse $response) { $return = $response->getResponse(); $provider = $response->getResourceOwner()->getName(); $token = $response->getAccessToken(); switch ($provider) { case 'google': $data = $this->normalizeGo...
[ "public", "function", "normalizeData", "(", "PathUserResponse", "$", "response", ")", "{", "$", "return", "=", "$", "response", "->", "getResponse", "(", ")", ";", "$", "provider", "=", "$", "response", "->", "getResourceOwner", "(", ")", "->", "getName", ...
Get oAuth data and normalize it to same var names @param HttpMessageInterface $response oAuth response @return array with normalized data
[ "Get", "oAuth", "data", "and", "normalize", "it", "to", "same", "var", "names" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/OAuth/OAuthMapper.php#L72-L96
train
wobblecode/WobbleCodeUserBundle
OAuth/OAuthMapper.php
OAuthMapper.normalizeGoogle
public function normalizeGoogle($return) { $genders = [ 'male' => 'M', 'female' => 'F' ]; $data = [ 'id' => $return['id'], 'name' => $this->ensureUtf8($return['name']), 'firstName' => $this->ensureUtf8($re...
php
public function normalizeGoogle($return) { $genders = [ 'male' => 'M', 'female' => 'F' ]; $data = [ 'id' => $return['id'], 'name' => $this->ensureUtf8($return['name']), 'firstName' => $this->ensureUtf8($re...
[ "public", "function", "normalizeGoogle", "(", "$", "return", ")", "{", "$", "genders", "=", "[", "'male'", "=>", "'M'", ",", "'female'", "=>", "'F'", "]", ";", "$", "data", "=", "[", "'id'", "=>", "$", "return", "[", "'id'", "]", ",", "'name'", "=>...
Mapping data from Google @param Reponse $response @return array contains normalized user data
[ "Mapping", "data", "from", "Google" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/OAuth/OAuthMapper.php#L105-L148
train
wobblecode/WobbleCodeUserBundle
OAuth/OAuthMapper.php
OAuthMapper.normalizeFacebook
public function normalizeFacebook($return) { $genders = [ 'male' => 'M', 'female' => 'F' ]; $data = [ 'id' => $return['id'], 'name' => $return['name'], 'firstName' => $return['first_name'...
php
public function normalizeFacebook($return) { $genders = [ 'male' => 'M', 'female' => 'F' ]; $data = [ 'id' => $return['id'], 'name' => $return['name'], 'firstName' => $return['first_name'...
[ "public", "function", "normalizeFacebook", "(", "$", "return", ")", "{", "$", "genders", "=", "[", "'male'", "=>", "'M'", ",", "'female'", "=>", "'F'", "]", ";", "$", "data", "=", "[", "'id'", "=>", "$", "return", "[", "'id'", "]", ",", "'name'", "...
Mapping data from facbook @todo replace Buzz with Guzzle @param Reponse $response @return array contains normalized user data
[ "Mapping", "data", "from", "facbook" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/OAuth/OAuthMapper.php#L159-L200
train
wobblecode/WobbleCodeUserBundle
OAuth/OAuthMapper.php
OAuthMapper.normalizeGithub
public function normalizeGithub($return, $token) { $data = [ 'id' => $return['id'], 'username' => $return['login'], 'name' => $return['name'], 'email' => $return['email'], 'gravatar' => $ret...
php
public function normalizeGithub($return, $token) { $data = [ 'id' => $return['id'], 'username' => $return['login'], 'name' => $return['name'], 'email' => $return['email'], 'gravatar' => $ret...
[ "public", "function", "normalizeGithub", "(", "$", "return", ",", "$", "token", ")", "{", "$", "data", "=", "[", "'id'", "=>", "$", "return", "[", "'id'", "]", ",", "'username'", "=>", "$", "return", "[", "'login'", "]", ",", "'name'", "=>", "$", "...
Mapping data from github @todo replace Buzz with Guzzle @param Reponse $response @return array contains normalized user data
[ "Mapping", "data", "from", "github" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/OAuth/OAuthMapper.php#L211-L249
train
wobblecode/WobbleCodeUserBundle
OAuth/OAuthMapper.php
OAuthMapper.httpRequest
protected function httpRequest($url, $resource = '/', $content = null, $headers = [], $method = 'GET') { $request = new HttpRequest($method, $resource, $url); $response = new HttpResponse(); $headers = array_merge(['User-Agent: WobbleCodeUserBundle'], $headers); $request->setHeader...
php
protected function httpRequest($url, $resource = '/', $content = null, $headers = [], $method = 'GET') { $request = new HttpRequest($method, $resource, $url); $response = new HttpResponse(); $headers = array_merge(['User-Agent: WobbleCodeUserBundle'], $headers); $request->setHeader...
[ "protected", "function", "httpRequest", "(", "$", "url", ",", "$", "resource", "=", "'/'", ",", "$", "content", "=", "null", ",", "$", "headers", "=", "[", "]", ",", "$", "method", "=", "'GET'", ")", "{", "$", "request", "=", "new", "HttpRequest", ...
Performs an HTTP request @todo replace Buzz with Guzzle @param string $url The url to fetch @param string $content The content of the request @param array $headers The headers of the request @param string $method The HTTP method to use @return HttpMessageInterface The response content
[ "Performs", "an", "HTTP", "request" ]
7b8206f8b4a50fbc61f7bfe4f83eb466cad96440
https://github.com/wobblecode/WobbleCodeUserBundle/blob/7b8206f8b4a50fbc61f7bfe4f83eb466cad96440/OAuth/OAuthMapper.php#L263-L279
train
agentmedia/phine-builtin
src/BuiltIn/Logic/Logging/ContainerReferenceResolver.php
ContainerReferenceResolver.GetReferencedContainer
public function GetReferencedContainer(Content $content) { $contentContainer = ContentContainer::Schema()->ByContent($content); return $contentContainer ? $contentContainer->GetContainer() : null; }
php
public function GetReferencedContainer(Content $content) { $contentContainer = ContentContainer::Schema()->ByContent($content); return $contentContainer ? $contentContainer->GetContainer() : null; }
[ "public", "function", "GetReferencedContainer", "(", "Content", "$", "content", ")", "{", "$", "contentContainer", "=", "ContentContainer", "::", "Schema", "(", ")", "->", "ByContent", "(", "$", "content", ")", ";", "return", "$", "contentContainer", "?", "$",...
Gets a container referenced by a content @param Content $content The content @return Container Returns The referenced container, if exists
[ "Gets", "a", "container", "referenced", "by", "a", "content" ]
4dd05bc406a71e997bd4eaa16b12e23dbe62a456
https://github.com/agentmedia/phine-builtin/blob/4dd05bc406a71e997bd4eaa16b12e23dbe62a456/src/BuiltIn/Logic/Logging/ContainerReferenceResolver.php#L15-L19
train
erenmustafaozdal/laravel-modules-base
src/Controllers/BaseUserController.php
BaseUserController.activationComplete
protected function activationComplete() { try { $activation = Activation::create($this->model); if ( ! Activation::complete($this->model, $activation->code)) { throw new ActivateException($this->model->id, $activation->code, 'fail'); } if ($th...
php
protected function activationComplete() { try { $activation = Activation::create($this->model); if ( ! Activation::complete($this->model, $activation->code)) { throw new ActivateException($this->model->id, $activation->code, 'fail'); } if ($th...
[ "protected", "function", "activationComplete", "(", ")", "{", "try", "{", "$", "activation", "=", "Activation", "::", "create", "(", "$", "this", "->", "model", ")", ";", "if", "(", "!", "Activation", "::", "complete", "(", "$", "this", "->", "model", ...
set activation complete @return boolean
[ "set", "activation", "complete" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Controllers/BaseUserController.php#L64-L85
train
erenmustafaozdal/laravel-modules-base
src/Controllers/BaseUserController.php
BaseUserController.activateGroupAction
protected function activateGroupAction($class) { $users = $class::whereIn('id', $this->request->id)->get(); foreach($users as $user) { $this->setModel($user); $this->activationComplete(); } return true; }
php
protected function activateGroupAction($class) { $users = $class::whereIn('id', $this->request->id)->get(); foreach($users as $user) { $this->setModel($user); $this->activationComplete(); } return true; }
[ "protected", "function", "activateGroupAction", "(", "$", "class", ")", "{", "$", "users", "=", "$", "class", "::", "whereIn", "(", "'id'", ",", "$", "this", "->", "request", "->", "id", ")", "->", "get", "(", ")", ";", "foreach", "(", "$", "users", ...
activate group action @param $class @return boolean
[ "activate", "group", "action" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Controllers/BaseUserController.php#L122-L130
train
erenmustafaozdal/laravel-modules-base
src/Controllers/BaseUserController.php
BaseUserController.notActivateGroupAction
protected function notActivateGroupAction($class) { $users = $class::whereIn('id', $this->request->id)->get(); foreach($users as $user) { $this->setModel($user); $this->activationRemove(); } return true; }
php
protected function notActivateGroupAction($class) { $users = $class::whereIn('id', $this->request->id)->get(); foreach($users as $user) { $this->setModel($user); $this->activationRemove(); } return true; }
[ "protected", "function", "notActivateGroupAction", "(", "$", "class", ")", "{", "$", "users", "=", "$", "class", "::", "whereIn", "(", "'id'", ",", "$", "this", "->", "request", "->", "id", ")", "->", "get", "(", ")", ";", "foreach", "(", "$", "users...
not activate group action @param $class @return boolean
[ "not", "activate", "group", "action" ]
c26600543817642926bcf16ada84009e00d784e0
https://github.com/erenmustafaozdal/laravel-modules-base/blob/c26600543817642926bcf16ada84009e00d784e0/src/Controllers/BaseUserController.php#L138-L146
train
wb-crowdfusion/crowdfusion
system/context/ClassLoader.php
ClassLoader.addDirectory
public static function addDirectory($directory, $extensionToFind = '.php', $bypassDirectories = '') { self::register(); $dir = new SplFileInfo($directory); if (!$dir->isDir()) { throw new ApplicationContextException('Cannot add directory to ClassLoader, directory does not exist: ' . $directory); ...
php
public static function addDirectory($directory, $extensionToFind = '.php', $bypassDirectories = '') { self::register(); $dir = new SplFileInfo($directory); if (!$dir->isDir()) { throw new ApplicationContextException('Cannot add directory to ClassLoader, directory does not exist: ' . $directory); ...
[ "public", "static", "function", "addDirectory", "(", "$", "directory", ",", "$", "extensionToFind", "=", "'.php'", ",", "$", "bypassDirectories", "=", "''", ")", "{", "self", "::", "register", "(", ")", ";", "$", "dir", "=", "new", "SplFileInfo", "(", "$...
Scans a directory recursively for all files with a particular extension and will add any classes it finds with the full path. @param string $directory @param string $extensionToFind @param string $bypassDirectories @throws ApplicationContextException @return void
[ "Scans", "a", "directory", "recursively", "for", "all", "files", "with", "a", "particular", "extension", "and", "will", "add", "any", "classes", "it", "finds", "with", "the", "full", "path", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/context/ClassLoader.php#L29-L65
train
wb-crowdfusion/crowdfusion
system/context/ClassLoader.php
ClassLoader.addFile
public static function addFile($filePath, $extensionToFind = '.php') { if (!$filePath instanceof SplFileInfo) { $filePath = new SplFileInfo($filePath); } $firstChar = substr($filePath->getBasename(), 0, 1); $extension = substr($filePath->getFilename(), strlen($extensionToFind)*-1); $className = ...
php
public static function addFile($filePath, $extensionToFind = '.php') { if (!$filePath instanceof SplFileInfo) { $filePath = new SplFileInfo($filePath); } $firstChar = substr($filePath->getBasename(), 0, 1); $extension = substr($filePath->getFilename(), strlen($extensionToFind)*-1); $className = ...
[ "public", "static", "function", "addFile", "(", "$", "filePath", ",", "$", "extensionToFind", "=", "'.php'", ")", "{", "if", "(", "!", "$", "filePath", "instanceof", "SplFileInfo", ")", "{", "$", "filePath", "=", "new", "SplFileInfo", "(", "$", "filePath",...
Evaluates a file and if it looks like a php class it will add it. This prevents odd php files that aren't classes from being auto loaded like "bootstrap.php" or "autoload.php", etc. @param string $filePath @param string $extensionToFind @return void
[ "Evaluates", "a", "file", "and", "if", "it", "looks", "like", "a", "php", "class", "it", "will", "add", "it", ".", "This", "prevents", "odd", "php", "files", "that", "aren", "t", "classes", "from", "being", "auto", "loaded", "like", "bootstrap", ".", "...
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/context/ClassLoader.php#L123-L135
train
wb-crowdfusion/crowdfusion
system/context/ClassLoader.php
ClassLoader.addClass
public static function addClass($className, $filePath) { if (self::classExists($className)) { throw new ApplicationContextException('Cannot add class file [' . $filePath . '], class with same name already defined by [' . self::$classNames[$className] . ']'); } self::$classNames[$className] ...
php
public static function addClass($className, $filePath) { if (self::classExists($className)) { throw new ApplicationContextException('Cannot add class file [' . $filePath . '], class with same name already defined by [' . self::$classNames[$className] . ']'); } self::$classNames[$className] ...
[ "public", "static", "function", "addClass", "(", "$", "className", ",", "$", "filePath", ")", "{", "if", "(", "self", "::", "classExists", "(", "$", "className", ")", ")", "{", "throw", "new", "ApplicationContextException", "(", "'Cannot add class file ['", "....
Adds a class name and file path. @param string $className @param string $filePath @throws ApplicationContextException @return void
[ "Adds", "a", "class", "name", "and", "file", "path", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/context/ClassLoader.php#L148-L155
train
wb-crowdfusion/crowdfusion
system/context/ClassLoader.php
ClassLoader.isVcsFile
public static function isVcsFile($fileName) { foreach (self::$vcsPatterns as $pattern) { if (strpos($fileName, $pattern) !== false) { return true; } } return false; }
php
public static function isVcsFile($fileName) { foreach (self::$vcsPatterns as $pattern) { if (strpos($fileName, $pattern) !== false) { return true; } } return false; }
[ "public", "static", "function", "isVcsFile", "(", "$", "fileName", ")", "{", "foreach", "(", "self", "::", "$", "vcsPatterns", "as", "$", "pattern", ")", "{", "if", "(", "strpos", "(", "$", "fileName", ",", "$", "pattern", ")", "!==", "false", ")", "...
Returns true if file path contains a vcs name. @param string $fileName @return bool
[ "Returns", "true", "if", "file", "path", "contains", "a", "vcs", "name", "." ]
8cad7988f046a6fefbed07d026cb4ae6706c1217
https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/context/ClassLoader.php#L270-L278
train
apioo/psx-validate
src/Filter/Html.php
Html.apply
public function apply($value) { return htmlspecialchars((string) $value, $this->quoteStyle, $this->charset, $this->doubleEncode); }
php
public function apply($value) { return htmlspecialchars((string) $value, $this->quoteStyle, $this->charset, $this->doubleEncode); }
[ "public", "function", "apply", "(", "$", "value", ")", "{", "return", "htmlspecialchars", "(", "(", "string", ")", "$", "value", ",", "$", "this", "->", "quoteStyle", ",", "$", "this", "->", "charset", ",", "$", "this", "->", "doubleEncode", ")", ";", ...
Converts special characters to HTML entities @param mixed $value @return boolean
[ "Converts", "special", "characters", "to", "HTML", "entities" ]
4860c6a2c7f7ca52d3bd6d7e6ec7d6a7ddcfd83d
https://github.com/apioo/psx-validate/blob/4860c6a2c7f7ca52d3bd6d7e6ec7d6a7ddcfd83d/src/Filter/Html.php#L51-L54
train
jabernardo/lollipop-php
Library/SQL/Connection/MySQL.php
MySQL.__connect
private function __connect() { if (!is_null($db)) return true; $config = Config::get('db'); if (is_null($config)) { throw new \Lollipop\Exception\Configuration('Lollipop is initialized with wrong database configuration'); } $host = isset($config->host) ? $config->...
php
private function __connect() { if (!is_null($db)) return true; $config = Config::get('db'); if (is_null($config)) { throw new \Lollipop\Exception\Configuration('Lollipop is initialized with wrong database configuration'); } $host = isset($config->host) ? $config->...
[ "private", "function", "__connect", "(", ")", "{", "if", "(", "!", "is_null", "(", "$", "db", ")", ")", "return", "true", ";", "$", "config", "=", "Config", "::", "get", "(", "'db'", ")", ";", "if", "(", "is_null", "(", "$", "config", ")", ")", ...
Connect to MySQL server @throws \Lollipop\Exception\Configuration @throws \Lollipop\Exception\Connection @return boolean
[ "Connect", "to", "MySQL", "server" ]
004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5
https://github.com/jabernardo/lollipop-php/blob/004d80b21f7246bb3e08c7b9f74a165b0d3ca0f5/Library/SQL/Connection/MySQL.php#L37-L59
train
phpffcms/ffcms-core
src/Traits/ModelValidator.php
ModelValidator.initialize
public function initialize($csrf = false) { $this->_tokenRequired = $csrf; if ($csrf) { // get current token value from session $currentToken = App::$Session->get('_csrf_token', false); // set new token value to session $newToken = Crypt::randomString(...
php
public function initialize($csrf = false) { $this->_tokenRequired = $csrf; if ($csrf) { // get current token value from session $currentToken = App::$Session->get('_csrf_token', false); // set new token value to session $newToken = Crypt::randomString(...
[ "public", "function", "initialize", "(", "$", "csrf", "=", "false", ")", "{", "$", "this", "->", "_tokenRequired", "=", "$", "csrf", ";", "if", "(", "$", "csrf", ")", "{", "// get current token value from session", "$", "currentToken", "=", "App", "::", "$...
Initialize validator. Set csrf protection token from request data if available. @param bool $csrf
[ "Initialize", "validator", ".", "Set", "csrf", "protection", "token", "from", "request", "data", "if", "available", "." ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Traits/ModelValidator.php#L32-L51
train
phpffcms/ffcms-core
src/Traits/ModelValidator.php
ModelValidator.send
final public function send() { if (!Str::equalIgnoreCase($this->_sendMethod, App::$Request->getMethod())) { return false; } return $this->getRequest('submit', $this->_sendMethod) !== null; }
php
final public function send() { if (!Str::equalIgnoreCase($this->_sendMethod, App::$Request->getMethod())) { return false; } return $this->getRequest('submit', $this->_sendMethod) !== null; }
[ "final", "public", "function", "send", "(", ")", "{", "if", "(", "!", "Str", "::", "equalIgnoreCase", "(", "$", "this", "->", "_sendMethod", ",", "App", "::", "$", "Request", "->", "getMethod", "(", ")", ")", ")", "{", "return", "false", ";", "}", ...
Check if model get POST-based request as submit of SEND data @return bool @throws \InvalidArgumentException
[ "Check", "if", "model", "get", "POST", "-", "based", "request", "as", "submit", "of", "SEND", "data" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Traits/ModelValidator.php#L270-L277
train
phpffcms/ffcms-core
src/Traits/ModelValidator.php
ModelValidator.getRequest
public function getRequest($param, $method = null) { if ($method === null) { $method = $this->_sendMethod; } $method = Str::lowerCase($method); // get root request as array or string switch ($method) { case 'get': $request = App::$Requ...
php
public function getRequest($param, $method = null) { if ($method === null) { $method = $this->_sendMethod; } $method = Str::lowerCase($method); // get root request as array or string switch ($method) { case 'get': $request = App::$Requ...
[ "public", "function", "getRequest", "(", "$", "param", ",", "$", "method", "=", "null", ")", "{", "if", "(", "$", "method", "===", "null", ")", "{", "$", "method", "=", "$", "this", "->", "_sendMethod", ";", "}", "$", "method", "=", "Str", "::", ...
Get input value based on param path and request method @param string $param @param string|null $method @return mixed
[ "Get", "input", "value", "based", "on", "param", "path", "and", "request", "method" ]
44a309553ef9f115ccfcfd71f2ac6e381c612082
https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Traits/ModelValidator.php#L307-L346
train
brightnucleus/options-store
src/Exception/InvalidOptionRepository.php
InvalidOptionRepository.fromRepository
public static function fromRepository($repository) { $message = sprintf( 'Could not add invalid OptionRepository of type "%1$s" to AggregateOptionRepository.', is_object($repository) ? get_class($repository) : gettype($repository) ); r...
php
public static function fromRepository($repository) { $message = sprintf( 'Could not add invalid OptionRepository of type "%1$s" to AggregateOptionRepository.', is_object($repository) ? get_class($repository) : gettype($repository) ); r...
[ "public", "static", "function", "fromRepository", "(", "$", "repository", ")", "{", "$", "message", "=", "sprintf", "(", "'Could not add invalid OptionRepository of type \"%1$s\" to AggregateOptionRepository.'", ",", "is_object", "(", "$", "repository", ")", "?", "get_cla...
Get a new exception based on the type of an invalid repository. @since 0.1.0 @param mixed $repository Repository that was tried to be added. @return static
[ "Get", "a", "new", "exception", "based", "on", "the", "type", "of", "an", "invalid", "repository", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/Exception/InvalidOptionRepository.php#L42-L52
train
brightnucleus/options-store
src/Exception/InvalidOptionRepository.php
InvalidOptionRepository.fromInstantiationException
public static function fromInstantiationException($class, Exception $exception) { $message = sprintf( 'Could not instantiate OptionRepository of type "%1$s". Reason: %2$s', is_object($class) ? get_class($class) : gettype($class), $exception...
php
public static function fromInstantiationException($class, Exception $exception) { $message = sprintf( 'Could not instantiate OptionRepository of type "%1$s". Reason: %2$s', is_object($class) ? get_class($class) : gettype($class), $exception...
[ "public", "static", "function", "fromInstantiationException", "(", "$", "class", ",", "Exception", "$", "exception", ")", "{", "$", "message", "=", "sprintf", "(", "'Could not instantiate OptionRepository of type \"%1$s\". Reason: %2$s'", ",", "is_object", "(", "$", "cl...
Get a new exception based on an exception that was thrown during instantiation of a class. @since 0.1.4 @param mixed $class Class that was tried to be instantiated. @param Exception $exception Exception that was thrown during instantiation. @return static
[ "Get", "a", "new", "exception", "based", "on", "an", "exception", "that", "was", "thrown", "during", "instantiation", "of", "a", "class", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/Exception/InvalidOptionRepository.php#L64-L75
train
brightnucleus/options-store
src/Exception/InvalidOptionRepository.php
InvalidOptionRepository.fromConfig
public static function fromConfig(Config $config) { $message = sprintf( 'Could not instantiate OptionRepository from Config with starting key "%1$s".', empty($config->getKeys()) ? '<none>' : $config->getKeys()[0] ); return new static($...
php
public static function fromConfig(Config $config) { $message = sprintf( 'Could not instantiate OptionRepository from Config with starting key "%1$s".', empty($config->getKeys()) ? '<none>' : $config->getKeys()[0] ); return new static($...
[ "public", "static", "function", "fromConfig", "(", "Config", "$", "config", ")", "{", "$", "message", "=", "sprintf", "(", "'Could not instantiate OptionRepository from Config with starting key \"%1$s\".'", ",", "empty", "(", "$", "config", "->", "getKeys", "(", ")", ...
Get a new exception based on a Config that did not produce a valid repository. @since 0.1.0 @param Config $config Config instance that was used. @return static
[ "Get", "a", "new", "exception", "based", "on", "a", "Config", "that", "did", "not", "produce", "a", "valid", "repository", "." ]
9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1
https://github.com/brightnucleus/options-store/blob/9a9ef2a160bbacd69fe3e9db0be8ed89e6905ef1/src/Exception/InvalidOptionRepository.php#L86-L96
train
dkd/enumeration
src/Enumeration.php
Enumeration.setValue
protected function setValue($value) { $enumKey = array_search((string) $value, static::$enumConstants[get_class($this)]); if ($enumKey === false) { throw new Exception\InvalidEnumerationValueException( sprintf('Invalid value %s for %s', $value, __CLASS__), ...
php
protected function setValue($value) { $enumKey = array_search((string) $value, static::$enumConstants[get_class($this)]); if ($enumKey === false) { throw new Exception\InvalidEnumerationValueException( sprintf('Invalid value %s for %s', $value, __CLASS__), ...
[ "protected", "function", "setValue", "(", "$", "value", ")", "{", "$", "enumKey", "=", "array_search", "(", "(", "string", ")", "$", "value", ",", "static", "::", "$", "enumConstants", "[", "get_class", "(", "$", "this", ")", "]", ")", ";", "if", "("...
Set the Enumeration value to the associated enumeration value by a loose comparison. The value, that is used as the enumeration value, will be of the same type like defined in the enumeration @param mixed $value @throws Exception\InvalidEnumerationValueException
[ "Set", "the", "Enumeration", "value", "to", "the", "associated", "enumeration", "value", "by", "a", "loose", "comparison", ".", "The", "value", "that", "is", "used", "as", "the", "enumeration", "value", "will", "be", "of", "the", "same", "type", "like", "d...
7e6d05ac383da5f7e968c7e011d602c5a4d7a1de
https://github.com/dkd/enumeration/blob/7e6d05ac383da5f7e968c7e011d602c5a4d7a1de/src/Enumeration.php#L127-L137
train
dkd/enumeration
src/Enumeration.php
Enumeration.isValid
protected function isValid($value) { $value = (string) $value; foreach (static::$enumConstants[get_class($this)] as $constantValue) { if ($value === (string) $constantValue) { return true; } } return false; }
php
protected function isValid($value) { $value = (string) $value; foreach (static::$enumConstants[get_class($this)] as $constantValue) { if ($value === (string) $constantValue) { return true; } } return false; }
[ "protected", "function", "isValid", "(", "$", "value", ")", "{", "$", "value", "=", "(", "string", ")", "$", "value", ";", "foreach", "(", "static", "::", "$", "enumConstants", "[", "get_class", "(", "$", "this", ")", "]", "as", "$", "constantValue", ...
Check if the value on this enum is a valid value for the enum @param mixed $value @return boolean
[ "Check", "if", "the", "value", "on", "this", "enum", "is", "a", "valid", "value", "for", "the", "enum" ]
7e6d05ac383da5f7e968c7e011d602c5a4d7a1de
https://github.com/dkd/enumeration/blob/7e6d05ac383da5f7e968c7e011d602c5a4d7a1de/src/Enumeration.php#L145-L154
train
dkd/enumeration
src/Enumeration.php
Enumeration.getConstants
public static function getConstants($include_default = false) { static::loadValues(); $enumConstants = static::$enumConstants[get_called_class()]; if (!$include_default) { unset($enumConstants['__DEFAULT']); } return $enumConstants; }
php
public static function getConstants($include_default = false) { static::loadValues(); $enumConstants = static::$enumConstants[get_called_class()]; if (!$include_default) { unset($enumConstants['__DEFAULT']); } return $enumConstants; }
[ "public", "static", "function", "getConstants", "(", "$", "include_default", "=", "false", ")", "{", "static", "::", "loadValues", "(", ")", ";", "$", "enumConstants", "=", "static", "::", "$", "enumConstants", "[", "get_called_class", "(", ")", "]", ";", ...
Get the valid values for this enum Defaults to constants you define in your subclass override to provide custom functionality @param boolean $include_default @return array
[ "Get", "the", "valid", "values", "for", "this", "enum", "Defaults", "to", "constants", "you", "define", "in", "your", "subclass", "override", "to", "provide", "custom", "functionality" ]
7e6d05ac383da5f7e968c7e011d602c5a4d7a1de
https://github.com/dkd/enumeration/blob/7e6d05ac383da5f7e968c7e011d602c5a4d7a1de/src/Enumeration.php#L164-L172
train
dkd/enumeration
src/Enumeration.php
Enumeration.cast
public static function cast($value) { $currentClass = get_called_class(); if (!is_object($value) || get_class($value) !== $currentClass) { $value = new $currentClass($value); } return $value; }
php
public static function cast($value) { $currentClass = get_called_class(); if (!is_object($value) || get_class($value) !== $currentClass) { $value = new $currentClass($value); } return $value; }
[ "public", "static", "function", "cast", "(", "$", "value", ")", "{", "$", "currentClass", "=", "get_called_class", "(", ")", ";", "if", "(", "!", "is_object", "(", "$", "value", ")", "||", "get_class", "(", "$", "value", ")", "!==", "$", "currentClass"...
Cast value to enumeration type @param mixed $value Value that has to be casted @return static
[ "Cast", "value", "to", "enumeration", "type" ]
7e6d05ac383da5f7e968c7e011d602c5a4d7a1de
https://github.com/dkd/enumeration/blob/7e6d05ac383da5f7e968c7e011d602c5a4d7a1de/src/Enumeration.php#L180-L187
train
urmaul/rss-pipes
src/Controller.php
Controller.readConfig
public function readConfig($pipe) { $filename = $this->pipesDir . '/' . $pipe; if (file_exists($filename . '.yml')) { return Yaml::parse(file_get_contents($filename . '.yml')); } elseif ($this->allowPhp && file_exists($filename . '.php')) { return include...
php
public function readConfig($pipe) { $filename = $this->pipesDir . '/' . $pipe; if (file_exists($filename . '.yml')) { return Yaml::parse(file_get_contents($filename . '.yml')); } elseif ($this->allowPhp && file_exists($filename . '.php')) { return include...
[ "public", "function", "readConfig", "(", "$", "pipe", ")", "{", "$", "filename", "=", "$", "this", "->", "pipesDir", ".", "'/'", ".", "$", "pipe", ";", "if", "(", "file_exists", "(", "$", "filename", ".", "'.yml'", ")", ")", "{", "return", "Yaml", ...
Reads pipe config from file. @param string $pipe pipe name @return array @throws Exception
[ "Reads", "pipe", "config", "from", "file", "." ]
9e11e9a5315e8d11764c2784c02ffa02dee5639f
https://github.com/urmaul/rss-pipes/blob/9e11e9a5315e8d11764c2784c02ffa02dee5639f/src/Controller.php#L41-L53
train
FusePump/cli.php
lib/FusePump/Cli/Utils.php
Utils.pregMatchArray
public static function pregMatchArray($patterns, $subject) { if (!is_array($patterns)) { throw new \Exception('$patterns is not an array'); } if (!is_string($subject)) { throw new \Exception('$subject is not a string'); } foreach ($patterns as $patte...
php
public static function pregMatchArray($patterns, $subject) { if (!is_array($patterns)) { throw new \Exception('$patterns is not an array'); } if (!is_string($subject)) { throw new \Exception('$subject is not a string'); } foreach ($patterns as $patte...
[ "public", "static", "function", "pregMatchArray", "(", "$", "patterns", ",", "$", "subject", ")", "{", "if", "(", "!", "is_array", "(", "$", "patterns", ")", ")", "{", "throw", "new", "\\", "Exception", "(", "'$patterns is not an array'", ")", ";", "}", ...
Preg match array Match subject to an array of regex patterns @param array $patterns - array of regex patterns @param string $subject - string to test patterns on @static @return bool - true if found, false otherwise @throws \Exception - if pattern is not an array or subject not a string
[ "Preg", "match", "array" ]
2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4
https://github.com/FusePump/cli.php/blob/2cc92f09ce7b2f73d5cbc09f5ae4f31f3f9ae3b4/lib/FusePump/Cli/Utils.php#L133-L150
train
shgysk8zer0/core_api
traits/auth/basic.php
Basic.requireBasicLogin
final public function requireBasicLogin($realm = 'Restricted') { if (! ( array_key_exists('PHP_AUTH_USER', $_SERVER) and array_key_exists('PHP_AUTH_PW', $_SERVER) )) { $this->_basicAuthFailed($realm); } else { $this->loginWith([ 'user' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP...
php
final public function requireBasicLogin($realm = 'Restricted') { if (! ( array_key_exists('PHP_AUTH_USER', $_SERVER) and array_key_exists('PHP_AUTH_PW', $_SERVER) )) { $this->_basicAuthFailed($realm); } else { $this->loginWith([ 'user' => $_SERVER['PHP_AUTH_USER'], 'password' => $_SERVER['PHP...
[ "final", "public", "function", "requireBasicLogin", "(", "$", "realm", "=", "'Restricted'", ")", "{", "if", "(", "!", "(", "array_key_exists", "(", "'PHP_AUTH_USER'", ",", "$", "_SERVER", ")", "and", "array_key_exists", "(", "'PHP_AUTH_PW'", ",", "$", "_SERVER...
Check for Basic Auth credentials and attempt to login if present @param string $realm The "realm" to pass along if asking for credentials @return void
[ "Check", "for", "Basic", "Auth", "credentials", "and", "attempt", "to", "login", "if", "present" ]
9e9b8baf761af874b95256ad2462e55fbb2b2e58
https://github.com/shgysk8zer0/core_api/blob/9e9b8baf761af874b95256ad2462e55fbb2b2e58/traits/auth/basic.php#L36-L53
train
ZFury/framework
library/Mvc/Controller/AbstractCrudController.php
AbstractCrudController.loadEntity
protected function loadEntity() { $params = array_merge($this->params()->fromPost(), $this->params()->fromRoute()); if (empty($params['id'])) { throw new EntityNotFoundException('Bad Request'); } $objectManager = $this->getServiceLocator()->get('Doctrine\ORM\EntityManage...
php
protected function loadEntity() { $params = array_merge($this->params()->fromPost(), $this->params()->fromRoute()); if (empty($params['id'])) { throw new EntityNotFoundException('Bad Request'); } $objectManager = $this->getServiceLocator()->get('Doctrine\ORM\EntityManage...
[ "protected", "function", "loadEntity", "(", ")", "{", "$", "params", "=", "array_merge", "(", "$", "this", "->", "params", "(", ")", "->", "fromPost", "(", ")", ",", "$", "this", "->", "params", "(", ")", "->", "fromRoute", "(", ")", ")", ";", "if"...
Find entity by id @return mixed @throws \Doctrine\ORM\EntityNotFoundException
[ "Find", "entity", "by", "id" ]
eee4ca2a64d2d65490777b08be56c4c9b67bc892
https://github.com/ZFury/framework/blob/eee4ca2a64d2d65490777b08be56c4c9b67bc892/library/Mvc/Controller/AbstractCrudController.php#L148-L161
train
SagittariusX/Beluga.Translation
src/Beluga/Translation/Source/ArraySource.php
ArraySource.getTranslation
public function getTranslation( $identifier, $defaultTranslation = null ) : string { if ( $this->_useNumericId ) { // Not integer identifier. End here with an exception if ( ! \is_int( $identifier ) ) { throw new \InvalidArgumentException( 'Current ' . __CLASS__ ....
php
public function getTranslation( $identifier, $defaultTranslation = null ) : string { if ( $this->_useNumericId ) { // Not integer identifier. End here with an exception if ( ! \is_int( $identifier ) ) { throw new \InvalidArgumentException( 'Current ' . __CLASS__ ....
[ "public", "function", "getTranslation", "(", "$", "identifier", ",", "$", "defaultTranslation", "=", "null", ")", ":", "string", "{", "if", "(", "$", "this", "->", "_useNumericId", ")", "{", "// Not integer identifier. End here with an exception", "if", "(", "!", ...
Gets the translation with the defined identifier @param string|int $identifier @param string|null $defaultTranslation Is returned if the translation was not found @return string @throws \InvalidArgumentException If the $identifier is invalid
[ "Gets", "the", "translation", "with", "the", "defined", "identifier" ]
8f66c4fef6fa4494413972ca56bd8e13f5a7e444
https://github.com/SagittariusX/Beluga.Translation/blob/8f66c4fef6fa4494413972ca56bd8e13f5a7e444/src/Beluga/Translation/Source/ArraySource.php#L129-L220
train
SagittariusX/Beluga.Translation
src/Beluga/Translation/Source/ArraySource.php
ArraySource.getTranslations
public function getTranslations( $category = null ) : array { $translations = []; // If no category is defined (must be NULL) return all translations without a if ( \is_null( $category ) ) { foreach ( $this->_translations as $identifier => $transData ) { if ( ...
php
public function getTranslations( $category = null ) : array { $translations = []; // If no category is defined (must be NULL) return all translations without a if ( \is_null( $category ) ) { foreach ( $this->_translations as $identifier => $transData ) { if ( ...
[ "public", "function", "getTranslations", "(", "$", "category", "=", "null", ")", ":", "array", "{", "$", "translations", "=", "[", "]", ";", "// If no category is defined (must be NULL) return all translations without a", "if", "(", "\\", "is_null", "(", "$", "categ...
Gets all translations of an specific category. If not category is defined all translations of all categories are returned. @param string $category @return array
[ "Gets", "all", "translations", "of", "an", "specific", "category", ".", "If", "not", "category", "is", "defined", "all", "translations", "of", "all", "categories", "are", "returned", "." ]
8f66c4fef6fa4494413972ca56bd8e13f5a7e444
https://github.com/SagittariusX/Beluga.Translation/blob/8f66c4fef6fa4494413972ca56bd8e13f5a7e444/src/Beluga/Translation/Source/ArraySource.php#L229-L300
train
SagittariusX/Beluga.Translation
src/Beluga/Translation/Source/ArraySource.php
ArraySource.LoadFromFolder
public static function LoadFromFolder( string $folder, Locale $locale, bool $useNumericId = false ) { $languageFolderBase = rtrim( $folder, '\\/' ); if ( ! empty( $languageFolderBase ) ) { $languageFolderBase .= '/'; } $languageFile = $languageFolderBase . $locale->getLID() . '_' . $locale->getCI...
php
public static function LoadFromFolder( string $folder, Locale $locale, bool $useNumericId = false ) { $languageFolderBase = rtrim( $folder, '\\/' ); if ( ! empty( $languageFolderBase ) ) { $languageFolderBase .= '/'; } $languageFile = $languageFolderBase . $locale->getLID() . '_' . $locale->getCI...
[ "public", "static", "function", "LoadFromFolder", "(", "string", "$", "folder", ",", "Locale", "$", "locale", ",", "bool", "$", "useNumericId", "=", "false", ")", "{", "$", "languageFolderBase", "=", "rtrim", "(", "$", "folder", ",", "'\\\\/'", ")", ";", ...
Loads a translation array source from a specific folder that contains one or more locale depending PHP files. E.G: if the defined $folder is '/var/www/example.com/translations' and the declared Locale is de_DE.UTF-8 it tries to use: - /var/www/example.com/translations/de_DE.UTF-8.php - /var/www/example.com/translati...
[ "Loads", "a", "translation", "array", "source", "from", "a", "specific", "folder", "that", "contains", "one", "or", "more", "locale", "depending", "PHP", "files", "." ]
8f66c4fef6fa4494413972ca56bd8e13f5a7e444
https://github.com/SagittariusX/Beluga.Translation/blob/8f66c4fef6fa4494413972ca56bd8e13f5a7e444/src/Beluga/Translation/Source/ArraySource.php#L460-L493
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.add
public function add($productId, $count, $attributesAndValues = null, $additionalProducts = [], $combinationId = null) { if (!empty($attributesAndValues)) { $attributesAndValues = Json::decode($attributesAndValues); } if ($this->saveSelectedCombination) { $combination...
php
public function add($productId, $count, $attributesAndValues = null, $additionalProducts = [], $combinationId = null) { if (!empty($attributesAndValues)) { $attributesAndValues = Json::decode($attributesAndValues); } if ($this->saveSelectedCombination) { $combination...
[ "public", "function", "add", "(", "$", "productId", ",", "$", "count", ",", "$", "attributesAndValues", "=", "null", ",", "$", "additionalProducts", "=", "[", "]", ",", "$", "combinationId", "=", "null", ")", "{", "if", "(", "!", "empty", "(", "$", "...
Adds product to cart. @param $productId @param $count @param null $attributesAndValues @param array $additionalProducts @param null $combinationId
[ "Adds", "product", "to", "cart", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L104-L121
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.saveProductToDataBase
private function saveProductToDataBase($productId, $count, $attributesAndValues = null, $additionalProducts = null, $combinationId = null) { $order = $this->getIncompleteOrderFromDB(); if (\Yii::$app->getModule('shop')->enableCombinations) { if (!empty($attributesAndValues)) { ...
php
private function saveProductToDataBase($productId, $count, $attributesAndValues = null, $additionalProducts = null, $combinationId = null) { $order = $this->getIncompleteOrderFromDB(); if (\Yii::$app->getModule('shop')->enableCombinations) { if (!empty($attributesAndValues)) { ...
[ "private", "function", "saveProductToDataBase", "(", "$", "productId", ",", "$", "count", ",", "$", "attributesAndValues", "=", "null", ",", "$", "additionalProducts", "=", "null", ",", "$", "combinationId", "=", "null", ")", "{", "$", "order", "=", "$", "...
Saves product to database if the corresponding property is true. @param integer $productId @param integer $count @param array|null $attributesAndValues @param array|null $additionalProducts @param null $combinationId @throws Exception
[ "Saves", "product", "to", "database", "if", "the", "corresponding", "property", "is", "true", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L133-L183
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.getIncompleteOrderFromDB
private function getIncompleteOrderFromDB() { $order = Order::find()->where([ 'user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE]) ->one(); if (empty($order)) { $order = new Order(); $order->uid = $this->generate...
php
private function getIncompleteOrderFromDB() { $order = Order::find()->where([ 'user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE]) ->one(); if (empty($order)) { $order = new Order(); $order->uid = $this->generate...
[ "private", "function", "getIncompleteOrderFromDB", "(", ")", "{", "$", "order", "=", "Order", "::", "find", "(", ")", "->", "where", "(", "[", "'user_id'", "=>", "\\", "Yii", "::", "$", "app", "->", "user", "->", "id", ",", "'status'", "=>", "OrderStat...
Gets or creates incomplete order record from database. @return array|Order|null|ActiveRecord
[ "Gets", "or", "creates", "incomplete", "order", "record", "from", "database", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L219-L236
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.saveSelectedCombinationToSession
public function saveSelectedCombinationToSession($combination) { if (!empty($combination)) { $items = Yii::$app->session[self::SESSION_KEY_SELECTED_COMBINATIONS]; $itemIsExist = false; if(!empty($items)) { foreach ($items as $key => $item) { ...
php
public function saveSelectedCombinationToSession($combination) { if (!empty($combination)) { $items = Yii::$app->session[self::SESSION_KEY_SELECTED_COMBINATIONS]; $itemIsExist = false; if(!empty($items)) { foreach ($items as $key => $item) { ...
[ "public", "function", "saveSelectedCombinationToSession", "(", "$", "combination", ")", "{", "if", "(", "!", "empty", "(", "$", "combination", ")", ")", "{", "$", "items", "=", "Yii", "::", "$", "app", "->", "session", "[", "self", "::", "SESSION_KEY_SELEC...
Saves last selected product combinations to session. @param Combination $combination @return bool
[ "Saves", "last", "selected", "product", "combinations", "to", "session", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L328-L355
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.getSelectedCombinationFromSession
public function getSelectedCombinationFromSession($productId) { $combination = null; if (!empty($productId)) { $items = Yii::$app->session[self::SESSION_KEY_SELECTED_COMBINATIONS]; if (!empty($items)) { $combinationId = null; foreach ($items...
php
public function getSelectedCombinationFromSession($productId) { $combination = null; if (!empty($productId)) { $items = Yii::$app->session[self::SESSION_KEY_SELECTED_COMBINATIONS]; if (!empty($items)) { $combinationId = null; foreach ($items...
[ "public", "function", "getSelectedCombinationFromSession", "(", "$", "productId", ")", "{", "$", "combination", "=", "null", ";", "if", "(", "!", "empty", "(", "$", "productId", ")", ")", "{", "$", "items", "=", "Yii", "::", "$", "app", "->", "session", ...
Gets last selected product combinations from session. @param $productId [[Product]] id @return null|Combination
[ "Gets", "last", "selected", "product", "combinations", "from", "session", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L363-L384
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.getOrderItems
public function getOrderItems() { if (\Yii::$app->user->isGuest) { $session = \Yii::$app->session; $products = $session[self::SESSION_KEY]; } else { $order = Order::find()->where(['user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE])->one...
php
public function getOrderItems() { if (\Yii::$app->user->isGuest) { $session = \Yii::$app->session; $products = $session[self::SESSION_KEY]; } else { $order = Order::find()->where(['user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE])->one...
[ "public", "function", "getOrderItems", "(", ")", "{", "if", "(", "\\", "Yii", "::", "$", "app", "->", "user", "->", "isGuest", ")", "{", "$", "session", "=", "\\", "Yii", "::", "$", "app", "->", "session", ";", "$", "products", "=", "$", "session",...
Gets order items. @return array|bool|mixed|\yii\db\ActiveRecord[]
[ "Gets", "order", "items", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L431-L442
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.getOrderItemsCount
public function getOrderItemsCount() { if (\Yii::$app->user->isGuest) { $session = \Yii::$app->session; return count($session[self::SESSION_KEY]); } else { $order = Order::find()->where(['user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE...
php
public function getOrderItemsCount() { if (\Yii::$app->user->isGuest) { $session = \Yii::$app->session; return count($session[self::SESSION_KEY]); } else { $order = Order::find()->where(['user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE...
[ "public", "function", "getOrderItemsCount", "(", ")", "{", "if", "(", "\\", "Yii", "::", "$", "app", "->", "user", "->", "isGuest", ")", "{", "$", "session", "=", "\\", "Yii", "::", "$", "app", "->", "session", ";", "return", "count", "(", "$", "se...
Gets order items count. @return integer
[ "Gets", "order", "items", "count", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L449-L463
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.getAllUserOrders
public function getAllUserOrders() { if (!\Yii::$app->user->isGuest && $this->saveToDataBase === true) { $orders = Order::find() ->where(['user_id' => \Yii::$app->user->id]) ->andWhere(['!=', 'status', OrderStatus::STATUS_INCOMPLETE])->all(); return $o...
php
public function getAllUserOrders() { if (!\Yii::$app->user->isGuest && $this->saveToDataBase === true) { $orders = Order::find() ->where(['user_id' => \Yii::$app->user->id]) ->andWhere(['!=', 'status', OrderStatus::STATUS_INCOMPLETE])->all(); return $o...
[ "public", "function", "getAllUserOrders", "(", ")", "{", "if", "(", "!", "\\", "Yii", "::", "$", "app", "->", "user", "->", "isGuest", "&&", "$", "this", "->", "saveToDataBase", "===", "true", ")", "{", "$", "orders", "=", "Order", "::", "find", "(",...
Gets all user orders from database. @return bool|\yii\db\ActiveRecord[]
[ "Gets", "all", "user", "orders", "from", "database", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L470-L478
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.removeItem
public function removeItem(int $productId, int $combinationId = null) { if (!\Yii::$app->user->isGuest) { $order = Order::find()->where([ 'user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE ])->one(); if (!empty($o...
php
public function removeItem(int $productId, int $combinationId = null) { if (!\Yii::$app->user->isGuest) { $order = Order::find()->where([ 'user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE ])->one(); if (!empty($o...
[ "public", "function", "removeItem", "(", "int", "$", "productId", ",", "int", "$", "combinationId", "=", "null", ")", "{", "if", "(", "!", "\\", "Yii", "::", "$", "app", "->", "user", "->", "isGuest", ")", "{", "$", "order", "=", "Order", "::", "fi...
Removes item from order. @param $productId integer @param $combinationId integer
[ "Removes", "item", "from", "order", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L485-L513
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.getIncompleteOrder
public function getIncompleteOrder() { if (!\Yii::$app->user->isGuest) { $user = User::findOne(\Yii::$app->user->id); $order = Order::find() ->where(['user_id' => $user->id, 'status' => OrderStatus::STATUS_INCOMPLETE]) ->one(); if (!empty($...
php
public function getIncompleteOrder() { if (!\Yii::$app->user->isGuest) { $user = User::findOne(\Yii::$app->user->id); $order = Order::find() ->where(['user_id' => $user->id, 'status' => OrderStatus::STATUS_INCOMPLETE]) ->one(); if (!empty($...
[ "public", "function", "getIncompleteOrder", "(", ")", "{", "if", "(", "!", "\\", "Yii", "::", "$", "app", "->", "user", "->", "isGuest", ")", "{", "$", "user", "=", "User", "::", "findOne", "(", "\\", "Yii", "::", "$", "app", "->", "user", "->", ...
Gets registered user's incomplete order @return array|Order|null
[ "Gets", "registered", "user", "s", "incomplete", "order" ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L519-L531
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.clearCart
public function clearCart() { if (!\Yii::$app->user->isGuest && $this->saveToDataBase === true) { $order = Order::find()->where(['user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE])->one(); if (!empty($order)) $order->delete(); } els...
php
public function clearCart() { if (!\Yii::$app->user->isGuest && $this->saveToDataBase === true) { $order = Order::find()->where(['user_id' => \Yii::$app->user->id, 'status' => OrderStatus::STATUS_INCOMPLETE])->one(); if (!empty($order)) $order->delete(); } els...
[ "public", "function", "clearCart", "(", ")", "{", "if", "(", "!", "\\", "Yii", "::", "$", "app", "->", "user", "->", "isGuest", "&&", "$", "this", "->", "saveToDataBase", "===", "true", ")", "{", "$", "order", "=", "Order", "::", "find", "(", ")", ...
Clears cart.
[ "Clears", "cart", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L700-L711
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.getCost
public function getCost() { $totalCost = 0; if (Yii::$app->user->isGuest) { //Gets products from session $session = Yii::$app->session; $products = $session[self::SESSION_KEY]; if (!empty($products)) { foreach ($products as $product) { ...
php
public function getCost() { $totalCost = 0; if (Yii::$app->user->isGuest) { //Gets products from session $session = Yii::$app->session; $products = $session[self::SESSION_KEY]; if (!empty($products)) { foreach ($products as $product) { ...
[ "public", "function", "getCost", "(", ")", "{", "$", "totalCost", "=", "0", ";", "if", "(", "Yii", "::", "$", "app", "->", "user", "->", "isGuest", ")", "{", "//Gets products from session", "$", "session", "=", "Yii", "::", "$", "app", "->", "session",...
Gets cost of user's incomplete order without discounts @return mixed
[ "Gets", "cost", "of", "user", "s", "incomplete", "order", "without", "discounts" ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L763-L819
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.getTotalCost
public function getTotalCost() { $totalCost = $this->getCost(); $adjustmentTotal = 0; foreach ($this->adjustments as $adjustment) { $adjustmentObject = Yii::createObject($adjustment); if($adjustmentObject instanceof CartSumAdjustment) { $adjustmentTotal +...
php
public function getTotalCost() { $totalCost = $this->getCost(); $adjustmentTotal = 0; foreach ($this->adjustments as $adjustment) { $adjustmentObject = Yii::createObject($adjustment); if($adjustmentObject instanceof CartSumAdjustment) { $adjustmentTotal +...
[ "public", "function", "getTotalCost", "(", ")", "{", "$", "totalCost", "=", "$", "this", "->", "getCost", "(", ")", ";", "$", "adjustmentTotal", "=", "0", ";", "foreach", "(", "$", "this", "->", "adjustments", "as", "$", "adjustment", ")", "{", "$", ...
Gets total cost of user's incomplete order from session if user is guest or from DB if user is authenticated @return mixed
[ "Gets", "total", "cost", "of", "user", "s", "incomplete", "order", "from", "session", "if", "user", "is", "guest", "or", "from", "DB", "if", "user", "is", "authenticated" ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L826-L838
train
black-lamp/blcms-cart
CartComponent.php
CartComponent.isContainsProduct
public function isContainsProduct($productId, $combinationId = null) { if (Yii::$app->user->isGuest) { if (!empty(Yii::$app->session[self::SESSION_KEY])) { $sessionProducts = Yii::$app->session[self::SESSION_KEY]; foreach ($sessionProducts as $item) { ...
php
public function isContainsProduct($productId, $combinationId = null) { if (Yii::$app->user->isGuest) { if (!empty(Yii::$app->session[self::SESSION_KEY])) { $sessionProducts = Yii::$app->session[self::SESSION_KEY]; foreach ($sessionProducts as $item) { ...
[ "public", "function", "isContainsProduct", "(", "$", "productId", ",", "$", "combinationId", "=", "null", ")", "{", "if", "(", "Yii", "::", "$", "app", "->", "user", "->", "isGuest", ")", "{", "if", "(", "!", "empty", "(", "Yii", "::", "$", "app", ...
Checks if the cart contains the product. @param integer $productId [[Product]] id. @param null|integer $combinationId [[Combination]] id. @return bool whether the cart contains the product
[ "Checks", "if", "the", "cart", "contains", "the", "product", "." ]
314796eecae3ca4ed5fecfdc0231a738af50eba7
https://github.com/black-lamp/blcms-cart/blob/314796eecae3ca4ed5fecfdc0231a738af50eba7/CartComponent.php#L1041-L1077
train
Vectrex/vxPHP
src/Session/Session.php
Session.init
public static function init() { if(is_null(self::$storage)) { self::$storage = new NativeSessionStorage(); } self::$storage->start(); }
php
public static function init() { if(is_null(self::$storage)) { self::$storage = new NativeSessionStorage(); } self::$storage->start(); }
[ "public", "static", "function", "init", "(", ")", "{", "if", "(", "is_null", "(", "self", "::", "$", "storage", ")", ")", "{", "self", "::", "$", "storage", "=", "new", "NativeSessionStorage", "(", ")", ";", "}", "self", "::", "$", "storage", "->", ...
initialize session storage mechanism currently only wraps PHP native session storage
[ "initialize", "session", "storage", "mechanism", "currently", "only", "wraps", "PHP", "native", "session", "storage" ]
295c21b00e7ef6085efcdf5b64fabb28d499b5a6
https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Session/Session.php#L28-L36
train
SteeinRu/steein-sdk-php
src/Steein/SDK/Security/Cipher.php
Cipher.decrypt
public function decrypt($input) { // Decode the IV + data $input = base64_decode($input); // Remove the IV $iv = substr($input, 0, Cipher::IV_SIZE); // Return Decrypted Data return openssl_decrypt(substr($input, Cipher::IV_SIZE), "AES-256-CBC", $this->secretKey, 0, $i...
php
public function decrypt($input) { // Decode the IV + data $input = base64_decode($input); // Remove the IV $iv = substr($input, 0, Cipher::IV_SIZE); // Return Decrypted Data return openssl_decrypt(substr($input, Cipher::IV_SIZE), "AES-256-CBC", $this->secretKey, 0, $i...
[ "public", "function", "decrypt", "(", "$", "input", ")", "{", "// Decode the IV + data", "$", "input", "=", "base64_decode", "(", "$", "input", ")", ";", "// Remove the IV", "$", "iv", "=", "substr", "(", "$", "input", ",", "0", ",", "Cipher", "::", "IV_...
Decrypts the input text from the cipher key @param $input @return string
[ "Decrypts", "the", "input", "text", "from", "the", "cipher", "key" ]
27113624a6582d27bb55d7c9724e8306739ef167
https://github.com/SteeinRu/steein-sdk-php/blob/27113624a6582d27bb55d7c9724e8306739ef167/src/Steein/SDK/Security/Cipher.php#L75-L83
train
BartoszBartniczak/ArrayOfObjects
src/ArrayObject/ArrayObject.php
ArrayObject.filter
public function filter(callable $callback): ArrayObject { $arrayCopy = $this->getArrayCopy(); $filteredData = array_filter($arrayCopy, $callback); return new ArrayObject($filteredData); }
php
public function filter(callable $callback): ArrayObject { $arrayCopy = $this->getArrayCopy(); $filteredData = array_filter($arrayCopy, $callback); return new ArrayObject($filteredData); }
[ "public", "function", "filter", "(", "callable", "$", "callback", ")", ":", "ArrayObject", "{", "$", "arrayCopy", "=", "$", "this", "->", "getArrayCopy", "(", ")", ";", "$", "filteredData", "=", "array_filter", "(", "$", "arrayCopy", ",", "$", "callback", ...
Iterates over each value in the array passing them to the callback function. If the callback function returns true, the current value from array is returned into the result ArrayObject. Array keys are preserved. @param callable $callback @return ArrayObject
[ "Iterates", "over", "each", "value", "in", "the", "array", "passing", "them", "to", "the", "callback", "function", ".", "If", "the", "callback", "function", "returns", "true", "the", "current", "value", "from", "array", "is", "returned", "into", "the", "resu...
8758d3230d876c7d18d6753fd28ac8ef6de301c4
https://github.com/BartoszBartniczak/ArrayOfObjects/blob/8758d3230d876c7d18d6753fd28ac8ef6de301c4/src/ArrayObject/ArrayObject.php#L65-L70
train
BartoszBartniczak/ArrayOfObjects
src/ArrayObject/ArrayObject.php
ArrayObject.first
public function first() { $this->throwExceptionIfEmpty(); $keys = $this->keys(); $keyOfTheFirstElement = $keys->shift(); return $this->offsetGet($keyOfTheFirstElement); }
php
public function first() { $this->throwExceptionIfEmpty(); $keys = $this->keys(); $keyOfTheFirstElement = $keys->shift(); return $this->offsetGet($keyOfTheFirstElement); }
[ "public", "function", "first", "(", ")", "{", "$", "this", "->", "throwExceptionIfEmpty", "(", ")", ";", "$", "keys", "=", "$", "this", "->", "keys", "(", ")", ";", "$", "keyOfTheFirstElement", "=", "$", "keys", "->", "shift", "(", ")", ";", "return"...
Returns the first element, ignoring the type of the keys. @return mixed
[ "Returns", "the", "first", "element", "ignoring", "the", "type", "of", "the", "keys", "." ]
8758d3230d876c7d18d6753fd28ac8ef6de301c4
https://github.com/BartoszBartniczak/ArrayOfObjects/blob/8758d3230d876c7d18d6753fd28ac8ef6de301c4/src/ArrayObject/ArrayObject.php#L87-L94
train
BartoszBartniczak/ArrayOfObjects
src/ArrayObject/ArrayObject.php
ArrayObject.shift
public function shift() { $this->throwExceptionIfEmpty(); $arrayCopy = $this->getArrayCopy(); $firstElement = array_shift($arrayCopy); $this->exchangeArray($arrayCopy); return $firstElement; }
php
public function shift() { $this->throwExceptionIfEmpty(); $arrayCopy = $this->getArrayCopy(); $firstElement = array_shift($arrayCopy); $this->exchangeArray($arrayCopy); return $firstElement; }
[ "public", "function", "shift", "(", ")", "{", "$", "this", "->", "throwExceptionIfEmpty", "(", ")", ";", "$", "arrayCopy", "=", "$", "this", "->", "getArrayCopy", "(", ")", ";", "$", "firstElement", "=", "array_shift", "(", "$", "arrayCopy", ")", ";", ...
Shift an element off the beginning of array @return mixed
[ "Shift", "an", "element", "off", "the", "beginning", "of", "array" ]
8758d3230d876c7d18d6753fd28ac8ef6de301c4
https://github.com/BartoszBartniczak/ArrayOfObjects/blob/8758d3230d876c7d18d6753fd28ac8ef6de301c4/src/ArrayObject/ArrayObject.php#L137-L145
train
BartoszBartniczak/ArrayOfObjects
src/ArrayObject/ArrayObject.php
ArrayObject.last
public function last() { $this->throwExceptionIfEmpty(); $keys = $this->keys(); $keyOfTheLastElement = $keys->pop(); return $this->offsetGet($keyOfTheLastElement); }
php
public function last() { $this->throwExceptionIfEmpty(); $keys = $this->keys(); $keyOfTheLastElement = $keys->pop(); return $this->offsetGet($keyOfTheLastElement); }
[ "public", "function", "last", "(", ")", "{", "$", "this", "->", "throwExceptionIfEmpty", "(", ")", ";", "$", "keys", "=", "$", "this", "->", "keys", "(", ")", ";", "$", "keyOfTheLastElement", "=", "$", "keys", "->", "pop", "(", ")", ";", "return", ...
Returns the last element, ignoring the type of the keys. @return mixed
[ "Returns", "the", "last", "element", "ignoring", "the", "type", "of", "the", "keys", "." ]
8758d3230d876c7d18d6753fd28ac8ef6de301c4
https://github.com/BartoszBartniczak/ArrayOfObjects/blob/8758d3230d876c7d18d6753fd28ac8ef6de301c4/src/ArrayObject/ArrayObject.php#L151-L158
train
BartoszBartniczak/ArrayOfObjects
src/ArrayObject/ArrayObject.php
ArrayObject.pop
public function pop() { $this->throwExceptionIfEmpty(); $arrayCopy = $this->getArrayCopy(); $lastElement = array_pop($arrayCopy); $this->exchangeArray($arrayCopy); return $lastElement; }
php
public function pop() { $this->throwExceptionIfEmpty(); $arrayCopy = $this->getArrayCopy(); $lastElement = array_pop($arrayCopy); $this->exchangeArray($arrayCopy); return $lastElement; }
[ "public", "function", "pop", "(", ")", "{", "$", "this", "->", "throwExceptionIfEmpty", "(", ")", ";", "$", "arrayCopy", "=", "$", "this", "->", "getArrayCopy", "(", ")", ";", "$", "lastElement", "=", "array_pop", "(", "$", "arrayCopy", ")", ";", "$", ...
Pop the element off the end of array @return mixed @throws EmptyArrayException
[ "Pop", "the", "element", "off", "the", "end", "of", "array" ]
8758d3230d876c7d18d6753fd28ac8ef6de301c4
https://github.com/BartoszBartniczak/ArrayOfObjects/blob/8758d3230d876c7d18d6753fd28ac8ef6de301c4/src/ArrayObject/ArrayObject.php#L165-L173
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Source.php
Source.initCategories
public function initCategories($overrideExisting = true) { if (null !== $this->collCategories && !$overrideExisting) { return; } $collectionClassName = CategoryTableMap::getTableMap()->getCollectionClassName(); $this->collCategories = new $collectionClassName; $...
php
public function initCategories($overrideExisting = true) { if (null !== $this->collCategories && !$overrideExisting) { return; } $collectionClassName = CategoryTableMap::getTableMap()->getCollectionClassName(); $this->collCategories = new $collectionClassName; $...
[ "public", "function", "initCategories", "(", "$", "overrideExisting", "=", "true", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "collCategories", "&&", "!", "$", "overrideExisting", ")", "{", "return", ";", "}", "$", "collectionClassName", "=", "...
Initializes the collCategories collection. By default this just sets the collCategories collection to an empty array (like clearcollCategories()); however, you may wish to override this method in your stub class to provide setting appropriate to your application -- for example, setting the initial array to the values ...
[ "Initializes", "the", "collCategories", "collection", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1502-L1512
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Source.php
Source.getCategories
public function getCategories(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collCategoriesPartial && !$this->isNew(); if (null === $this->collCategories || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collCategories) { ...
php
public function getCategories(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collCategoriesPartial && !$this->isNew(); if (null === $this->collCategories || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collCategories) { ...
[ "public", "function", "getCategories", "(", "Criteria", "$", "criteria", "=", "null", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collCategoriesPartial", "&&", "!", "$", "this", "->", "isNew", "("...
Gets an array of ChildCategory objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria,...
[ "Gets", "an", "array", "of", "ChildCategory", "objects", "which", "contain", "a", "foreign", "key", "that", "references", "this", "object", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1528-L1570
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Source.php
Source.countCategories
public function countCategories(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collCategoriesPartial && !$this->isNew(); if (null === $this->collCategories || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collC...
php
public function countCategories(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collCategoriesPartial && !$this->isNew(); if (null === $this->collCategories || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collC...
[ "public", "function", "countCategories", "(", "Criteria", "$", "criteria", "=", "null", ",", "$", "distinct", "=", "false", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collCategoriesPartial", "&&", ...
Returns the number of related Category objects. @param Criteria $criteria @param boolean $distinct @param ConnectionInterface $con @return int Count of related Category objects. @throws PropelException
[ "Returns", "the", "number", "of", "related", "Category", "objects", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1614-L1637
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Source.php
Source.addCategory
public function addCategory(ChildCategory $l) { if ($this->collCategories === null) { $this->initCategories(); $this->collCategoriesPartial = true; } if (!$this->collCategories->contains($l)) { $this->doAddCategory($l); if ($this->categoriesS...
php
public function addCategory(ChildCategory $l) { if ($this->collCategories === null) { $this->initCategories(); $this->collCategoriesPartial = true; } if (!$this->collCategories->contains($l)) { $this->doAddCategory($l); if ($this->categoriesS...
[ "public", "function", "addCategory", "(", "ChildCategory", "$", "l", ")", "{", "if", "(", "$", "this", "->", "collCategories", "===", "null", ")", "{", "$", "this", "->", "initCategories", "(", ")", ";", "$", "this", "->", "collCategoriesPartial", "=", "...
Method called to associate a ChildCategory object to this object through the ChildCategory foreign key attribute. @param ChildCategory $l ChildCategory @return $this|\Attogram\SharedMedia\Orm\Source The current object (for fluent API support)
[ "Method", "called", "to", "associate", "a", "ChildCategory", "object", "to", "this", "object", "through", "the", "ChildCategory", "foreign", "key", "attribute", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1646-L1662
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Source.php
Source.initMedias
public function initMedias($overrideExisting = true) { if (null !== $this->collMedias && !$overrideExisting) { return; } $collectionClassName = MediaTableMap::getTableMap()->getCollectionClassName(); $this->collMedias = new $collectionClassName; $this->collMedia...
php
public function initMedias($overrideExisting = true) { if (null !== $this->collMedias && !$overrideExisting) { return; } $collectionClassName = MediaTableMap::getTableMap()->getCollectionClassName(); $this->collMedias = new $collectionClassName; $this->collMedia...
[ "public", "function", "initMedias", "(", "$", "overrideExisting", "=", "true", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "collMedias", "&&", "!", "$", "overrideExisting", ")", "{", "return", ";", "}", "$", "collectionClassName", "=", "MediaTab...
Initializes the collMedias collection. By default this just sets the collMedias collection to an empty array (like clearcollMedias()); however, you may wish to override this method in your stub class to provide setting appropriate to your application -- for example, setting the initial array to the values stored in da...
[ "Initializes", "the", "collMedias", "collection", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1727-L1737
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Source.php
Source.getMedias
public function getMedias(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collMediasPartial && !$this->isNew(); if (null === $this->collMedias || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collMedias) { // retu...
php
public function getMedias(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collMediasPartial && !$this->isNew(); if (null === $this->collMedias || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collMedias) { // retu...
[ "public", "function", "getMedias", "(", "Criteria", "$", "criteria", "=", "null", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collMediasPartial", "&&", "!", "$", "this", "->", "isNew", "(", ")",...
Gets an array of ChildMedia objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria, th...
[ "Gets", "an", "array", "of", "ChildMedia", "objects", "which", "contain", "a", "foreign", "key", "that", "references", "this", "object", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1753-L1795
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Source.php
Source.countMedias
public function countMedias(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collMediasPartial && !$this->isNew(); if (null === $this->collMedias || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collMedias) { ...
php
public function countMedias(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collMediasPartial && !$this->isNew(); if (null === $this->collMedias || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collMedias) { ...
[ "public", "function", "countMedias", "(", "Criteria", "$", "criteria", "=", "null", ",", "$", "distinct", "=", "false", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collMediasPartial", "&&", "!", ...
Returns the number of related Media objects. @param Criteria $criteria @param boolean $distinct @param ConnectionInterface $con @return int Count of related Media objects. @throws PropelException
[ "Returns", "the", "number", "of", "related", "Media", "objects", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1839-L1862
train
attogram/shared-media-orm
src/Attogram/SharedMedia/Orm/Base/Source.php
Source.addMedia
public function addMedia(ChildMedia $l) { if ($this->collMedias === null) { $this->initMedias(); $this->collMediasPartial = true; } if (!$this->collMedias->contains($l)) { $this->doAddMedia($l); if ($this->mediasScheduledForDeletion and $this...
php
public function addMedia(ChildMedia $l) { if ($this->collMedias === null) { $this->initMedias(); $this->collMediasPartial = true; } if (!$this->collMedias->contains($l)) { $this->doAddMedia($l); if ($this->mediasScheduledForDeletion and $this...
[ "public", "function", "addMedia", "(", "ChildMedia", "$", "l", ")", "{", "if", "(", "$", "this", "->", "collMedias", "===", "null", ")", "{", "$", "this", "->", "initMedias", "(", ")", ";", "$", "this", "->", "collMediasPartial", "=", "true", ";", "}...
Method called to associate a ChildMedia object to this object through the ChildMedia foreign key attribute. @param ChildMedia $l ChildMedia @return $this|\Attogram\SharedMedia\Orm\Source The current object (for fluent API support)
[ "Method", "called", "to", "associate", "a", "ChildMedia", "object", "to", "this", "object", "through", "the", "ChildMedia", "foreign", "key", "attribute", "." ]
81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8
https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1871-L1887
train