id
int32
0
241k
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
190,100
antonraharja/tpl
src/Playsms/Tpl.php
Tpl._setBool
private function _setBool($key, $val) { if ($key && !$val) { $this->_result = preg_replace("/<if\." . $key . ">(.*?)<\/if\." . $key . ">/s", '', $this->_result); } $this->_result = str_replace("<if." . $key . ">", '', $this->_result); $this->_result = str_replace("</if." . $key . ">", '', $this->_result); }
php
private function _setBool($key, $val) { if ($key && !$val) { $this->_result = preg_replace("/<if\." . $key . ">(.*?)<\/if\." . $key . ">/s", '', $this->_result); } $this->_result = str_replace("<if." . $key . ">", '', $this->_result); $this->_result = str_replace("</if." . $key . ">", '', $this->_result); }
[ "private", "function", "_setBool", "(", "$", "key", ",", "$", "val", ")", "{", "if", "(", "$", "key", "&&", "!", "$", "val", ")", "{", "$", "this", "->", "_result", "=", "preg_replace", "(", "\"/<if\\.\"", ".", "$", "key", ".", "\">(.*?)<\\/if\\.\"",...
Template boolean manipulation @param string $key Template key @param string $val Template value
[ "Template", "boolean", "manipulation" ]
f4eb176d93abedeb90674c609868fee602e8aab6
https://github.com/antonraharja/tpl/blob/f4eb176d93abedeb90674c609868fee602e8aab6/src/Playsms/Tpl.php#L120-L126
190,101
antonraharja/tpl
src/Playsms/Tpl.php
Tpl._setContentFromFile
private function _setContentFromFile() { // empty original template content $this->setContent(''); // check for template file and load it if ($filename = $this->getTemplate()) { if (file_exists($filename)) { $content = trim(file_get_contents($this->_filename)); $this->setContent($content); }...
php
private function _setContentFromFile() { // empty original template content $this->setContent(''); // check for template file and load it if ($filename = $this->getTemplate()) { if (file_exists($filename)) { $content = trim(file_get_contents($this->_filename)); $this->setContent($content); }...
[ "private", "function", "_setContentFromFile", "(", ")", "{", "// empty original template content", "$", "this", "->", "setContent", "(", "''", ")", ";", "// check for template file and load it", "if", "(", "$", "filename", "=", "$", "this", "->", "getTemplate", "(",...
Set content from file
[ "Set", "content", "from", "file" ]
f4eb176d93abedeb90674c609868fee602e8aab6
https://github.com/antonraharja/tpl/blob/f4eb176d93abedeb90674c609868fee602e8aab6/src/Playsms/Tpl.php#L131-L143
190,102
silverstripe/silverstripe-multiform
src/Forms/MultiForm.php
MultiForm.getCurrentStep
public function getCurrentStep() { $startStepClass = $this->config()->get('start_step'); // Check if there was a start step defined on the subclass of MultiForm if (!isset($startStepClass)) { user_error( 'MultiForm::init(): Please define a $start_step on ' . stat...
php
public function getCurrentStep() { $startStepClass = $this->config()->get('start_step'); // Check if there was a start step defined on the subclass of MultiForm if (!isset($startStepClass)) { user_error( 'MultiForm::init(): Please define a $start_step on ' . stat...
[ "public", "function", "getCurrentStep", "(", ")", "{", "$", "startStepClass", "=", "$", "this", "->", "config", "(", ")", "->", "get", "(", "'start_step'", ")", ";", "// Check if there was a start step defined on the subclass of MultiForm", "if", "(", "!", "isset", ...
Get the current step. If StepID has been set in the URL, we attempt to get that record by the ID. Otherwise, we check if there's a current step ID in our session record. Failing those cases, we assume that the form has just been started, and so we create the first step and return it. @return MultiFormStep subclass
[ "Get", "the", "current", "step", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Forms/MultiForm.php#L216-L258
190,103
silverstripe/silverstripe-multiform
src/Forms/MultiForm.php
MultiForm.setCurrentStep
protected function setCurrentStep($step) { $this->session->CurrentStepID = $step->ID; $step->setForm($this); return $this->session->write(); }
php
protected function setCurrentStep($step) { $this->session->CurrentStepID = $step->ID; $step->setForm($this); return $this->session->write(); }
[ "protected", "function", "setCurrentStep", "(", "$", "step", ")", "{", "$", "this", "->", "session", "->", "CurrentStepID", "=", "$", "step", "->", "ID", ";", "$", "step", "->", "setForm", "(", "$", "this", ")", ";", "return", "$", "this", "->", "ses...
Set the step passed in as the current step. @param MultiFormStep $step A subclass of MultiFormStep @return boolean The return value of write()
[ "Set", "the", "step", "passed", "in", "as", "the", "current", "step", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Forms/MultiForm.php#L266-L272
190,104
silverstripe/silverstripe-multiform
src/Forms/MultiForm.php
MultiForm.setSession
protected function setSession() { $this->session = $this->getCurrentSession(); // If there was no session found, create a new one instead if (!$this->session) { $session = MultiFormSession::create(); $session->write(); $this->session = $session; }...
php
protected function setSession() { $this->session = $this->getCurrentSession(); // If there was no session found, create a new one instead if (!$this->session) { $session = MultiFormSession::create(); $session->write(); $this->session = $session; }...
[ "protected", "function", "setSession", "(", ")", "{", "$", "this", "->", "session", "=", "$", "this", "->", "getCurrentSession", "(", ")", ";", "// If there was no session found, create a new one instead", "if", "(", "!", "$", "this", "->", "session", ")", "{", ...
Set up the session. If MultiFormSessionID isn't set, we assume that this is a new multiform that requires a new session record to be created. @TODO Fix the fact you can continually refresh and create new records if MultiFormSessionID isn't set. @TODO Not sure if we should bake the session stuff directly into MultiFo...
[ "Set", "up", "the", "session", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Forms/MultiForm.php#L299-L309
190,105
silverstripe/silverstripe-multiform
src/Forms/MultiForm.php
MultiForm.actionsFor
public function actionsFor($step) { // Create default multi step actions (next, prev), and merge with extra actions, if any $actions = FieldList::create(); // If the form is at final step, create a submit button to perform final actions // The last step doesn't have a next button, s...
php
public function actionsFor($step) { // Create default multi step actions (next, prev), and merge with extra actions, if any $actions = FieldList::create(); // If the form is at final step, create a submit button to perform final actions // The last step doesn't have a next button, s...
[ "public", "function", "actionsFor", "(", "$", "step", ")", "{", "// Create default multi step actions (next, prev), and merge with extra actions, if any", "$", "actions", "=", "FieldList", "::", "create", "(", ")", ";", "// If the form is at final step, create a submit button to ...
Build a FieldList of the FormAction fields for the given step. If the current step is the final step, we push in a submit button, which calls the action {@link finish()} to finalise the submission. Otherwise, we push in a next button which calls the action {@link next()} to determine where to go next in our step proce...
[ "Build", "a", "FieldList", "of", "the", "FormAction", "fields", "for", "the", "given", "step", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Forms/MultiForm.php#L400-L430
190,106
silverstripe/silverstripe-multiform
src/Forms/MultiForm.php
MultiForm.next
public function next($data, $form) { // Save the form data for the current step $this->save($form->getData()); // Get the next step class $nextStepClass = $this->getCurrentStep()->getNextStep(); if (!$nextStepClass) { $this->controller->redirectBack(); ...
php
public function next($data, $form) { // Save the form data for the current step $this->save($form->getData()); // Get the next step class $nextStepClass = $this->getCurrentStep()->getNextStep(); if (!$nextStepClass) { $this->controller->redirectBack(); ...
[ "public", "function", "next", "(", "$", "data", ",", "$", "form", ")", "{", "// Save the form data for the current step", "$", "this", "->", "save", "(", "$", "form", "->", "getData", "(", ")", ")", ";", "// Get the next step class", "$", "nextStepClass", "=",...
Determine what to do when the next action is called. Saves the current step session data to the database, creates the new step based on getNextStep() of the current step (or fetches an existing one), resets the current step to the next step, then redirects to the newly set step. @param array $data The request data re...
[ "Determine", "what", "to", "do", "when", "the", "next", "action", "is", "called", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Forms/MultiForm.php#L471-L508
190,107
silverstripe/silverstripe-multiform
src/Forms/MultiForm.php
MultiForm.prev
public function prev($data, $form) { // Save the form data for the current step $this->save($form->getData()); // Get the previous step class $prevStepClass = $this->getCurrentStep()->getPreviousStep(); if (!$prevStepClass && !$this->getCurrentStep()->canGoBack()) { ...
php
public function prev($data, $form) { // Save the form data for the current step $this->save($form->getData()); // Get the previous step class $prevStepClass = $this->getCurrentStep()->getPreviousStep(); if (!$prevStepClass && !$this->getCurrentStep()->canGoBack()) { ...
[ "public", "function", "prev", "(", "$", "data", ",", "$", "form", ")", "{", "// Save the form data for the current step", "$", "this", "->", "save", "(", "$", "form", "->", "getData", "(", ")", ")", ";", "// Get the previous step class", "$", "prevStepClass", ...
Determine what to do when the previous action is called. Retrieves the previous step class, finds the record for that class in the DB, and sets the current step to that step found. Finally, it redirects to that step. @param array $data The request data returned from the form @param Form $form The form that the action...
[ "Determine", "what", "to", "do", "when", "the", "previous", "action", "is", "called", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Forms/MultiForm.php#L521-L542
190,108
silverstripe/silverstripe-multiform
src/Forms/MultiForm.php
MultiForm.save
protected function save($data) { $currentStep = $this->getCurrentStep(); if (is_array($data)) { foreach ($data as $field => $value) { if (in_array($field, $this->config()->get('ignored_fields'))) { unset($data[$field]); } } ...
php
protected function save($data) { $currentStep = $this->getCurrentStep(); if (is_array($data)) { foreach ($data as $field => $value) { if (in_array($field, $this->config()->get('ignored_fields'))) { unset($data[$field]); } } ...
[ "protected", "function", "save", "(", "$", "data", ")", "{", "$", "currentStep", "=", "$", "this", "->", "getCurrentStep", "(", ")", ";", "if", "(", "is_array", "(", "$", "data", ")", ")", "{", "foreach", "(", "$", "data", "as", "$", "field", "=>",...
Save the raw data given back from the form into session. Take the submitted form data for the current step, removing any key => value pairs that shouldn't be saved, then saves the data into the session. @param array $data An array of data to save
[ "Save", "the", "raw", "data", "given", "back", "from", "the", "form", "into", "session", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Forms/MultiForm.php#L553-L565
190,109
silverstripe/silverstripe-multiform
src/tasks/MultiFormPurgeTask.php
MultiFormPurgeTask.run
public function run($request) { $sessions = $this->getExpiredSessions(); $delCount = 0; if ($sessions) { foreach ($sessions as $session) { $session->delete(); $delCount++; } } echo $delCount . ' session records deleted t...
php
public function run($request) { $sessions = $this->getExpiredSessions(); $delCount = 0; if ($sessions) { foreach ($sessions as $session) { $session->delete(); $delCount++; } } echo $delCount . ' session records deleted t...
[ "public", "function", "run", "(", "$", "request", ")", "{", "$", "sessions", "=", "$", "this", "->", "getExpiredSessions", "(", ")", ";", "$", "delCount", "=", "0", ";", "if", "(", "$", "sessions", ")", "{", "foreach", "(", "$", "sessions", "as", "...
Run this cron task. Go through all MultiFormSession records that are older than the days specified in $session_expiry_days and delete them.
[ "Run", "this", "cron", "task", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/tasks/MultiFormPurgeTask.php#L40-L52
190,110
silverstripe/silverstripe-multiform
src/extensions/MultiFormObjectDecorator.php
MultiFormObjectDecorator.augmentSQL
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) { $where = $query->getWhere(); if (!$where && !$this->wantsTemporary($query)) { $from = array_values($query->getFrom()); $query->addWhere("{$from[0]}.\"MultiFormIsTemporary\" = '0'"); return...
php
public function augmentSQL(SQLSelect $query, DataQuery $dataQuery = null) { $where = $query->getWhere(); if (!$where && !$this->wantsTemporary($query)) { $from = array_values($query->getFrom()); $query->addWhere("{$from[0]}.\"MultiFormIsTemporary\" = '0'"); return...
[ "public", "function", "augmentSQL", "(", "SQLSelect", "$", "query", ",", "DataQuery", "$", "dataQuery", "=", "null", ")", "{", "$", "where", "=", "$", "query", "->", "getWhere", "(", ")", ";", "if", "(", "!", "$", "where", "&&", "!", "$", "this", "...
Augment any queries to MultiFormObjectDecorator and only return anything that isn't considered temporary. @param SQLSelect $query @param DataQuery|null $dataQuery
[ "Augment", "any", "queries", "to", "MultiFormObjectDecorator", "and", "only", "return", "anything", "that", "isn", "t", "considered", "temporary", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/extensions/MultiFormObjectDecorator.php#L39-L56
190,111
silverstripe/silverstripe-multiform
src/extensions/MultiFormObjectDecorator.php
MultiFormObjectDecorator.wantsTemporary
protected function wantsTemporary($query) { foreach ($query->getWhere() as $whereClause) { $from = array_values($query->getFrom()); // SQLQuery will automatically add double quotes and single quotes to values, so check against that. $key = key($whereClause); i...
php
protected function wantsTemporary($query) { foreach ($query->getWhere() as $whereClause) { $from = array_values($query->getFrom()); // SQLQuery will automatically add double quotes and single quotes to values, so check against that. $key = key($whereClause); i...
[ "protected", "function", "wantsTemporary", "(", "$", "query", ")", "{", "foreach", "(", "$", "query", "->", "getWhere", "(", ")", "as", "$", "whereClause", ")", "{", "$", "from", "=", "array_values", "(", "$", "query", "->", "getFrom", "(", ")", ")", ...
Determines if the current query is supposed to be exempt from the automatic filtering out of temporary records. @param SQLSelect $query @return boolean
[ "Determines", "if", "the", "current", "query", "is", "supposed", "to", "be", "exempt", "from", "the", "automatic", "filtering", "out", "of", "temporary", "records", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/extensions/MultiFormObjectDecorator.php#L66-L78
190,112
silverstripe/silverstripe-multiform
src/Models/MultiFormStep.php
MultiFormStep.getNextStepFromDatabase
public function getNextStepFromDatabase() { if ($this->SessionID && is_numeric($this->SessionID)) { $nextSteps = $this->config()->get('next_steps'); if (is_string($nextSteps)) { return DataObject::get_one($nextSteps, "\"SessionID\" = {$this->SessionID}"); ...
php
public function getNextStepFromDatabase() { if ($this->SessionID && is_numeric($this->SessionID)) { $nextSteps = $this->config()->get('next_steps'); if (is_string($nextSteps)) { return DataObject::get_one($nextSteps, "\"SessionID\" = {$this->SessionID}"); ...
[ "public", "function", "getNextStepFromDatabase", "(", ")", "{", "if", "(", "$", "this", "->", "SessionID", "&&", "is_numeric", "(", "$", "this", "->", "SessionID", ")", ")", "{", "$", "nextSteps", "=", "$", "this", "->", "config", "(", ")", "->", "get"...
Returns the next step to the current step in the database. This will only return something if you've previously visited the step ahead of the current step, and then gone back a step. @return MultiFormStep|boolean|void
[ "Returns", "the", "next", "step", "to", "the", "current", "step", "in", "the", "database", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Models/MultiFormStep.php#L276-L289
190,113
silverstripe/silverstripe-multiform
src/Models/MultiFormStep.php
MultiFormStep.getPreviousStep
public function getPreviousStep() { $steps = MultiFormStep::get()->filter('SessionID', $this->SessionID)->sort('LastEdited', 'DESC'); if ($steps) { foreach ($steps as $step) { $step->setForm($this->form); if ($step->getNextStep()) { i...
php
public function getPreviousStep() { $steps = MultiFormStep::get()->filter('SessionID', $this->SessionID)->sort('LastEdited', 'DESC'); if ($steps) { foreach ($steps as $step) { $step->setForm($this->form); if ($step->getNextStep()) { i...
[ "public", "function", "getPreviousStep", "(", ")", "{", "$", "steps", "=", "MultiFormStep", "::", "get", "(", ")", "->", "filter", "(", "'SessionID'", ",", "$", "this", "->", "SessionID", ")", "->", "sort", "(", "'LastEdited'", ",", "'DESC'", ")", ";", ...
Returns the previous step, if there is one. To determine if there is a previous step, we check the database to see if there's a previous step for this multi form session ID. @return string|void Classname of a {@link MultiFormStep} subclass
[ "Returns", "the", "previous", "step", "if", "there", "is", "one", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Models/MultiFormStep.php#L309-L324
190,114
silverstripe/silverstripe-multiform
src/Models/MultiFormStep.php
MultiFormStep.getValueFromOtherStep
public function getValueFromOtherStep($fromStep, $key) { // load the steps in the cache, if this one doesn't exist if (!array_key_exists('steps_' . $fromStep, $this->step_data_cache)) { $steps = self::get()->filter('SessionID', $this->form->session->ID); if ($steps) { ...
php
public function getValueFromOtherStep($fromStep, $key) { // load the steps in the cache, if this one doesn't exist if (!array_key_exists('steps_' . $fromStep, $this->step_data_cache)) { $steps = self::get()->filter('SessionID', $this->form->session->ID); if ($steps) { ...
[ "public", "function", "getValueFromOtherStep", "(", "$", "fromStep", ",", "$", "key", ")", "{", "// load the steps in the cache, if this one doesn't exist", "if", "(", "!", "array_key_exists", "(", "'steps_'", ".", "$", "fromStep", ",", "$", "this", "->", "step_data...
Returns the submitted value, if any, of any steps. @param string $fromStep (classname) @param string $key @return mixed
[ "Returns", "the", "submitted", "value", "if", "any", "of", "any", "steps", "." ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Models/MultiFormStep.php#L474-L495
190,115
silverstripe/silverstripe-multiform
src/Models/MultiFormStep.php
MultiFormStep.copyValueFromOtherStep
public function copyValueFromOtherStep(FieldList $fields, $formStep, $fieldName, $fieldNameTarget = null) { // if a target field isn't defined use the same fieldname if (!$fieldNameTarget) { $fieldNameTarget = $fieldName; } $fields->fieldByName($fieldNameTarget)->setValu...
php
public function copyValueFromOtherStep(FieldList $fields, $formStep, $fieldName, $fieldNameTarget = null) { // if a target field isn't defined use the same fieldname if (!$fieldNameTarget) { $fieldNameTarget = $fieldName; } $fields->fieldByName($fieldNameTarget)->setValu...
[ "public", "function", "copyValueFromOtherStep", "(", "FieldList", "$", "fields", ",", "$", "formStep", ",", "$", "fieldName", ",", "$", "fieldNameTarget", "=", "null", ")", "{", "// if a target field isn't defined use the same fieldname", "if", "(", "!", "$", "field...
allows to get a value from another step copied over @param FieldList $fields @param string $formStep @param string $fieldName @param string $fieldNameTarget (optional)
[ "allows", "to", "get", "a", "value", "from", "another", "step", "copied", "over" ]
a57bfe74bb0d55619cfb27ce995d329c1abe8e2f
https://github.com/silverstripe/silverstripe-multiform/blob/a57bfe74bb0d55619cfb27ce995d329c1abe8e2f/src/Models/MultiFormStep.php#L505-L513
190,116
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.add
public function add(array $updates, $class, $append = true) { $commandClass = $this->getCommandClass('update.add'); $this->command = new $commandClass($updates, $class, $append); return $this->command; }
php
public function add(array $updates, $class, $append = true) { $commandClass = $this->getCommandClass('update.add'); $this->command = new $commandClass($updates, $class, $append); return $this->command; }
[ "public", "function", "add", "(", "array", "$", "updates", ",", "$", "class", ",", "$", "append", "=", "true", ")", "{", "$", "commandClass", "=", "$", "this", "->", "getCommandClass", "(", "'update.add'", ")", ";", "$", "this", "->", "command", "=", ...
Adds a relation in a link-list|set. @param array $updates @param string $class @param boolean $append @return Add
[ "Adds", "a", "relation", "in", "a", "link", "-", "list|set", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L85-L91
190,117
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.alter
public function alter($class, $attribute, $value) { $commandClass = $this->getCommandClass('class.alter'); $this->command = new $commandClass($class, $attribute, $value); return $this->command; }
php
public function alter($class, $attribute, $value) { $commandClass = $this->getCommandClass('class.alter'); $this->command = new $commandClass($class, $attribute, $value); return $this->command; }
[ "public", "function", "alter", "(", "$", "class", ",", "$", "attribute", ",", "$", "value", ")", "{", "$", "commandClass", "=", "$", "this", "->", "getCommandClass", "(", "'class.alter'", ")", ";", "$", "this", "->", "command", "=", "new", "$", "comman...
Alters an attribute of a class. @param string $class @param string $attribute @param string $value @return Alter
[ "Alters", "an", "attribute", "of", "a", "class", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L101-L107
190,118
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.between
public function between($key, $left, $right) { return $this->command->between($key, $left, $right); }
php
public function between($key, $left, $right) { return $this->command->between($key, $left, $right); }
[ "public", "function", "between", "(", "$", "key", ",", "$", "left", ",", "$", "right", ")", "{", "return", "$", "this", "->", "command", "->", "between", "(", "$", "key", ",", "$", "left", ",", "$", "right", ")", ";", "}" ]
Converts a "normal" select into an index one. You use do a select on an index you can use the between operator. @param string $key @param string $left @param string $right
[ "Converts", "a", "normal", "select", "into", "an", "index", "one", ".", "You", "use", "do", "a", "select", "on", "an", "index", "you", "can", "use", "the", "between", "operator", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L145-L148
190,119
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.index
public function index($property, $type, $class = null) { $commandClass = $this->getCommandClass('index.create'); $this->command = new $commandClass($property, $type, $class); return $this->command; }
php
public function index($property, $type, $class = null) { $commandClass = $this->getCommandClass('index.create'); $this->command = new $commandClass($property, $type, $class); return $this->command; }
[ "public", "function", "index", "(", "$", "property", ",", "$", "type", ",", "$", "class", "=", "null", ")", "{", "$", "commandClass", "=", "$", "this", "->", "getCommandClass", "(", "'index.create'", ")", ";", "$", "this", "->", "command", "=", "new", ...
Creates a index @param string $property @param string $class @param string $type @return Query
[ "Creates", "a", "index" ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L303-L309
190,120
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.remove
public function remove(array $updates, $class, $append = true) { $commandClass = $this->getCommandClass('update.remove'); $this->command = new $commandClass($updates, $class, $append); return $this->command; }
php
public function remove(array $updates, $class, $append = true) { $commandClass = $this->getCommandClass('update.remove'); $this->command = new $commandClass($updates, $class, $append); return $this->command; }
[ "public", "function", "remove", "(", "array", "$", "updates", ",", "$", "class", ",", "$", "append", "=", "true", ")", "{", "$", "commandClass", "=", "$", "this", "->", "getCommandClass", "(", "'update.remove'", ")", ";", "$", "this", "->", "command", ...
Removes a link from a link-set|list. @param array $updates @param string $class @param boolean $append @return Remove
[ "Removes", "a", "link", "from", "a", "link", "-", "set|list", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L481-L487
190,121
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.truncate
public function truncate($entity, $andCluster = false) { try { $validator = new RidValidator; $validator->check($entity); $commandClass = $this->getCommandClass('truncate.record'); } catch (ValidationException $e) { $commandClass = $this->getCommandCla...
php
public function truncate($entity, $andCluster = false) { try { $validator = new RidValidator; $validator->check($entity); $commandClass = $this->getCommandClass('truncate.record'); } catch (ValidationException $e) { $commandClass = $this->getCommandCla...
[ "public", "function", "truncate", "(", "$", "entity", ",", "$", "andCluster", "=", "false", ")", "{", "try", "{", "$", "validator", "=", "new", "RidValidator", ";", "$", "validator", "->", "check", "(", "$", "entity", ")", ";", "$", "commandClass", "="...
Truncates an entity. @param string $entity @param boolean $andCluster @return Query
[ "Truncates", "an", "entity", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L555-L572
190,122
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.unindex
public function unindex($property, $class = null) { $commandClass = $this->getCommandClass('index.drop'); $this->command = new $commandClass($property, $class); return $this->command; }
php
public function unindex($property, $class = null) { $commandClass = $this->getCommandClass('index.drop'); $this->command = new $commandClass($property, $class); return $this->command; }
[ "public", "function", "unindex", "(", "$", "property", ",", "$", "class", "=", "null", ")", "{", "$", "commandClass", "=", "$", "this", "->", "getCommandClass", "(", "'index.drop'", ")", ";", "$", "this", "->", "command", "=", "new", "$", "commandClass",...
Removes a index @param string $property @param string $class @return Query
[ "Removes", "a", "index" ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L593-L599
190,123
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.put
public function put(array $values, $class, $append = true) { $commandClass = $this->getCommandClass('update.put'); $this->command = new $commandClass($values, $class, $append); return $this->command; }
php
public function put(array $values, $class, $append = true) { $commandClass = $this->getCommandClass('update.put'); $this->command = new $commandClass($values, $class, $append); return $this->command; }
[ "public", "function", "put", "(", "array", "$", "values", ",", "$", "class", ",", "$", "append", "=", "true", ")", "{", "$", "commandClass", "=", "$", "this", "->", "getCommandClass", "(", "'update.put'", ")", ";", "$", "this", "->", "command", "=", ...
Changes the internal command to an PUT, setting the class to update and the values to be written. @param string $class @return Command
[ "Changes", "the", "internal", "command", "to", "an", "PUT", "setting", "the", "class", "to", "update", "and", "the", "values", "to", "be", "written", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L608-L614
190,124
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Query.php
Query.getCommandClass
protected function getCommandClass($id) { if (isset($this->commands[$id])) { return $this->commands[$id]; } throw new Exception(sprintf("command %s not found in %s", $id, get_called_class())); }
php
protected function getCommandClass($id) { if (isset($this->commands[$id])) { return $this->commands[$id]; } throw new Exception(sprintf("command %s not found in %s", $id, get_called_class())); }
[ "protected", "function", "getCommandClass", "(", "$", "id", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "commands", "[", "$", "id", "]", ")", ")", "{", "return", "$", "this", "->", "commands", "[", "$", "id", "]", ";", "}", "throw", "ne...
Returns on of the commands that belong to the query. @param string $id @return mixed
[ "Returns", "on", "of", "the", "commands", "that", "belong", "to", "the", "query", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Query.php#L657-L664
190,125
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/ClassMetadata.php
ClassMetadata.getReflectionClass
public function getReflectionClass() { if (!$this->refClass) { $this->refClass = new \ReflectionClass($this->getName()); } return $this->refClass; }
php
public function getReflectionClass() { if (!$this->refClass) { $this->refClass = new \ReflectionClass($this->getName()); } return $this->refClass; }
[ "public", "function", "getReflectionClass", "(", ")", "{", "if", "(", "!", "$", "this", "->", "refClass", ")", "{", "$", "this", "->", "refClass", "=", "new", "\\", "ReflectionClass", "(", "$", "this", "->", "getName", "(", ")", ")", ";", "}", "retur...
Gets the ReflectionClass instance for this mapped class. @return \ReflectionClass
[ "Gets", "the", "ReflectionClass", "instance", "for", "this", "mapped", "class", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/ClassMetadata.php#L88-L95
190,126
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/ClassMetadata.php
ClassMetadata.getFieldNames
public function getFieldNames() { $names = array(); foreach ($this->getFields() as $field) { $names[] = $field->name; } return $names; }
php
public function getFieldNames() { $names = array(); foreach ($this->getFields() as $field) { $names[] = $field->name; } return $names; }
[ "public", "function", "getFieldNames", "(", ")", "{", "$", "names", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "getFields", "(", ")", "as", "$", "field", ")", "{", "$", "names", "[", "]", "=", "$", "field", "->", "name", ";",...
A numerically indexed list of field names of this persistent class. This array includes identifier fields if present on this class. @return Array
[ "A", "numerically", "indexed", "list", "of", "field", "names", "of", "this", "persistent", "class", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/ClassMetadata.php#L159-L168
190,127
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/ClassMetadata.php
ClassMetadata.getAssociationNames
public function getAssociationNames() { $names = array(); foreach ($this->getAssociations() as $field) { $names[] = $field->name; } return $names; }
php
public function getAssociationNames() { $names = array(); foreach ($this->getAssociations() as $field) { $names[] = $field->name; } return $names; }
[ "public", "function", "getAssociationNames", "(", ")", "{", "$", "names", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "getAssociations", "(", ")", "as", "$", "field", ")", "{", "$", "names", "[", "]", "=", "$", "field", "->", "n...
A numerically indexed list of association names of this persistent class. This array includes identifier associations if present on this class. @return Array
[ "A", "numerically", "indexed", "list", "of", "association", "names", "of", "this", "persistent", "class", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/ClassMetadata.php#L177-L186
190,128
codeswholesale/codeswholesale-sdk-php
src/CodesWholesale/Client.php
Client.getProducts
public function getProducts(array $options = []) { return $this->dataStore->getResource( CodesWholesale::API_VERSION_V2 . '/products', CodesWholesale::PRODUCT_LIST, $options ); }
php
public function getProducts(array $options = []) { return $this->dataStore->getResource( CodesWholesale::API_VERSION_V2 . '/products', CodesWholesale::PRODUCT_LIST, $options ); }
[ "public", "function", "getProducts", "(", "array", "$", "options", "=", "[", "]", ")", "{", "return", "$", "this", "->", "dataStore", "->", "getResource", "(", "CodesWholesale", "::", "API_VERSION_V2", ".", "'/products'", ",", "CodesWholesale", "::", "PRODUCT_...
You can filter products by using below query params as array value 1. ["inStockDaysAgo" => "60"] - any value from 1 - 60 2. ["filter" => "filter"] - you can fetch filters by using methods: a) getLanguages() b) getRegions() c) getPlatforms() @param array $options @return ProductList|object @throws \Exception
[ "You", "can", "filter", "products", "by", "using", "below", "query", "params", "as", "array", "value" ]
08907531d7827fef13de10bc3d8bd5a453e1b10e
https://github.com/codeswholesale/codeswholesale-sdk-php/blob/08907531d7827fef13de10bc3d8bd5a453e1b10e/src/CodesWholesale/Client.php#L204-L211
190,129
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/BindingParameters.php
BindingParameters.create
public static function create($parameters) { if (is_string($parameters)) { return self::fromString($parameters); } if (is_array($parameters)) { return self::fromArray($parameters); } throw new InvalidArgumentException('Invalid parameters type'); ...
php
public static function create($parameters) { if (is_string($parameters)) { return self::fromString($parameters); } if (is_array($parameters)) { return self::fromArray($parameters); } throw new InvalidArgumentException('Invalid parameters type'); ...
[ "public", "static", "function", "create", "(", "$", "parameters", ")", "{", "if", "(", "is_string", "(", "$", "parameters", ")", ")", "{", "return", "self", "::", "fromString", "(", "$", "parameters", ")", ";", "}", "if", "(", "is_array", "(", "$", "...
Creates a new binding parameters instance from a URI string or a parameters array. @param mixed $parameters @return BindingParameters
[ "Creates", "a", "new", "binding", "parameters", "instance", "from", "a", "URI", "string", "or", "a", "parameters", "array", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/BindingParameters.php#L60-L71
190,130
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/BindingParameters.php
BindingParameters.fromString
public static function fromString($uri) { $parameters = parse_url($uri); if (isset($parameters['user'])) { $parameters['username'] = $parameters['user']; } if (isset($parameters['pass'])) { $parameters['password'] = $parameters['pass']; } if...
php
public static function fromString($uri) { $parameters = parse_url($uri); if (isset($parameters['user'])) { $parameters['username'] = $parameters['user']; } if (isset($parameters['pass'])) { $parameters['password'] = $parameters['pass']; } if...
[ "public", "static", "function", "fromString", "(", "$", "uri", ")", "{", "$", "parameters", "=", "parse_url", "(", "$", "uri", ")", ";", "if", "(", "isset", "(", "$", "parameters", "[", "'user'", "]", ")", ")", "{", "$", "parameters", "[", "'username...
Creates a new binding parameters instance from a URI string. @param string $parameters @return BindingParameters
[ "Creates", "a", "new", "binding", "parameters", "instance", "from", "a", "URI", "string", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/BindingParameters.php#L79-L98
190,131
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/BindingParameters.php
BindingParameters.fromArray
public static function fromArray(Array $parameters) { $host = isset($parameters['host']) ? $parameters['host'] : self::DEFAULT_HOST; $port = isset($parameters['port']) ? $parameters['port'] : self::DEFAULT_PORT; $user = isset($parameters['username']) ? $parameters['username'] : null; ...
php
public static function fromArray(Array $parameters) { $host = isset($parameters['host']) ? $parameters['host'] : self::DEFAULT_HOST; $port = isset($parameters['port']) ? $parameters['port'] : self::DEFAULT_PORT; $user = isset($parameters['username']) ? $parameters['username'] : null; ...
[ "public", "static", "function", "fromArray", "(", "Array", "$", "parameters", ")", "{", "$", "host", "=", "isset", "(", "$", "parameters", "[", "'host'", "]", ")", "?", "$", "parameters", "[", "'host'", "]", ":", "self", "::", "DEFAULT_HOST", ";", "$",...
Creates a new binding parameters instance from a parameters array. @param array $parameters @return BindingParameters
[ "Creates", "a", "new", "binding", "parameters", "instance", "from", "a", "parameters", "array", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/BindingParameters.php#L106-L115
190,132
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/ClassMetadataFactory.php
ClassMetadataFactory.getClassByPath
public function getClassByPath($file, $namespace) { $absPath = realpath($file); $namespaces = explode('/', $absPath); $start = false; $i = 0; $chunk = explode('\\', $namespace); $namespace = array_shift($chunk); while ($namespaces[$i] !...
php
public function getClassByPath($file, $namespace) { $absPath = realpath($file); $namespaces = explode('/', $absPath); $start = false; $i = 0; $chunk = explode('\\', $namespace); $namespace = array_shift($chunk); while ($namespaces[$i] !...
[ "public", "function", "getClassByPath", "(", "$", "file", ",", "$", "namespace", ")", "{", "$", "absPath", "=", "realpath", "(", "$", "file", ")", ";", "$", "namespaces", "=", "explode", "(", "'/'", ",", "$", "absPath", ")", ";", "$", "start", "=", ...
Returns the fully qualified name of a class by its path @param string $file @param string $namespace @return string
[ "Returns", "the", "fully", "qualified", "name", "of", "a", "class", "by", "its", "path" ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/ClassMetadataFactory.php#L143-L163
190,133
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/ClassMetadataFactory.php
ClassMetadataFactory.getClassAnnotation
public function getClassAnnotation($class) { $reflClass = new \ReflectionClass($class); $mappedDocumentClass = static::ANNOTATION_CLASS_CLASS; foreach ($this->annotationReader->getClassAnnotations($reflClass) as $annotation) { if ($annotation instanceof $mappedDocumentClass) { ...
php
public function getClassAnnotation($class) { $reflClass = new \ReflectionClass($class); $mappedDocumentClass = static::ANNOTATION_CLASS_CLASS; foreach ($this->annotationReader->getClassAnnotations($reflClass) as $annotation) { if ($annotation instanceof $mappedDocumentClass) { ...
[ "public", "function", "getClassAnnotation", "(", "$", "class", ")", "{", "$", "reflClass", "=", "new", "\\", "ReflectionClass", "(", "$", "class", ")", ";", "$", "mappedDocumentClass", "=", "static", "::", "ANNOTATION_CLASS_CLASS", ";", "foreach", "(", "$", ...
Returns the annotation of a class. @param string $class @return \Doctrine\ODM\OrientDB\Mapper\Annotations\Document
[ "Returns", "the", "annotation", "of", "a", "class", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/ClassMetadataFactory.php#L171-L183
190,134
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.getTokens
public function getTokens() { preg_match_all("/(\:\w+)/", $this->getSchema(), $matches); $tokens = array(); foreach ($matches[0] as $match) { $tokens[$match] = array(); } return $tokens; }
php
public function getTokens() { preg_match_all("/(\:\w+)/", $this->getSchema(), $matches); $tokens = array(); foreach ($matches[0] as $match) { $tokens[$match] = array(); } return $tokens; }
[ "public", "function", "getTokens", "(", ")", "{", "preg_match_all", "(", "\"/(\\:\\w+)/\"", ",", "$", "this", "->", "getSchema", "(", ")", ",", "$", "matches", ")", ";", "$", "tokens", "=", "array", "(", ")", ";", "foreach", "(", "$", "matches", "[", ...
Analyzing the command's SCHEMA, this method returns all the tokens allocable in the command. @return array
[ "Analyzing", "the", "command", "s", "SCHEMA", "this", "method", "returns", "all", "the", "tokens", "allocable", "in", "the", "command", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L106-L116
190,135
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.where
public function where($condition, $value = null, $append = false, $clause = "WHERE") { if (is_array($value)) { $condition = $this->formatWhereConditionWithMultipleTokens($condition, $value, $this->escapeValidator); } else { if ($value === null) { $condition = ...
php
public function where($condition, $value = null, $append = false, $clause = "WHERE") { if (is_array($value)) { $condition = $this->formatWhereConditionWithMultipleTokens($condition, $value, $this->escapeValidator); } else { if ($value === null) { $condition = ...
[ "public", "function", "where", "(", "$", "condition", ",", "$", "value", "=", "null", ",", "$", "append", "=", "false", ",", "$", "clause", "=", "\"WHERE\"", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", "$", "condition", "=", ...
Adds a WHERE conditions into the current query. @param string $condition @param mixed $value @param boolean $append @param string $clause
[ "Adds", "a", "WHERE", "conditions", "into", "the", "current", "query", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L172-L199
190,136
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.returns
public function returns($returns) { //check if the Return clause is even supported $returnTypes = $this->getValidReturnTypes(); if (count($returnTypes) <= 0) { throw new LogicException("Return clause not supported for this statement"); } $returns = strtoupper($re...
php
public function returns($returns) { //check if the Return clause is even supported $returnTypes = $this->getValidReturnTypes(); if (count($returnTypes) <= 0) { throw new LogicException("Return clause not supported for this statement"); } $returns = strtoupper($re...
[ "public", "function", "returns", "(", "$", "returns", ")", "{", "//check if the Return clause is even supported", "$", "returnTypes", "=", "$", "this", "->", "getValidReturnTypes", "(", ")", ";", "if", "(", "count", "(", "$", "returnTypes", ")", "<=", "0", ")"...
Sets the Returns token @param string $return
[ "Sets", "the", "Returns", "token" ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L217-L230
190,137
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.checkToken
protected function checkToken($token) { if (!array_key_exists($token, $this->tokens)) { throw new TokenNotFoundException($token, get_called_class()); } return $this->tokens[$token]; }
php
protected function checkToken($token) { if (!array_key_exists($token, $this->tokens)) { throw new TokenNotFoundException($token, get_called_class()); } return $this->tokens[$token]; }
[ "protected", "function", "checkToken", "(", "$", "token", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "token", ",", "$", "this", "->", "tokens", ")", ")", "{", "throw", "new", "TokenNotFoundException", "(", "$", "token", ",", "get_called_class"...
Checks if a token is set, returning it if it is. @param string $token @return mixed @throws TokenNotFoundException
[ "Checks", "if", "a", "token", "is", "set", "returning", "it", "if", "it", "is", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L296-L303
190,138
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.clearToken
protected function clearToken($token) { $token = $this->tokenize($token); $this->checkToken($token); $this->tokens[$token] = array(); }
php
protected function clearToken($token) { $token = $this->tokenize($token); $this->checkToken($token); $this->tokens[$token] = array(); }
[ "protected", "function", "clearToken", "(", "$", "token", ")", "{", "$", "token", "=", "$", "this", "->", "tokenize", "(", "$", "token", ")", ";", "$", "this", "->", "checkToken", "(", "$", "token", ")", ";", "$", "this", "->", "tokens", "[", "$", ...
Clears the value of a token. @param string $token
[ "Clears", "the", "value", "of", "a", "token", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L310-L315
190,139
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.getTokenFormatter
protected function getTokenFormatter($token) { $formatters = $this->getTokenFormatters(); if (!array_key_exists($token, $formatters)) { $message = "The class %s does not know how to format the %s token\n". "Have you added it in the getTokenFormatters() method?"; ...
php
protected function getTokenFormatter($token) { $formatters = $this->getTokenFormatters(); if (!array_key_exists($token, $formatters)) { $message = "The class %s does not know how to format the %s token\n". "Have you added it in the getTokenFormatters() method?"; ...
[ "protected", "function", "getTokenFormatter", "(", "$", "token", ")", "{", "$", "formatters", "=", "$", "this", "->", "getTokenFormatters", "(", ")", ";", "if", "(", "!", "array_key_exists", "(", "$", "token", ",", "$", "formatters", ")", ")", "{", "$", ...
Returns the formatter for a particular token. @param string $token @return Array @throws string
[ "Returns", "the", "formatter", "for", "a", "particular", "token", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L352-L364
190,140
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.getTokenReplaces
protected function getTokenReplaces() { $replaces = array(); foreach ($this->tokens as $token => $value) { $key = $this->getFormatter()->untokenize($token); $formatter = $this->getTokenFormatter($key); $replaces[$token] = $formatter::format($v...
php
protected function getTokenReplaces() { $replaces = array(); foreach ($this->tokens as $token => $value) { $key = $this->getFormatter()->untokenize($token); $formatter = $this->getTokenFormatter($key); $replaces[$token] = $formatter::format($v...
[ "protected", "function", "getTokenReplaces", "(", ")", "{", "$", "replaces", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "tokens", "as", "$", "token", "=>", "$", "value", ")", "{", "$", "key", "=", "$", "this", "->", "getFormatter...
Returns the values to replace command's schema tokens. @return array
[ "Returns", "the", "values", "to", "replace", "command", "s", "schema", "tokens", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L371-L382
190,141
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.getValidStatement
protected function getValidStatement() { $schema = $this->getSchema(); $statement = $this->replaceTokens($schema); $statement = preg_replace('/( ){2,}/', ' ', $statement); return trim($statement); }
php
protected function getValidStatement() { $schema = $this->getSchema(); $statement = $this->replaceTokens($schema); $statement = preg_replace('/( ){2,}/', ' ', $statement); return trim($statement); }
[ "protected", "function", "getValidStatement", "(", ")", "{", "$", "schema", "=", "$", "this", "->", "getSchema", "(", ")", ";", "$", "statement", "=", "$", "this", "->", "replaceTokens", "(", "$", "schema", ")", ";", "$", "statement", "=", "preg_replace"...
Build the command replacing schema tokens with actual values and cleaning the command synthax. @return string
[ "Build", "the", "command", "replacing", "schema", "tokens", "with", "actual", "values", "and", "cleaning", "the", "command", "synthax", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L390-L397
190,142
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.replaceTokens
protected function replaceTokens($statement) { $replaces = $this->getTokenReplaces(); return str_replace(array_keys($replaces), $replaces, $statement); }
php
protected function replaceTokens($statement) { $replaces = $this->getTokenReplaces(); return str_replace(array_keys($replaces), $replaces, $statement); }
[ "protected", "function", "replaceTokens", "(", "$", "statement", ")", "{", "$", "replaces", "=", "$", "this", "->", "getTokenReplaces", "(", ")", ";", "return", "str_replace", "(", "array_keys", "(", "$", "replaces", ")", ",", "$", "replaces", ",", "$", ...
Replaces the tokens in the command's schema with their actual values in the current object. @param string $statement @return string
[ "Replaces", "the", "tokens", "in", "the", "command", "s", "schema", "with", "their", "actual", "values", "in", "the", "current", "object", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L430-L435
190,143
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Command.php
Command.setToken
public function setToken($token, $tokenValue, $append = false, $first = false) { return $this->setTokenValues($token, array($tokenValue), $append, $first); }
php
public function setToken($token, $tokenValue, $append = false, $first = false) { return $this->setTokenValues($token, array($tokenValue), $append, $first); }
[ "public", "function", "setToken", "(", "$", "token", ",", "$", "tokenValue", ",", "$", "append", "=", "false", ",", "$", "first", "=", "false", ")", "{", "return", "$", "this", "->", "setTokenValues", "(", "$", "token", ",", "array", "(", "$", "token...
Sets a single value for a token, @param string $token @param string $tokenValue @param boolean $append @param boolean $first @return true
[ "Sets", "a", "single", "value", "for", "a", "token" ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Command.php#L446-L449
190,144
doctrine/orientdb-odm
src/Doctrine/OrientDB/Graph/Vertex.php
Vertex.setPotential
public function setPotential($potential, VertexInterface $from) { $potential = (int) $potential; if (!$this->getPotential() || $potential < $this->getPotential()) { $this->potential = $potential; $this->potentialFrom = $from; return true; } retu...
php
public function setPotential($potential, VertexInterface $from) { $potential = (int) $potential; if (!$this->getPotential() || $potential < $this->getPotential()) { $this->potential = $potential; $this->potentialFrom = $from; return true; } retu...
[ "public", "function", "setPotential", "(", "$", "potential", ",", "VertexInterface", "$", "from", ")", "{", "$", "potential", "=", "(", "int", ")", "$", "potential", ";", "if", "(", "!", "$", "this", "->", "getPotential", "(", ")", "||", "$", "potentia...
Sets the potential for the vertex, if the vertex has no potential or the one it has is higher than the new one. @param integer $potential @param Vertex $from @return boolean
[ "Sets", "the", "potential", "for", "the", "vertex", "if", "the", "vertex", "has", "no", "potential", "or", "the", "one", "it", "has", "is", "higher", "than", "the", "new", "one", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Graph/Vertex.php#L119-L131
190,145
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php
Hydrator.hydrate
public function hydrate(\stdClass $orientObject, Proxy $proxy = null) { $classProperty = static::ORIENT_PROPERTY_CLASS; if ($proxy) { $this->fill($proxy, $orientObject); return $proxy; } elseif (property_exists($orientObject, $classProperty)) { $orientC...
php
public function hydrate(\stdClass $orientObject, Proxy $proxy = null) { $classProperty = static::ORIENT_PROPERTY_CLASS; if ($proxy) { $this->fill($proxy, $orientObject); return $proxy; } elseif (property_exists($orientObject, $classProperty)) { $orientC...
[ "public", "function", "hydrate", "(", "\\", "stdClass", "$", "orientObject", ",", "Proxy", "$", "proxy", "=", "null", ")", "{", "$", "classProperty", "=", "static", "::", "ORIENT_PROPERTY_CLASS", ";", "if", "(", "$", "proxy", ")", "{", "$", "this", "->",...
Takes an Doctrine\OrientDB JSON object and finds the class responsible to map that object. If the class is found, a new POPO is instantiated and the properties inside the JSON object are filled accordingly. @param \stdClass $orientObject @param Proxy $proxy @return Result @throws DocumentNotFoundException
[ "Takes", "an", "Doctrine", "\\", "OrientDB", "JSON", "object", "and", "finds", "the", "class", "responsible", "to", "map", "that", "object", ".", "If", "the", "class", "is", "found", "a", "new", "POPO", "is", "instantiated", "and", "the", "properties", "in...
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php#L86-L109
190,146
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php
Hydrator.hydrateCollection
public function hydrateCollection(array $collection) { $records = array(); foreach ($collection as $key => $record) { if ($record instanceof \stdClass) { $records[$key] = $this->hydrate($record); } else { $records[$key] = $this->hydrateRid(new...
php
public function hydrateCollection(array $collection) { $records = array(); foreach ($collection as $key => $record) { if ($record instanceof \stdClass) { $records[$key] = $this->hydrate($record); } else { $records[$key] = $this->hydrateRid(new...
[ "public", "function", "hydrateCollection", "(", "array", "$", "collection", ")", "{", "$", "records", "=", "array", "(", ")", ";", "foreach", "(", "$", "collection", "as", "$", "key", "=>", "$", "record", ")", "{", "if", "(", "$", "record", "instanceof...
Hydrates an array of documents. @param Array $json @return ArrayCollection
[ "Hydrates", "an", "array", "of", "documents", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php#L117-L130
190,147
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php
Hydrator.createDocument
protected function createDocument($class, \stdClass $orientObject) { $metadata = $this->getMetadataFactory()->getMetadataFor($class); /** * when a record from OrientDB doesn't have a RID * it means it's an embedded object, which can not be * lazily loaded. */ ...
php
protected function createDocument($class, \stdClass $orientObject) { $metadata = $this->getMetadataFactory()->getMetadataFor($class); /** * when a record from OrientDB doesn't have a RID * it means it's an embedded object, which can not be * lazily loaded. */ ...
[ "protected", "function", "createDocument", "(", "$", "class", ",", "\\", "stdClass", "$", "orientObject", ")", "{", "$", "metadata", "=", "$", "this", "->", "getMetadataFactory", "(", ")", "->", "getMetadataFor", "(", "$", "class", ")", ";", "/**\n *...
Either tries to get the proxy @param string $class @param \stdClass $orientObject @return object of type $class
[ "Either", "tries", "to", "get", "the", "proxy" ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php#L174-L198
190,148
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php
Hydrator.castProperty
protected function castProperty($annotation, $propertyValue) { $propertyId = $this->getCastedPropertyCacheKey($annotation->type, $propertyValue); if (!isset($this->castedProperties[$propertyId])) { $method = 'cast' . $this->inflector->camelize($annotation->type); $this->get...
php
protected function castProperty($annotation, $propertyValue) { $propertyId = $this->getCastedPropertyCacheKey($annotation->type, $propertyValue); if (!isset($this->castedProperties[$propertyId])) { $method = 'cast' . $this->inflector->camelize($annotation->type); $this->get...
[ "protected", "function", "castProperty", "(", "$", "annotation", ",", "$", "propertyValue", ")", "{", "$", "propertyId", "=", "$", "this", "->", "getCastedPropertyCacheKey", "(", "$", "annotation", "->", "type", ",", "$", "propertyValue", ")", ";", "if", "("...
Casts a value according to how it was annotated. @param \Doctrine\ODM\OrientDB\Mapper\Annotations\Property $annotation @param mixed $propertyValue @return mixed
[ "Casts", "a", "value", "according", "to", "how", "it", "was", "annotated", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php#L207-L222
190,149
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php
Hydrator.fill
protected function fill($document, \stdClass $object) { $metadata = $this->getMetadataFactory()->getMetadataFor(get_class($document)); $propertyAnnotations = $this->getMetadataFactory()->getObjectPropertyAnnotations($document); foreach ($propertyAnnotations as $property => $annotation) { ...
php
protected function fill($document, \stdClass $object) { $metadata = $this->getMetadataFactory()->getMetadataFor(get_class($document)); $propertyAnnotations = $this->getMetadataFactory()->getObjectPropertyAnnotations($document); foreach ($propertyAnnotations as $property => $annotation) { ...
[ "protected", "function", "fill", "(", "$", "document", ",", "\\", "stdClass", "$", "object", ")", "{", "$", "metadata", "=", "$", "this", "->", "getMetadataFactory", "(", ")", "->", "getMetadataFor", "(", "get_class", "(", "$", "document", ")", ")", ";",...
Given an object and an Orient-object, it fills the former with the latter. @param object $document @param \stdClass $object @return object
[ "Given", "an", "object", "and", "an", "Orient", "-", "object", "it", "fills", "the", "former", "with", "the", "latter", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php#L247-L270
190,150
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php
Hydrator.hydrateValue
protected function hydrateValue($value, PropertyAnnotation $annotation) { if ($annotation->type) { try { $value = $this->castProperty($annotation, $value); } catch (\Exception $e) { if ($annotation->isNullable()) { $value = null; ...
php
protected function hydrateValue($value, PropertyAnnotation $annotation) { if ($annotation->type) { try { $value = $this->castProperty($annotation, $value); } catch (\Exception $e) { if ($annotation->isNullable()) { $value = null; ...
[ "protected", "function", "hydrateValue", "(", "$", "value", ",", "PropertyAnnotation", "$", "annotation", ")", "{", "if", "(", "$", "annotation", "->", "type", ")", "{", "try", "{", "$", "value", "=", "$", "this", "->", "castProperty", "(", "$", "annotat...
Hydrates the value @param $value @param PropertyAnnotation $annotation @return mixed|null @throws \Exception
[ "Hydrates", "the", "value" ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/Hydration/Hydrator.php#L292-L306
190,151
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Caster/Caster.php
Caster.castDecimal
public function castDecimal() { $min = (float) 4.9E-324; $max = (float) 1.7976931348623157E+308; $value = (float) $this->value; if ($value >= $min && $value <= $max) { return $value; } $castFunction = function($value) use ($min,$max) { if...
php
public function castDecimal() { $min = (float) 4.9E-324; $max = (float) 1.7976931348623157E+308; $value = (float) $this->value; if ($value >= $min && $value <= $max) { return $value; } $castFunction = function($value) use ($min,$max) { if...
[ "public", "function", "castDecimal", "(", ")", "{", "$", "min", "=", "(", "float", ")", "4.9E-324", ";", "$", "max", "=", "(", "float", ")", "1.7976931348623157E+308", ";", "$", "value", "=", "(", "float", ")", "$", "this", "->", "value", ";", "if", ...
Casts the internal value to an integer cmprehended between a range of accepted integers. @return integer
[ "Casts", "the", "internal", "value", "to", "an", "integer", "cmprehended", "between", "a", "range", "of", "accepted", "integers", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Caster/Caster.php#L170-L197
190,152
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Caster/Caster.php
Caster.castFloat
public function castFloat() { $castFunction = function ($value) { return (float) $value; }; if (is_numeric($this->value)) { return $castFunction($this->value); } return $this->handleMismatch($castFunction, 'double'); }
php
public function castFloat() { $castFunction = function ($value) { return (float) $value; }; if (is_numeric($this->value)) { return $castFunction($this->value); } return $this->handleMismatch($castFunction, 'double'); }
[ "public", "function", "castFloat", "(", ")", "{", "$", "castFunction", "=", "function", "(", "$", "value", ")", "{", "return", "(", "float", ")", "$", "value", ";", "}", ";", "if", "(", "is_numeric", "(", "$", "this", "->", "value", ")", ")", "{", ...
Casts the value to a float. @return float
[ "Casts", "the", "value", "to", "a", "float", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Caster/Caster.php#L256-L267
190,153
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Caster/Caster.php
Caster.castInteger
public function castInteger() { $castFunction = function ($value) { return is_object($value) ? 1 : (int) $value; }; if (is_numeric($this->value)) { return $castFunction($this->value); } return $this->handleMismatch($castFunction, 'integer'); }
php
public function castInteger() { $castFunction = function ($value) { return is_object($value) ? 1 : (int) $value; }; if (is_numeric($this->value)) { return $castFunction($this->value); } return $this->handleMismatch($castFunction, 'integer'); }
[ "public", "function", "castInteger", "(", ")", "{", "$", "castFunction", "=", "function", "(", "$", "value", ")", "{", "return", "is_object", "(", "$", "value", ")", "?", "1", ":", "(", "int", ")", "$", "value", ";", "}", ";", "if", "(", "is_numeri...
Casts the value into an integer. @return integer
[ "Casts", "the", "value", "into", "an", "integer", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Caster/Caster.php#L274-L285
190,154
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Caster/Caster.php
Caster.castString
public function castString() { $castFunction = function ($value) { return is_array($value) ? 'Array' : (string) $value; }; if (is_string($this->value)) { return $castFunction($this->value); } return $this->handleMismatch($castFunction, 'string'); ...
php
public function castString() { $castFunction = function ($value) { return is_array($value) ? 'Array' : (string) $value; }; if (is_string($this->value)) { return $castFunction($this->value); } return $this->handleMismatch($castFunction, 'string'); ...
[ "public", "function", "castString", "(", ")", "{", "$", "castFunction", "=", "function", "(", "$", "value", ")", "{", "return", "is_array", "(", "$", "value", ")", "?", "'Array'", ":", "(", "string", ")", "$", "value", ";", "}", ";", "if", "(", "is...
Casts the value to string. @return string
[ "Casts", "the", "value", "to", "string", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Caster/Caster.php#L388-L399
190,155
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Caster/Caster.php
Caster.convertJsonCollectionToArray
protected function convertJsonCollectionToArray() { if (!is_array($this->value) && is_object($this->value)) { $orientObjects = array(); $refClass = new \ReflectionObject($this->value); $properties = $refClass->getProperties(\ReflectionProperty::IS_PUBLIC); f...
php
protected function convertJsonCollectionToArray() { if (!is_array($this->value) && is_object($this->value)) { $orientObjects = array(); $refClass = new \ReflectionObject($this->value); $properties = $refClass->getProperties(\ReflectionProperty::IS_PUBLIC); f...
[ "protected", "function", "convertJsonCollectionToArray", "(", ")", "{", "if", "(", "!", "is_array", "(", "$", "this", "->", "value", ")", "&&", "is_object", "(", "$", "this", "->", "value", ")", ")", "{", "$", "orientObjects", "=", "array", "(", ")", "...
If a JSON value is converted in an object containing other objects to hydrate, this method converts the main object in an array.
[ "If", "a", "JSON", "value", "is", "converted", "in", "an", "object", "containing", "other", "objects", "to", "hydrate", "this", "method", "converts", "the", "main", "object", "in", "an", "array", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Caster/Caster.php#L522-L536
190,156
doctrine/orientdb-odm
src/Doctrine/OrientDB/Query/Formatter/Query.php
Query.stripNonSQLCharactersArray
protected static function stripNonSQLCharactersArray(array $strings, $nonFilter = null) { return array_map(function ($string) use ($nonFilter) { return Query::stripNonSQLCharacters($string, $nonFilter); }, $strings); }
php
protected static function stripNonSQLCharactersArray(array $strings, $nonFilter = null) { return array_map(function ($string) use ($nonFilter) { return Query::stripNonSQLCharacters($string, $nonFilter); }, $strings); }
[ "protected", "static", "function", "stripNonSQLCharactersArray", "(", "array", "$", "strings", ",", "$", "nonFilter", "=", "null", ")", "{", "return", "array_map", "(", "function", "(", "$", "string", ")", "use", "(", "$", "nonFilter", ")", "{", "return", ...
Strips non-SQL charactes from the strings contained in the the array leaving intact regular characters a-z and integers. @param array $strings @return array
[ "Strips", "non", "-", "SQL", "charactes", "from", "the", "strings", "contained", "in", "the", "the", "array", "leaving", "intact", "regular", "characters", "a", "-", "z", "and", "integers", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Query/Formatter/Query.php#L68-L73
190,157
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/ClusterMap.php
ClusterMap.identifyClass
public function identifyClass(Rid $rid) { $map = $this->getMap(); $splitRid = explode(':', ltrim($rid->getValue(), '#')); $clusterId = $splitRid[0]; foreach ($map as $class => $clusters) { if (in_array($clusterId, $clusters)) { return $class; ...
php
public function identifyClass(Rid $rid) { $map = $this->getMap(); $splitRid = explode(':', ltrim($rid->getValue(), '#')); $clusterId = $splitRid[0]; foreach ($map as $class => $clusters) { if (in_array($clusterId, $clusters)) { return $class; ...
[ "public", "function", "identifyClass", "(", "Rid", "$", "rid", ")", "{", "$", "map", "=", "$", "this", "->", "getMap", "(", ")", ";", "$", "splitRid", "=", "explode", "(", "':'", ",", "ltrim", "(", "$", "rid", "->", "getValue", "(", ")", ",", "'#...
Tries to identify the class of an rid by matching it against the clusters in the database @param Rid $rid @throws MappingException @return string
[ "Tries", "to", "identify", "the", "class", "of", "an", "rid", "by", "matching", "it", "against", "the", "clusters", "in", "the", "database" ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/ClusterMap.php#L46-L59
190,158
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/ClusterMap.php
ClusterMap.generateMap
public function generateMap() { $map = array(); $database = $this->binding->getDatabase()->getData(); foreach ($database->classes as $class) { $map[$class->name] = $class->clusters; } $this->map = $map; $this->cache->save($this->getCacheKey(), $map); ...
php
public function generateMap() { $map = array(); $database = $this->binding->getDatabase()->getData(); foreach ($database->classes as $class) { $map[$class->name] = $class->clusters; } $this->map = $map; $this->cache->save($this->getCacheKey(), $map); ...
[ "public", "function", "generateMap", "(", ")", "{", "$", "map", "=", "array", "(", ")", ";", "$", "database", "=", "$", "this", "->", "binding", "->", "getDatabase", "(", ")", "->", "getData", "(", ")", ";", "foreach", "(", "$", "database", "->", "...
Creates the mapping of classes to clusters, it is public so it can be called forcibly which will be handy if it's done in some cache-warmup task.
[ "Creates", "the", "mapping", "of", "classes", "to", "clusters", "it", "is", "public", "so", "it", "can", "be", "called", "forcibly", "which", "will", "be", "handy", "if", "it", "s", "done", "in", "some", "cache", "-", "warmup", "task", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/ClusterMap.php#L82-L93
190,159
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/Mapper/ClusterMap.php
ClusterMap.load
protected function load() { if ($this->cache->contains($this->getCacheKey())) { $this->map = $this->cache->fetch($this->getCacheKey()); } else { $this->generateMap(); } }
php
protected function load() { if ($this->cache->contains($this->getCacheKey())) { $this->map = $this->cache->fetch($this->getCacheKey()); } else { $this->generateMap(); } }
[ "protected", "function", "load", "(", ")", "{", "if", "(", "$", "this", "->", "cache", "->", "contains", "(", "$", "this", "->", "getCacheKey", "(", ")", ")", ")", "{", "$", "this", "->", "map", "=", "$", "this", "->", "cache", "->", "fetch", "("...
Tries to load the map from cache, otherwise generates it.
[ "Tries", "to", "load", "the", "map", "from", "cache", "otherwise", "generates", "it", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/Mapper/ClusterMap.php#L99-L106
190,160
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClientResponse.php
CurlClientResponse.getCookies
public function getCookies() { $jar = array(); $headers = $this->getRawHeaders(); if (preg_match_all('/Set-Cookie: (.*)\b/', $headers, $cookies)) { foreach ($cookies[1] as $cookie) { list($cookie,) = explode(';', $cookie, 2); list($name, $value) = ...
php
public function getCookies() { $jar = array(); $headers = $this->getRawHeaders(); if (preg_match_all('/Set-Cookie: (.*)\b/', $headers, $cookies)) { foreach ($cookies[1] as $cookie) { list($cookie,) = explode(';', $cookie, 2); list($name, $value) = ...
[ "public", "function", "getCookies", "(", ")", "{", "$", "jar", "=", "array", "(", ")", ";", "$", "headers", "=", "$", "this", "->", "getRawHeaders", "(", ")", ";", "if", "(", "preg_match_all", "(", "'/Set-Cookie: (.*)\\b/'", ",", "$", "headers", ",", "...
Returns the cookies set in the current response. @return array
[ "Returns", "the", "cookies", "set", "in", "the", "current", "response", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClientResponse.php#L82-L94
190,161
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClientResponse.php
CurlClientResponse.getValidStatusCodes
public function getValidStatusCodes() { return array( self::STATUS_OK, self::STATUS_ACCEPTED, self::STATUS_NON_AUTHORITATIVE_INFORMATION, self::STATUS_NO_CONTENT, self::STATUS_RESET_CONTENT, self::STATUS_PARTIAL_CONTENT, sel...
php
public function getValidStatusCodes() { return array( self::STATUS_OK, self::STATUS_ACCEPTED, self::STATUS_NON_AUTHORITATIVE_INFORMATION, self::STATUS_NO_CONTENT, self::STATUS_RESET_CONTENT, self::STATUS_PARTIAL_CONTENT, sel...
[ "public", "function", "getValidStatusCodes", "(", ")", "{", "return", "array", "(", "self", "::", "STATUS_OK", ",", "self", "::", "STATUS_ACCEPTED", ",", "self", "::", "STATUS_NON_AUTHORITATIVE_INFORMATION", ",", "self", "::", "STATUS_NO_CONTENT", ",", "self", "::...
Returns an array for the HTTP status codes that are considered as valid responses. @return String
[ "Returns", "an", "array", "for", "the", "HTTP", "status", "codes", "that", "are", "considered", "as", "valid", "responses", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClientResponse.php#L112-L123
190,162
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClientResponse.php
CurlClientResponse.buildHeaders
protected function buildHeaders($headers) { $parts = explode("\r\n", $headers); $status = array_shift($parts); $statusParts = explode(' ', $status); if (array_key_exists(0, $statusParts)) { $this->setProtocol($statusParts[0]); } if (array_key_exists(1, $...
php
protected function buildHeaders($headers) { $parts = explode("\r\n", $headers); $status = array_shift($parts); $statusParts = explode(' ', $status); if (array_key_exists(0, $statusParts)) { $this->setProtocol($statusParts[0]); } if (array_key_exists(1, $...
[ "protected", "function", "buildHeaders", "(", "$", "headers", ")", "{", "$", "parts", "=", "explode", "(", "\"\\r\\n\"", ",", "$", "headers", ")", ";", "$", "status", "=", "array_shift", "(", "$", "parts", ")", ";", "$", "statusParts", "=", "explode", ...
Builds headers array from a well-formatted string. @param string $headers
[ "Builds", "headers", "array", "from", "a", "well", "-", "formatted", "string", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClientResponse.php#L130-L154
190,163
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/UnitOfWork.php
UnitOfWork.getRid
protected function getRid(Proxy $proxy) { $metadata = $this->getManager()->getClassMetadata(get_parent_class($proxy)); return $metadata->getIdentifierValues($proxy); }
php
protected function getRid(Proxy $proxy) { $metadata = $this->getManager()->getClassMetadata(get_parent_class($proxy)); return $metadata->getIdentifierValues($proxy); }
[ "protected", "function", "getRid", "(", "Proxy", "$", "proxy", ")", "{", "$", "metadata", "=", "$", "this", "->", "getManager", "(", ")", "->", "getClassMetadata", "(", "get_parent_class", "(", "$", "proxy", ")", ")", ";", "return", "$", "metadata", "->"...
Gets the rid of the proxy. @param Proxy $proxy @return string
[ "Gets", "the", "rid", "of", "the", "proxy", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/UnitOfWork.php#L115-L120
190,164
doctrine/orientdb-odm
src/Doctrine/ODM/OrientDB/UnitOfWork.php
UnitOfWork.load
protected function load(Rid $rid, $fetchPlan = null) { $results = $this->getHydrator()->load(array($rid->getValue()), $fetchPlan); if (isset($results) && count($results)) { $record = is_array($results) ? array_shift($results) : $results; $results = $this->getHydrator()->hydr...
php
protected function load(Rid $rid, $fetchPlan = null) { $results = $this->getHydrator()->load(array($rid->getValue()), $fetchPlan); if (isset($results) && count($results)) { $record = is_array($results) ? array_shift($results) : $results; $results = $this->getHydrator()->hydr...
[ "protected", "function", "load", "(", "Rid", "$", "rid", ",", "$", "fetchPlan", "=", "null", ")", "{", "$", "results", "=", "$", "this", "->", "getHydrator", "(", ")", "->", "load", "(", "array", "(", "$", "rid", "->", "getValue", "(", ")", ")", ...
Executes a query against OrientDB to find the specified RID and finalizes the hydration result. Optionally the query can be executed using the specified fetch plan. @param Rid $rid @param mixed $fetchPlan @return object|null
[ "Executes", "a", "query", "against", "OrientDB", "to", "find", "the", "specified", "RID", "and", "finalizes", "the", "hydration", "result", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/ODM/OrientDB/UnitOfWork.php#L132-L144
190,165
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.getRequestCookies
protected function getRequestCookies() { $pairs = array(); foreach ($this->cookies as $k => $v) { $pairs[] = "$k=$v"; } return join($pairs, ';'); }
php
protected function getRequestCookies() { $pairs = array(); foreach ($this->cookies as $k => $v) { $pairs[] = "$k=$v"; } return join($pairs, ';'); }
[ "protected", "function", "getRequestCookies", "(", ")", "{", "$", "pairs", "=", "array", "(", ")", ";", "foreach", "(", "$", "this", "->", "cookies", "as", "$", "k", "=>", "$", "v", ")", "{", "$", "pairs", "[", "]", "=", "\"$k=$v\"", ";", "}", "r...
Returns a string with the list of cookies for the Cookie header. @return string
[ "Returns", "a", "string", "with", "the", "list", "of", "cookies", "for", "the", "Cookie", "header", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L70-L79
190,166
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.execute
public function execute($method, $location) { curl_setopt_array($this->curl, array( CURLOPT_URL => $location, CURLOPT_COOKIE => $this->getRequestCookies(), CURLOPT_CUSTOMREQUEST => $method, )); if (!$response = curl_exec($this->curl)) { $this-...
php
public function execute($method, $location) { curl_setopt_array($this->curl, array( CURLOPT_URL => $location, CURLOPT_COOKIE => $this->getRequestCookies(), CURLOPT_CUSTOMREQUEST => $method, )); if (!$response = curl_exec($this->curl)) { $this-...
[ "public", "function", "execute", "(", "$", "method", ",", "$", "location", ")", "{", "curl_setopt_array", "(", "$", "this", "->", "curl", ",", "array", "(", "CURLOPT_URL", "=>", "$", "location", ",", "CURLOPT_COOKIE", "=>", "$", "this", "->", "getRequestCo...
Executes a Curl. @param String $method @param String $location @return CurlClientResponse @throws Inconsistent
[ "Executes", "a", "Curl", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L89-L110
190,167
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.delete
public function delete($location, $body = null) { curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, "DELETE"); if ($body) { curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body); } return $this->execute('DELETE', $location); }
php
public function delete($location, $body = null) { curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, "DELETE"); if ($body) { curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body); } return $this->execute('DELETE', $location); }
[ "public", "function", "delete", "(", "$", "location", ",", "$", "body", "=", "null", ")", "{", "curl_setopt", "(", "$", "this", "->", "curl", ",", "CURLOPT_CUSTOMREQUEST", ",", "\"DELETE\"", ")", ";", "if", "(", "$", "body", ")", "{", "curl_setopt", "(...
Executes a DELETE on a resource. @param String $location @return CurlClientResponse
[ "Executes", "a", "DELETE", "on", "a", "resource", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L118-L127
190,168
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.get
public function get($location) { curl_setopt($this->curl, CURLOPT_HTTPGET, true); return $this->execute('GET', $location); }
php
public function get($location) { curl_setopt($this->curl, CURLOPT_HTTPGET, true); return $this->execute('GET', $location); }
[ "public", "function", "get", "(", "$", "location", ")", "{", "curl_setopt", "(", "$", "this", "->", "curl", ",", "CURLOPT_HTTPGET", ",", "true", ")", ";", "return", "$", "this", "->", "execute", "(", "'GET'", ",", "$", "location", ")", ";", "}" ]
GETs a resource. @param String $location @return CurlClientResponse
[ "GETs", "a", "resource", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L135-L140
190,169
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.post
public function post($location, $body) { curl_setopt($this->curl, CURLOPT_POST, 1); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body); curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); return $this->execute('POST', $location); }
php
public function post($location, $body) { curl_setopt($this->curl, CURLOPT_POST, 1); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body); curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); return $this->execute('POST', $location); }
[ "public", "function", "post", "(", "$", "location", ",", "$", "body", ")", "{", "curl_setopt", "(", "$", "this", "->", "curl", ",", "CURLOPT_POST", ",", "1", ")", ";", "curl_setopt", "(", "$", "this", "->", "curl", ",", "CURLOPT_POSTFIELDS", ",", "$", ...
Executes a POST on a location. @param String $location @param String $body @return CurlClientResponse
[ "Executes", "a", "POST", "on", "a", "location", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L149-L156
190,170
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.put
public function put($location, $body) { curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body); curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); return $this->execute('PUT', $location); }
php
public function put($location, $body) { curl_setopt($this->curl, CURLOPT_CUSTOMREQUEST, 'PUT'); curl_setopt($this->curl, CURLOPT_POSTFIELDS, $body); curl_setopt($this->curl, CURLOPT_HTTPHEADER, array('Content-Type: application/json')); return $this->execute('PUT', $location); }
[ "public", "function", "put", "(", "$", "location", ",", "$", "body", ")", "{", "curl_setopt", "(", "$", "this", "->", "curl", ",", "CURLOPT_CUSTOMREQUEST", ",", "'PUT'", ")", ";", "curl_setopt", "(", "$", "this", "->", "curl", ",", "CURLOPT_POSTFIELDS", ...
PUTs a resource. @param String $location @param String $body @return CurlClientResponse
[ "PUTs", "a", "resource", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L165-L172
190,171
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.setAuthentication
public function setAuthentication($credentials) { $this->authentication = $credentials; curl_setopt($this->curl, CURLOPT_USERPWD, $credentials); }
php
public function setAuthentication($credentials) { $this->authentication = $credentials; curl_setopt($this->curl, CURLOPT_USERPWD, $credentials); }
[ "public", "function", "setAuthentication", "(", "$", "credentials", ")", "{", "$", "this", "->", "authentication", "=", "$", "credentials", ";", "curl_setopt", "(", "$", "this", "->", "curl", ",", "CURLOPT_USERPWD", ",", "$", "credentials", ")", ";", "}" ]
Sets the authentication string for the next HTTP requests. @param String $credentials
[ "Sets", "the", "authentication", "string", "for", "the", "next", "HTTP", "requests", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L179-L183
190,172
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.restart
public function restart() { curl_close($this->curl); $this->cookies = array(); $this->curl = $this->createCurlHandle(); }
php
public function restart() { curl_close($this->curl); $this->cookies = array(); $this->curl = $this->createCurlHandle(); }
[ "public", "function", "restart", "(", ")", "{", "curl_close", "(", "$", "this", "->", "curl", ")", ";", "$", "this", "->", "cookies", "=", "array", "(", ")", ";", "$", "this", "->", "curl", "=", "$", "this", "->", "createCurlHandle", "(", ")", ";",...
Reinitializes the client for a completely new session.
[ "Reinitializes", "the", "client", "for", "a", "completely", "new", "session", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L199-L205
190,173
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php
CurlClient.createCurlHandle
protected function createCurlHandle() { $options = $this->getDefaultCurlOptions(); if (isset($this->authentication)) { $options[CURLOPT_USERPWD] = $this->authentication; } $curl = curl_init(); curl_setopt_array($curl, $options); return $curl; }
php
protected function createCurlHandle() { $options = $this->getDefaultCurlOptions(); if (isset($this->authentication)) { $options[CURLOPT_USERPWD] = $this->authentication; } $curl = curl_init(); curl_setopt_array($curl, $options); return $curl; }
[ "protected", "function", "createCurlHandle", "(", ")", "{", "$", "options", "=", "$", "this", "->", "getDefaultCurlOptions", "(", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "authentication", ")", ")", "{", "$", "options", "[", "CURLOPT_USERPWD",...
Creates and initializes the underlying cURL handle. @return resource
[ "Creates", "and", "initializes", "the", "underlying", "cURL", "handle", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/Client/Http/CurlClient.php#L225-L237
190,174
web-token/jwt-encryption
Util/RSACrypt.php
RSACrypt.encryptRSAESOAEP
private static function encryptRSAESOAEP(RSAKey $key, string $m, Hash $hash): string { $mLen = \mb_strlen($m, '8bit'); $lHash = $hash->hash(''); $ps = \str_repeat(\chr(0), $key->getModulusLength() - $mLen - 2 * $hash->getLength() - 2); $db = $lHash.$ps.\chr(1).$m; $seed = \ra...
php
private static function encryptRSAESOAEP(RSAKey $key, string $m, Hash $hash): string { $mLen = \mb_strlen($m, '8bit'); $lHash = $hash->hash(''); $ps = \str_repeat(\chr(0), $key->getModulusLength() - $mLen - 2 * $hash->getLength() - 2); $db = $lHash.$ps.\chr(1).$m; $seed = \ra...
[ "private", "static", "function", "encryptRSAESOAEP", "(", "RSAKey", "$", "key", ",", "string", "$", "m", ",", "Hash", "$", "hash", ")", ":", "string", "{", "$", "mLen", "=", "\\", "mb_strlen", "(", "$", "m", ",", "'8bit'", ")", ";", "$", "lHash", "...
RSAES-OAEP-ENCRYPT.
[ "RSAES", "-", "OAEP", "-", "ENCRYPT", "." ]
259d51b86326b7fde590e904f6e2fea6f5aa6627
https://github.com/web-token/jwt-encryption/blob/259d51b86326b7fde590e904f6e2fea6f5aa6627/Util/RSACrypt.php#L208-L226
190,175
lciolecki/php-image-optimizer
src/Extlib/ImageOptimizer.php
ImageOptimizer.setOptiPng
public function setOptiPng(\PHPImageOptim\Tools\Png\OptiPng $optiPng) { $this->optiPng = $optiPng; return $this; }
php
public function setOptiPng(\PHPImageOptim\Tools\Png\OptiPng $optiPng) { $this->optiPng = $optiPng; return $this; }
[ "public", "function", "setOptiPng", "(", "\\", "PHPImageOptim", "\\", "Tools", "\\", "Png", "\\", "OptiPng", "$", "optiPng", ")", "{", "$", "this", "->", "optiPng", "=", "$", "optiPng", ";", "return", "$", "this", ";", "}" ]
Set png adapter @param \PHPImageOptim\Tools\Png\OptiPng $optiPng @return \Extlib\ImageOptimizer
[ "Set", "png", "adapter" ]
d205161f38aac05e941868eaf3c54936af97fb32
https://github.com/lciolecki/php-image-optimizer/blob/d205161f38aac05e941868eaf3c54936af97fb32/src/Extlib/ImageOptimizer.php#L150-L154
190,176
lciolecki/php-image-optimizer
src/Extlib/ImageOptimizer.php
ImageOptimizer.setJpegOptim
public function setJpegOptim(\PHPImageOptim\Tools\Jpeg\JpegOptim $jpegOptim) { $this->jpegOptim = $jpegOptim; return $this; }
php
public function setJpegOptim(\PHPImageOptim\Tools\Jpeg\JpegOptim $jpegOptim) { $this->jpegOptim = $jpegOptim; return $this; }
[ "public", "function", "setJpegOptim", "(", "\\", "PHPImageOptim", "\\", "Tools", "\\", "Jpeg", "\\", "JpegOptim", "$", "jpegOptim", ")", "{", "$", "this", "->", "jpegOptim", "=", "$", "jpegOptim", ";", "return", "$", "this", ";", "}" ]
Set jpeg adapter @param \PHPImageOptim\Tools\Jpeg\JpegOptim $jpegOptim @return \Extlib\ImageOptimizer
[ "Set", "jpeg", "adapter" ]
d205161f38aac05e941868eaf3c54936af97fb32
https://github.com/lciolecki/php-image-optimizer/blob/d205161f38aac05e941868eaf3c54936af97fb32/src/Extlib/ImageOptimizer.php#L162-L166
190,177
lciolecki/php-image-optimizer
src/Extlib/ImageOptimizer.php
ImageOptimizer.setGifsicle
public function setGifsicle(\PHPImageOptim\Tools\Gif\Gifsicle $gifsicle) { $this->gifsicle = $gifsicle; return $this; }
php
public function setGifsicle(\PHPImageOptim\Tools\Gif\Gifsicle $gifsicle) { $this->gifsicle = $gifsicle; return $this; }
[ "public", "function", "setGifsicle", "(", "\\", "PHPImageOptim", "\\", "Tools", "\\", "Gif", "\\", "Gifsicle", "$", "gifsicle", ")", "{", "$", "this", "->", "gifsicle", "=", "$", "gifsicle", ";", "return", "$", "this", ";", "}" ]
Set gif adapter @param \PHPImageOptim\Tools\Gif\Gifsicle $gifsicle @return \Extlib\ImageOptimizer
[ "Set", "gif", "adapter" ]
d205161f38aac05e941868eaf3c54936af97fb32
https://github.com/lciolecki/php-image-optimizer/blob/d205161f38aac05e941868eaf3c54936af97fb32/src/Extlib/ImageOptimizer.php#L174-L178
190,178
codeswholesale/codeswholesale-sdk-php
src/CodesWholesale/Resource/Product.php
Product.getDefaultPrice
public function getDefaultPrice() { $prices = $this->getPrices(); foreach ($prices as $price) { if ($price->from == 1) { return $price->value; } } }
php
public function getDefaultPrice() { $prices = $this->getPrices(); foreach ($prices as $price) { if ($price->from == 1) { return $price->value; } } }
[ "public", "function", "getDefaultPrice", "(", ")", "{", "$", "prices", "=", "$", "this", "->", "getPrices", "(", ")", ";", "foreach", "(", "$", "prices", "as", "$", "price", ")", "{", "if", "(", "$", "price", "->", "from", "==", "1", ")", "{", "r...
Returns first price range's price. The one from price list. @return float
[ "Returns", "first", "price", "range", "s", "price", ".", "The", "one", "from", "price", "list", "." ]
08907531d7827fef13de10bc3d8bd5a453e1b10e
https://github.com/codeswholesale/codeswholesale-sdk-php/blob/08907531d7827fef13de10bc3d8bd5a453e1b10e/src/CodesWholesale/Resource/Product.php#L148-L156
190,179
codeswholesale/codeswholesale-sdk-php
src/CodesWholesale/Resource/Product.php
Product.getLowestPrice
public function getLowestPrice() { $prices = $this->getPrices(); $lowest = $prices[0]->value; foreach ($prices as $price) { if ($price->value < $lowest) { $lowest = $price->value; } } return $lowest; }
php
public function getLowestPrice() { $prices = $this->getPrices(); $lowest = $prices[0]->value; foreach ($prices as $price) { if ($price->value < $lowest) { $lowest = $price->value; } } return $lowest; }
[ "public", "function", "getLowestPrice", "(", ")", "{", "$", "prices", "=", "$", "this", "->", "getPrices", "(", ")", ";", "$", "lowest", "=", "$", "prices", "[", "0", "]", "->", "value", ";", "foreach", "(", "$", "prices", "as", "$", "price", ")", ...
Returns lowest price for product. @return float
[ "Returns", "lowest", "price", "for", "product", "." ]
08907531d7827fef13de10bc3d8bd5a453e1b10e
https://github.com/codeswholesale/codeswholesale-sdk-php/blob/08907531d7827fef13de10bc3d8bd5a453e1b10e/src/CodesWholesale/Resource/Product.php#L163-L173
190,180
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/HttpBinding.php
HttpBinding.getLocation
protected function getLocation($method, $database = null, array $arguments = null) { $location = "http://{$this->server}/$method"; if ($database) { $location .= '/' . rawurlencode($database); } if ($arguments) { $location .= '/' . implode('/', array_map('raw...
php
protected function getLocation($method, $database = null, array $arguments = null) { $location = "http://{$this->server}/$method"; if ($database) { $location .= '/' . rawurlencode($database); } if ($arguments) { $location .= '/' . implode('/', array_map('raw...
[ "protected", "function", "getLocation", "(", "$", "method", ",", "$", "database", "=", "null", ",", "array", "$", "arguments", "=", "null", ")", "{", "$", "location", "=", "\"http://{$this->server}/$method\"", ";", "if", "(", "$", "database", ")", "{", "$"...
Creates a relative URL for the specified OrientDB method call. @param string $method @param string $database @param array $arguments @return string
[ "Creates", "a", "relative", "URL", "for", "the", "specified", "OrientDB", "method", "call", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/HttpBinding.php#L58-L71
190,181
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/HttpBinding.php
HttpBinding.getQueryLocation
protected function getQueryLocation($database, $query, $limit = null, $fetchPlan = null, $language = BindingInterface::LANGUAGE_SQLPLUS) { $arguments = array($language, $query); if (isset($limit)) { $arguments[] = $limit; } if (isset($fetchPlan)) { $argument...
php
protected function getQueryLocation($database, $query, $limit = null, $fetchPlan = null, $language = BindingInterface::LANGUAGE_SQLPLUS) { $arguments = array($language, $query); if (isset($limit)) { $arguments[] = $limit; } if (isset($fetchPlan)) { $argument...
[ "protected", "function", "getQueryLocation", "(", "$", "database", ",", "$", "query", ",", "$", "limit", "=", "null", ",", "$", "fetchPlan", "=", "null", ",", "$", "language", "=", "BindingInterface", "::", "LANGUAGE_SQLPLUS", ")", "{", "$", "arguments", "...
Returns the URL for the execution of a query. @param string $database @param string $query @param int $limit @param string $fetchPlan @return string
[ "Returns", "the", "URL", "for", "the", "execution", "of", "a", "query", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/HttpBinding.php#L82-L95
190,182
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/HttpBinding.php
HttpBinding.getDocumentLocation
protected function getDocumentLocation($database, $rid = null, $fetchPlan = null) { $this->ensureDatabase($database); $arguments = array($rid); if ($fetchPlan) { $arguments[] = $fetchPlan; } return $this->getLocation('document', $database, $arguments); }
php
protected function getDocumentLocation($database, $rid = null, $fetchPlan = null) { $this->ensureDatabase($database); $arguments = array($rid); if ($fetchPlan) { $arguments[] = $fetchPlan; } return $this->getLocation('document', $database, $arguments); }
[ "protected", "function", "getDocumentLocation", "(", "$", "database", ",", "$", "rid", "=", "null", ",", "$", "fetchPlan", "=", "null", ")", "{", "$", "this", "->", "ensureDatabase", "(", "$", "database", ")", ";", "$", "arguments", "=", "array", "(", ...
Returns the URL to fetch a document. @param string $database @param string $rid @param string $fetchPlan @return string
[ "Returns", "the", "URL", "to", "fetch", "a", "document", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/HttpBinding.php#L105-L115
190,183
doctrine/orientdb-odm
src/Doctrine/OrientDB/Binding/HttpBinding.php
HttpBinding.getClusterLocation
protected function getClusterLocation($database, $cluster, $limit = null) { $this->ensureDatabase($database); return $this->getLocation('cluster', $database, array($cluster, $limit)); }
php
protected function getClusterLocation($database, $cluster, $limit = null) { $this->ensureDatabase($database); return $this->getLocation('cluster', $database, array($cluster, $limit)); }
[ "protected", "function", "getClusterLocation", "(", "$", "database", ",", "$", "cluster", ",", "$", "limit", "=", "null", ")", "{", "$", "this", "->", "ensureDatabase", "(", "$", "database", ")", ";", "return", "$", "this", "->", "getLocation", "(", "'cl...
Returns the URL to fetch a cluster. @param string $database @param string $cluster @param int $limit @return string
[ "Returns", "the", "URL", "to", "fetch", "a", "cluster", "." ]
f1f9ff49a020fb2bed60f86c379a07bf68dd162c
https://github.com/doctrine/orientdb-odm/blob/f1f9ff49a020fb2bed60f86c379a07bf68dd162c/src/Doctrine/OrientDB/Binding/HttpBinding.php#L139-L144
190,184
Vinelab/minion
src/Vinelab/Minion/Dictionary.php
Dictionary.toKeyValue
public function toKeyValue(array $values) { $result = []; foreach ($values as $key => $value) { if (is_array($value)) { $result[$key] = $this->toKeyValue($value); } elseif (is_object($value)) { $result[$key] = $this->toKeyValue((array) $value)...
php
public function toKeyValue(array $values) { $result = []; foreach ($values as $key => $value) { if (is_array($value)) { $result[$key] = $this->toKeyValue($value); } elseif (is_object($value)) { $result[$key] = $this->toKeyValue((array) $value)...
[ "public", "function", "toKeyValue", "(", "array", "$", "values", ")", "{", "$", "result", "=", "[", "]", ";", "foreach", "(", "$", "values", "as", "$", "key", "=>", "$", "value", ")", "{", "if", "(", "is_array", "(", "$", "value", ")", ")", "{", ...
Transform the given array of values into a key-value pair recursively. @param array $values @return array
[ "Transform", "the", "given", "array", "of", "values", "into", "a", "key", "-", "value", "pair", "recursively", "." ]
0f9cf9bfeb9372f975f30eb197ab98906393b12a
https://github.com/Vinelab/minion/blob/0f9cf9bfeb9372f975f30eb197ab98906393b12a/src/Vinelab/Minion/Dictionary.php#L48-L63
190,185
dunglas/php-socialshare
src/SocialShare/SocialShare.php
SocialShare.getLink
public function getLink($providerName, $url, array $options = array()) { $this->checkProvider($providerName); return $this->providers[$providerName]['provider']->getLink($url, $options); }
php
public function getLink($providerName, $url, array $options = array()) { $this->checkProvider($providerName); return $this->providers[$providerName]['provider']->getLink($url, $options); }
[ "public", "function", "getLink", "(", "$", "providerName", ",", "$", "url", ",", "array", "$", "options", "=", "array", "(", ")", ")", "{", "$", "this", "->", "checkProvider", "(", "$", "providerName", ")", ";", "return", "$", "this", "->", "providers"...
Gets the sharing links for the given provider and url. @param string $providerName @param string $url @param array $options @throws \RuntimeException @return string
[ "Gets", "the", "sharing", "links", "for", "the", "given", "provider", "and", "url", "." ]
5745c4985e853be7133dd8be169139b665509e3a
https://github.com/dunglas/php-socialshare/blob/5745c4985e853be7133dd8be169139b665509e3a/src/SocialShare/SocialShare.php#L71-L76
190,186
dunglas/php-socialshare
src/SocialShare/SocialShare.php
SocialShare.getShares
public function getShares($providerName, $url, $delayUpdate = false) { $this->checkProvider($providerName); $id = $this->getId($providerName, $url); $lifeTime = $this->providers[$providerName]['lifeTime']; $now = new \DateTime(); $dataFromCache = $this->cache->fetch($id); ...
php
public function getShares($providerName, $url, $delayUpdate = false) { $this->checkProvider($providerName); $id = $this->getId($providerName, $url); $lifeTime = $this->providers[$providerName]['lifeTime']; $now = new \DateTime(); $dataFromCache = $this->cache->fetch($id); ...
[ "public", "function", "getShares", "(", "$", "providerName", ",", "$", "url", ",", "$", "delayUpdate", "=", "false", ")", "{", "$", "this", "->", "checkProvider", "(", "$", "providerName", ")", ";", "$", "id", "=", "$", "this", "->", "getId", "(", "$...
Gets the number of share of the given URL on the given provider. @param string $providerName @param string $url @param bool $delayUpdate @throws \RuntimeException @return int
[ "Gets", "the", "number", "of", "share", "of", "the", "given", "URL", "on", "the", "given", "provider", "." ]
5745c4985e853be7133dd8be169139b665509e3a
https://github.com/dunglas/php-socialshare/blob/5745c4985e853be7133dd8be169139b665509e3a/src/SocialShare/SocialShare.php#L89-L114
190,187
dunglas/php-socialshare
src/SocialShare/SocialShare.php
SocialShare.getSharesTotal
public function getSharesTotal($url) { $shares = 0; foreach ($this->providers as $providerName => $provider) { $shares += $this->getShares($providerName, $url); } return $shares; }
php
public function getSharesTotal($url) { $shares = 0; foreach ($this->providers as $providerName => $provider) { $shares += $this->getShares($providerName, $url); } return $shares; }
[ "public", "function", "getSharesTotal", "(", "$", "url", ")", "{", "$", "shares", "=", "0", ";", "foreach", "(", "$", "this", "->", "providers", "as", "$", "providerName", "=>", "$", "provider", ")", "{", "$", "shares", "+=", "$", "this", "->", "getS...
Gets the total number of share of the given URL for all providers. @param string $url @throws \RuntimeException @return int
[ "Gets", "the", "total", "number", "of", "share", "of", "the", "given", "URL", "for", "all", "providers", "." ]
5745c4985e853be7133dd8be169139b665509e3a
https://github.com/dunglas/php-socialshare/blob/5745c4985e853be7133dd8be169139b665509e3a/src/SocialShare/SocialShare.php#L125-L133
190,188
dunglas/php-socialshare
src/SocialShare/SocialShare.php
SocialShare.update
public function update() { $now = new \DateTime(); foreach ($this->toUpdate as $providerName => $urls) { foreach ($urls as $url) { $shares = $this->providers[$providerName]['provider']->getShares($url); $this->cache->save($this->getId($providerName, $url...
php
public function update() { $now = new \DateTime(); foreach ($this->toUpdate as $providerName => $urls) { foreach ($urls as $url) { $shares = $this->providers[$providerName]['provider']->getShares($url); $this->cache->save($this->getId($providerName, $url...
[ "public", "function", "update", "(", ")", "{", "$", "now", "=", "new", "\\", "DateTime", "(", ")", ";", "foreach", "(", "$", "this", "->", "toUpdate", "as", "$", "providerName", "=>", "$", "urls", ")", "{", "foreach", "(", "$", "urls", "as", "$", ...
Updates delayed URLs.
[ "Updates", "delayed", "URLs", "." ]
5745c4985e853be7133dd8be169139b665509e3a
https://github.com/dunglas/php-socialshare/blob/5745c4985e853be7133dd8be169139b665509e3a/src/SocialShare/SocialShare.php#L138-L149
190,189
Vinelab/minion
src/Vinelab/Minion/Client.php
Client.start
public function start($debug = false, $startLoop = true) { if (!$debug) { Logger::set(new NullLogger()); } parent::start($startLoop); }
php
public function start($debug = false, $startLoop = true) { if (!$debug) { Logger::set(new NullLogger()); } parent::start($startLoop); }
[ "public", "function", "start", "(", "$", "debug", "=", "false", ",", "$", "startLoop", "=", "true", ")", "{", "if", "(", "!", "$", "debug", ")", "{", "Logger", "::", "set", "(", "new", "NullLogger", "(", ")", ")", ";", "}", "parent", "::", "start...
Start the transport. @param bool $startLoop @throws \Exception
[ "Start", "the", "transport", "." ]
0f9cf9bfeb9372f975f30eb197ab98906393b12a
https://github.com/Vinelab/minion/blob/0f9cf9bfeb9372f975f30eb197ab98906393b12a/src/Vinelab/Minion/Client.php#L78-L85
190,190
Vinelab/minion
src/Vinelab/Minion/Client.php
Client.call
public function call($procedure, $arguments = null, $argumentsKw = null, $options = null) { return $this->getSession()->call($this->prepareTopic($procedure), $arguments, $argumentsKw, $options); }
php
public function call($procedure, $arguments = null, $argumentsKw = null, $options = null) { return $this->getSession()->call($this->prepareTopic($procedure), $arguments, $argumentsKw, $options); }
[ "public", "function", "call", "(", "$", "procedure", ",", "$", "arguments", "=", "null", ",", "$", "argumentsKw", "=", "null", ",", "$", "options", "=", "null", ")", "{", "return", "$", "this", "->", "getSession", "(", ")", "->", "call", "(", "$", ...
Call a registered procedure. @param string $procedure @param array $arguments @param array $argumentsKw @param array $options @return \React\Promise\Promise
[ "Call", "a", "registered", "procedure", "." ]
0f9cf9bfeb9372f975f30eb197ab98906393b12a
https://github.com/Vinelab/minion/blob/0f9cf9bfeb9372f975f30eb197ab98906393b12a/src/Vinelab/Minion/Client.php#L121-L124
190,191
Vinelab/minion
src/Vinelab/Minion/Client.php
Client.subscribe
public function subscribe($topic, $callback, $options = null, $isFunction = false) { return $this->getSession()->subscribe( $this->prepareTopic($topic), $this->wrapWithProxy($callback, $isFunction), $options ); }
php
public function subscribe($topic, $callback, $options = null, $isFunction = false) { return $this->getSession()->subscribe( $this->prepareTopic($topic), $this->wrapWithProxy($callback, $isFunction), $options ); }
[ "public", "function", "subscribe", "(", "$", "topic", ",", "$", "callback", ",", "$", "options", "=", "null", ",", "$", "isFunction", "=", "false", ")", "{", "return", "$", "this", "->", "getSession", "(", ")", "->", "subscribe", "(", "$", "this", "-...
Subscribe to a topic and specify a callback for it. @param string $topic The topic name. @param string|Closure $callback The callable to be called when the topic received a publish. @param array $options Will be passed straight to thruway @see \Thruway\ClientSession::subscribe @param bool ...
[ "Subscribe", "to", "a", "topic", "and", "specify", "a", "callback", "for", "it", "." ]
0f9cf9bfeb9372f975f30eb197ab98906393b12a
https://github.com/Vinelab/minion/blob/0f9cf9bfeb9372f975f30eb197ab98906393b12a/src/Vinelab/Minion/Client.php#L140-L147
190,192
Vinelab/minion
src/Vinelab/Minion/Client.php
Client.register
public function register($topic, $callback, $options = null, $isFunction = false) { return $this->getCallee()->register( $this->getSession(), $this->prepareTopic($topic), $this->wrapWithProxy($callback, $isFunction), $options ); }
php
public function register($topic, $callback, $options = null, $isFunction = false) { return $this->getCallee()->register( $this->getSession(), $this->prepareTopic($topic), $this->wrapWithProxy($callback, $isFunction), $options ); }
[ "public", "function", "register", "(", "$", "topic", ",", "$", "callback", ",", "$", "options", "=", "null", ",", "$", "isFunction", "=", "false", ")", "{", "return", "$", "this", "->", "getCallee", "(", ")", "->", "register", "(", "$", "this", "->",...
Register a RPC. @param string $topic @param Closure $callback @param array $options @param bool $isFunction @return \React\Promise\Promise
[ "Register", "a", "RPC", "." ]
0f9cf9bfeb9372f975f30eb197ab98906393b12a
https://github.com/Vinelab/minion/blob/0f9cf9bfeb9372f975f30eb197ab98906393b12a/src/Vinelab/Minion/Client.php#L174-L182
190,193
appstract/laravel-meta
src/Metable.php
Metable.hasMeta
public function hasMeta($key) { $meta = $this->meta()->where('key', $key)->get(); return (bool) count($meta); }
php
public function hasMeta($key) { $meta = $this->meta()->where('key', $key)->get(); return (bool) count($meta); }
[ "public", "function", "hasMeta", "(", "$", "key", ")", "{", "$", "meta", "=", "$", "this", "->", "meta", "(", ")", "->", "where", "(", "'key'", ",", "$", "key", ")", "->", "get", "(", ")", ";", "return", "(", "bool", ")", "count", "(", "$", "...
Has meta. @param string $key @return bool
[ "Has", "meta", "." ]
37611ccb49e7a903f10773343295be1ddef5a73f
https://github.com/appstract/laravel-meta/blob/37611ccb49e7a903f10773343295be1ddef5a73f/src/Metable.php#L23-L28
190,194
appstract/laravel-meta
src/Metable.php
Metable.getMeta
public function getMeta($key, $default = null) { $meta = $this->meta()->where('key', $key)->get(); if ($meta->count() <= 1) { return $meta->count() == 1 ? $meta->first() : $default; } return $meta; }
php
public function getMeta($key, $default = null) { $meta = $this->meta()->where('key', $key)->get(); if ($meta->count() <= 1) { return $meta->count() == 1 ? $meta->first() : $default; } return $meta; }
[ "public", "function", "getMeta", "(", "$", "key", ",", "$", "default", "=", "null", ")", "{", "$", "meta", "=", "$", "this", "->", "meta", "(", ")", "->", "where", "(", "'key'", ",", "$", "key", ")", "->", "get", "(", ")", ";", "if", "(", "$"...
Get meta. @param string $key @param mixed $default @return object
[ "Get", "meta", "." ]
37611ccb49e7a903f10773343295be1ddef5a73f
https://github.com/appstract/laravel-meta/blob/37611ccb49e7a903f10773343295be1ddef5a73f/src/Metable.php#L37-L46
190,195
appstract/laravel-meta
src/Metable.php
Metable.updateMeta
public function updateMeta($key, $value) { if ($meta = $this->getMeta($key)) { $meta->value = $value; return $meta->save(); } return false; }
php
public function updateMeta($key, $value) { if ($meta = $this->getMeta($key)) { $meta->value = $value; return $meta->save(); } return false; }
[ "public", "function", "updateMeta", "(", "$", "key", ",", "$", "value", ")", "{", "if", "(", "$", "meta", "=", "$", "this", "->", "getMeta", "(", "$", "key", ")", ")", "{", "$", "meta", "->", "value", "=", "$", "value", ";", "return", "$", "met...
Update meta. @param string $key @param mixed $value @return object|bool
[ "Update", "meta", "." ]
37611ccb49e7a903f10773343295be1ddef5a73f
https://github.com/appstract/laravel-meta/blob/37611ccb49e7a903f10773343295be1ddef5a73f/src/Metable.php#L69-L78
190,196
appstract/laravel-meta
src/Metable.php
Metable.addOrUpdateMeta
public function addOrUpdateMeta($key, $value) { return $this->hasMeta($key) ? $this->updateMeta($key, $value) : $this->addMeta($key, $value); }
php
public function addOrUpdateMeta($key, $value) { return $this->hasMeta($key) ? $this->updateMeta($key, $value) : $this->addMeta($key, $value); }
[ "public", "function", "addOrUpdateMeta", "(", "$", "key", ",", "$", "value", ")", "{", "return", "$", "this", "->", "hasMeta", "(", "$", "key", ")", "?", "$", "this", "->", "updateMeta", "(", "$", "key", ",", "$", "value", ")", ":", "$", "this", ...
Add or update meta if it already exists. @param string $key @param mixed $value @return object|bool
[ "Add", "or", "update", "meta", "if", "it", "already", "exists", "." ]
37611ccb49e7a903f10773343295be1ddef5a73f
https://github.com/appstract/laravel-meta/blob/37611ccb49e7a903f10773343295be1ddef5a73f/src/Metable.php#L86-L89
190,197
appstract/laravel-meta
src/Metable.php
Metable.deleteMeta
public function deleteMeta($key, $value = null) { return $value ? $this->meta()->where('key', $key)->where('value', $value)->delete() : $this->meta()->where('key', $key)->delete(); }
php
public function deleteMeta($key, $value = null) { return $value ? $this->meta()->where('key', $key)->where('value', $value)->delete() : $this->meta()->where('key', $key)->delete(); }
[ "public", "function", "deleteMeta", "(", "$", "key", ",", "$", "value", "=", "null", ")", "{", "return", "$", "value", "?", "$", "this", "->", "meta", "(", ")", "->", "where", "(", "'key'", ",", "$", "key", ")", "->", "where", "(", "'value'", ","...
Delete meta. @param string $key @param mixed $value @return bool
[ "Delete", "meta", "." ]
37611ccb49e7a903f10773343295be1ddef5a73f
https://github.com/appstract/laravel-meta/blob/37611ccb49e7a903f10773343295be1ddef5a73f/src/Metable.php#L98-L103
190,198
srmklive/flysystem-dropbox-v2
src/Client/DropboxClient.php
DropboxClient.setClient
protected function setClient(HttpClient $client = null) { if ($client instanceof HttpClient) { $this->client = $client; } else { $this->client = new HttpClient([ 'headers' => [ 'Authorization' => "Bearer {$this->accessToken}", ...
php
protected function setClient(HttpClient $client = null) { if ($client instanceof HttpClient) { $this->client = $client; } else { $this->client = new HttpClient([ 'headers' => [ 'Authorization' => "Bearer {$this->accessToken}", ...
[ "protected", "function", "setClient", "(", "HttpClient", "$", "client", "=", "null", ")", "{", "if", "(", "$", "client", "instanceof", "HttpClient", ")", "{", "$", "this", "->", "client", "=", "$", "client", ";", "}", "else", "{", "$", "this", "->", ...
Set Http Client. @param \GuzzleHttp\Client $client
[ "Set", "Http", "Client", "." ]
82c074a437723d735e70d1c03fbead9fe7204668
https://github.com/srmklive/flysystem-dropbox-v2/blob/82c074a437723d735e70d1c03fbead9fe7204668/src/Client/DropboxClient.php#L98-L109
190,199
srmklive/flysystem-dropbox-v2
src/Client/DropboxClient.php
DropboxClient.performApiRequest
public function performApiRequest($endpoint, $payload) { $this->setupRequest($payload); $this->apiEndpoint = $endpoint; return $this->doDropboxApiRequest(); }
php
public function performApiRequest($endpoint, $payload) { $this->setupRequest($payload); $this->apiEndpoint = $endpoint; return $this->doDropboxApiRequest(); }
[ "public", "function", "performApiRequest", "(", "$", "endpoint", ",", "$", "payload", ")", "{", "$", "this", "->", "setupRequest", "(", "$", "payload", ")", ";", "$", "this", "->", "apiEndpoint", "=", "$", "endpoint", ";", "return", "$", "this", "->", ...
Perform Dropbox API v2 request. @param $endpoint @param $payload @throws \Exception @return \Psr\Http\Message\ResponseInterface
[ "Perform", "Dropbox", "API", "v2", "request", "." ]
82c074a437723d735e70d1c03fbead9fe7204668
https://github.com/srmklive/flysystem-dropbox-v2/blob/82c074a437723d735e70d1c03fbead9fe7204668/src/Client/DropboxClient.php#L477-L483