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
240,500
bishopb/vanilla
library/core/class.session.php
Gdn_Session.End
public function End($Authenticator = NULL) { if ($Authenticator == NULL) $Authenticator = Gdn::Authenticator(); $Authenticator->AuthenticateWith()->DeAuthenticate(); $this->SetCookie('-Vv', NULL, -3600); $this->UserID = 0; $this->User = FALSE; $this->_Attributes = ar...
php
public function End($Authenticator = NULL) { if ($Authenticator == NULL) $Authenticator = Gdn::Authenticator(); $Authenticator->AuthenticateWith()->DeAuthenticate(); $this->SetCookie('-Vv', NULL, -3600); $this->UserID = 0; $this->User = FALSE; $this->_Attributes = ar...
[ "public", "function", "End", "(", "$", "Authenticator", "=", "NULL", ")", "{", "if", "(", "$", "Authenticator", "==", "NULL", ")", "$", "Authenticator", "=", "Gdn", "::", "Authenticator", "(", ")", ";", "$", "Authenticator", "->", "AuthenticateWith", "(", ...
End a session @param Gdn_Authenticator $Authenticator
[ "End", "a", "session" ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.session.php#L144-L157
240,501
bishopb/vanilla
library/core/class.session.php
Gdn_Session.HourOffset
public function HourOffset() { static $GuestHourOffset; if ($this->UserID > 0) { return $this->User->HourOffset; } else { if (!isset($GuestHourOffset)) { $GuestTimeZone = C('Garden.GuestTimeZone'); if ($GuestTimeZone) { try { ...
php
public function HourOffset() { static $GuestHourOffset; if ($this->UserID > 0) { return $this->User->HourOffset; } else { if (!isset($GuestHourOffset)) { $GuestTimeZone = C('Garden.GuestTimeZone'); if ($GuestTimeZone) { try { ...
[ "public", "function", "HourOffset", "(", ")", "{", "static", "$", "GuestHourOffset", ";", "if", "(", "$", "this", "->", "UserID", ">", "0", ")", "{", "return", "$", "this", "->", "User", "->", "HourOffset", ";", "}", "else", "{", "if", "(", "!", "i...
Return the timezone hour difference between the user and utc. @return int The hour offset.
[ "Return", "the", "timezone", "hour", "difference", "between", "the", "user", "and", "utc", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.session.php#L177-L199
240,502
bishopb/vanilla
library/core/class.session.php
Gdn_Session.Start
public function Start($UserID = FALSE, $SetIdentity = TRUE, $Persist = FALSE) { if (!C('Garden.Installed', FALSE)) return; // Retrieve the authenticated UserID from the Authenticator module. $UserModel = Gdn::Authenticator()->GetUserModel(); $this->UserID = $UserID !== FALSE ? $UserID : Gdn::Aut...
php
public function Start($UserID = FALSE, $SetIdentity = TRUE, $Persist = FALSE) { if (!C('Garden.Installed', FALSE)) return; // Retrieve the authenticated UserID from the Authenticator module. $UserModel = Gdn::Authenticator()->GetUserModel(); $this->UserID = $UserID !== FALSE ? $UserID : Gdn::Aut...
[ "public", "function", "Start", "(", "$", "UserID", "=", "FALSE", ",", "$", "SetIdentity", "=", "TRUE", ",", "$", "Persist", "=", "FALSE", ")", "{", "if", "(", "!", "C", "(", "'Garden.Installed'", ",", "FALSE", ")", ")", "return", ";", "// Retrieve the ...
Authenticates the user with the provided Authenticator class. @param int $UserID The UserID to start the session with. @param bool $SetIdentity Whether or not to set the identity (cookie) or make this a one request session. @param bool $Persist If setting an identity, should we persist it beyond browser restart?
[ "Authenticates", "the", "user", "with", "the", "provided", "Authenticator", "class", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.session.php#L343-L386
240,503
bishopb/vanilla
library/core/class.session.php
Gdn_Session.TransientKey
public function TransientKey($NewKey = NULL) { if (!is_null($NewKey)) { $this->_TransientKey = Gdn::Authenticator()->GetUserModel()->SetTransientKey($this->UserID, $NewKey); } // if ($this->_TransientKey) return $this->_TransientKey; // else // return RandomString(12); /...
php
public function TransientKey($NewKey = NULL) { if (!is_null($NewKey)) { $this->_TransientKey = Gdn::Authenticator()->GetUserModel()->SetTransientKey($this->UserID, $NewKey); } // if ($this->_TransientKey) return $this->_TransientKey; // else // return RandomString(12); /...
[ "public", "function", "TransientKey", "(", "$", "NewKey", "=", "NULL", ")", "{", "if", "(", "!", "is_null", "(", "$", "NewKey", ")", ")", "{", "$", "this", "->", "_TransientKey", "=", "Gdn", "::", "Authenticator", "(", ")", "->", "GetUserModel", "(", ...
Returns the transient key for the authenticated user. @return string @todo check return type
[ "Returns", "the", "transient", "key", "for", "the", "authenticated", "user", "." ]
8494eb4a4ad61603479015a8054d23ff488364e8
https://github.com/bishopb/vanilla/blob/8494eb4a4ad61603479015a8054d23ff488364e8/library/core/class.session.php#L446-L455
240,504
spec-gen/state-workflow-spec-gen-bundle
Domain/IntrospectedWorkflow.php
IntrospectedWorkflow.guessIsIntrospectedStateRootOrLeaf
private function guessIsIntrospectedStateRootOrLeaf() { foreach ($this->introspectedStates as $introspectedState) { $this->guessIsIntrospectedStateRoot($introspectedState); $this->guessIsIntrospectedStateLeaf($introspectedState); } }
php
private function guessIsIntrospectedStateRootOrLeaf() { foreach ($this->introspectedStates as $introspectedState) { $this->guessIsIntrospectedStateRoot($introspectedState); $this->guessIsIntrospectedStateLeaf($introspectedState); } }
[ "private", "function", "guessIsIntrospectedStateRootOrLeaf", "(", ")", "{", "foreach", "(", "$", "this", "->", "introspectedStates", "as", "$", "introspectedState", ")", "{", "$", "this", "->", "guessIsIntrospectedStateRoot", "(", "$", "introspectedState", ")", ";",...
Update introspectedState isLeaf|isRoot on the fly
[ "Update", "introspectedState", "isLeaf|isRoot", "on", "the", "fly" ]
20490717ab28c5f8ff9424ff51898e52283bb2c2
https://github.com/spec-gen/state-workflow-spec-gen-bundle/blob/20490717ab28c5f8ff9424ff51898e52283bb2c2/Domain/IntrospectedWorkflow.php#L188-L194
240,505
GrupaZero/core
src/Gzero/Core/Policies/OptionPolicy.php
OptionPolicy.update
public function update(User $user, $option, $categoryKey) { if (!empty($option)) { return $user->hasPermission('options-update-' . $categoryKey); } return false; }
php
public function update(User $user, $option, $categoryKey) { if (!empty($option)) { return $user->hasPermission('options-update-' . $categoryKey); } return false; }
[ "public", "function", "update", "(", "User", "$", "user", ",", "$", "option", ",", "$", "categoryKey", ")", "{", "if", "(", "!", "empty", "(", "$", "option", ")", ")", "{", "return", "$", "user", "->", "hasPermission", "(", "'options-update-'", ".", ...
Policy for updating options for specified category @param User $user User trying to do it @param Option $option Option class name @param String $categoryKey option category @return bool
[ "Policy", "for", "updating", "options", "for", "specified", "category" ]
093e515234fa0385b259ba4d8bc7832174a44eab
https://github.com/GrupaZero/core/blob/093e515234fa0385b259ba4d8bc7832174a44eab/src/Gzero/Core/Policies/OptionPolicy.php#L29-L35
240,506
weavephp/middleware-middleman2
src/Middleman.php
Middleman.executePipeline
public function executePipeline($pipeline, Request $request, Response $response = null) { $middleman = new \mindplay\middleman\Dispatcher($pipeline, $this->resolver); return $middleman->dispatch($request); }
php
public function executePipeline($pipeline, Request $request, Response $response = null) { $middleman = new \mindplay\middleman\Dispatcher($pipeline, $this->resolver); return $middleman->dispatch($request); }
[ "public", "function", "executePipeline", "(", "$", "pipeline", ",", "Request", "$", "request", ",", "Response", "$", "response", "=", "null", ")", "{", "$", "middleman", "=", "new", "\\", "mindplay", "\\", "middleman", "\\", "Dispatcher", "(", "$", "pipeli...
Trigger execution of the supplied pipeline through Middleman. @param mixed $pipeline The stack of middleware definitions. @param Request $request The PSR7 request. @param Response $response The PSR7 response (for double-pass stacks). @return Response
[ "Trigger", "execution", "of", "the", "supplied", "pipeline", "through", "Middleman", "." ]
90dc363fa1638ce6f34b263c58ed715863d30aef
https://github.com/weavephp/middleware-middleman2/blob/90dc363fa1638ce6f34b263c58ed715863d30aef/src/Middleman.php#L53-L57
240,507
tomk79/php-excellent-db
php/endpoint/form.php
endpoint_form.automatic_form
public function automatic_form(){ @header('text/html; charset=UTF-8'); $rtn = ''; if( !strlen($this->options['table']) ){ // -------------------- // 対象のテーブルが選択されていない echo $this->page_table_list(); return null; } $table_definition = $this->get_current_table_definition(); // var_dump($table_def...
php
public function automatic_form(){ @header('text/html; charset=UTF-8'); $rtn = ''; if( !strlen($this->options['table']) ){ // -------------------- // 対象のテーブルが選択されていない echo $this->page_table_list(); return null; } $table_definition = $this->get_current_table_definition(); // var_dump($table_def...
[ "public", "function", "automatic_form", "(", ")", "{", "@", "header", "(", "'text/html; charset=UTF-8'", ")", ";", "$", "rtn", "=", "''", ";", "if", "(", "!", "strlen", "(", "$", "this", "->", "options", "[", "'table'", "]", ")", ")", "{", "// --------...
Execute Automatic form @return null This method returns no value.
[ "Execute", "Automatic", "form" ]
deeacf64c090fc5647267a06f97c3fb60fdf8f68
https://github.com/tomk79/php-excellent-db/blob/deeacf64c090fc5647267a06f97c3fb60fdf8f68/php/endpoint/form.php#L175-L231
240,508
tomk79/php-excellent-db
php/endpoint/form.php
endpoint_form.automatic_signup_form
public function automatic_signup_form($table_name, $init_cols, $options = array()){ @header('text/html; charset=UTF-8'); $param_options = $this->get_options(); $data = $param_options['post_params']; $this->table_definition = $this->exdb->get_table_definition($table_name); $is_login = $this->exdb->user()->i...
php
public function automatic_signup_form($table_name, $init_cols, $options = array()){ @header('text/html; charset=UTF-8'); $param_options = $this->get_options(); $data = $param_options['post_params']; $this->table_definition = $this->exdb->get_table_definition($table_name); $is_login = $this->exdb->user()->i...
[ "public", "function", "automatic_signup_form", "(", "$", "table_name", ",", "$", "init_cols", ",", "$", "options", "=", "array", "(", ")", ")", "{", "@", "header", "(", "'text/html; charset=UTF-8'", ")", ";", "$", "param_options", "=", "$", "this", "->", "...
Automatic Signup form @param string $table_name テーブル名 @param array $init_cols 初期設定するカラム名 @param array $options オプション @return boolean Always `true`.
[ "Automatic", "Signup", "form" ]
deeacf64c090fc5647267a06f97c3fb60fdf8f68
https://github.com/tomk79/php-excellent-db/blob/deeacf64c090fc5647267a06f97c3fb60fdf8f68/php/endpoint/form.php#L242-L260
240,509
tomk79/php-excellent-db
php/endpoint/form.php
endpoint_form.auth
public function auth($table_name, $inquiries){ $options = $this->get_options(); $data = $options['post_params']; if(@$this->query_options['action'] == 'login'){ // ログインを試みる $result = $this->exdb->user()->login( $table_name, $inquiries, $data ); } $is_login = $this->exdb->user()->is_login($table_name)...
php
public function auth($table_name, $inquiries){ $options = $this->get_options(); $data = $options['post_params']; if(@$this->query_options['action'] == 'login'){ // ログインを試みる $result = $this->exdb->user()->login( $table_name, $inquiries, $data ); } $is_login = $this->exdb->user()->is_login($table_name)...
[ "public", "function", "auth", "(", "$", "table_name", ",", "$", "inquiries", ")", "{", "$", "options", "=", "$", "this", "->", "get_options", "(", ")", ";", "$", "data", "=", "$", "options", "[", "'post_params'", "]", ";", "if", "(", "@", "$", "thi...
Execute Automatic Auth form @param string $table_name テーブル名 @param array $inquiries 照会するカラム名 @return boolean Success to `true`, Failed, or NOT Login to `false`.
[ "Execute", "Automatic", "Auth", "form" ]
deeacf64c090fc5647267a06f97c3fb60fdf8f68
https://github.com/tomk79/php-excellent-db/blob/deeacf64c090fc5647267a06f97c3fb60fdf8f68/php/endpoint/form.php#L269-L322
240,510
dotfilesphp/core
Processor/ProcessRunner.php
ProcessRunner.run
public function run($commandline, callable $callback = null, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) { $process = new Process( $commandline, $cwd, $env, $input, $timeout ); $helper = new DebugFor...
php
public function run($commandline, callable $callback = null, string $cwd = null, array $env = null, $input = null, ?float $timeout = 60) { $process = new Process( $commandline, $cwd, $env, $input, $timeout ); $helper = new DebugFor...
[ "public", "function", "run", "(", "$", "commandline", ",", "callable", "$", "callback", "=", "null", ",", "string", "$", "cwd", "=", "null", ",", "array", "$", "env", "=", "null", ",", "$", "input", "=", "null", ",", "?", "float", "$", "timeout", "...
Creates process and run with predefined DebugFormatterHelper. @param string $commandline @param callable|null $callback @param string|null $cwd @param array|null $env @param null $input @param int|float|null $timeout The timeout in seconds or null to disable @see Process @return Pro...
[ "Creates", "process", "and", "run", "with", "predefined", "DebugFormatterHelper", "." ]
d55e44449cf67e9d56a22863447fd782c88d9b2d
https://github.com/dotfilesphp/core/blob/d55e44449cf67e9d56a22863447fd782c88d9b2d/Processor/ProcessRunner.php#L66-L96
240,511
nirix/radium
src/Language/Translation.php
Translation.translate
public function translate($string, Array $vars = array()) { // Use custom translator if ($this->translator) { return $this->translator($this->getString($string), $vars); } return $this->compileString($this->getString($string), $vars); }
php
public function translate($string, Array $vars = array()) { // Use custom translator if ($this->translator) { return $this->translator($this->getString($string), $vars); } return $this->compileString($this->getString($string), $vars); }
[ "public", "function", "translate", "(", "$", "string", ",", "Array", "$", "vars", "=", "array", "(", ")", ")", "{", "// Use custom translator", "if", "(", "$", "this", "->", "translator", ")", "{", "return", "$", "this", "->", "translator", "(", "$", "...
Translates the specified string. @return string
[ "Translates", "the", "specified", "string", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Language/Translation.php#L55-L63
240,512
nirix/radium
src/Language/Translation.php
Translation.getString
public function getString($string) { // Exact match? if (isset($this->strings[$string])) { return $this->strings[$string]; } else { return $string; } }
php
public function getString($string) { // Exact match? if (isset($this->strings[$string])) { return $this->strings[$string]; } else { return $string; } }
[ "public", "function", "getString", "(", "$", "string", ")", "{", "// Exact match?", "if", "(", "isset", "(", "$", "this", "->", "strings", "[", "$", "string", "]", ")", ")", "{", "return", "$", "this", "->", "strings", "[", "$", "string", "]", ";", ...
Fetches the translation for the specified string. @param string $string @return string
[ "Fetches", "the", "translation", "for", "the", "specified", "string", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Language/Translation.php#L83-L91
240,513
nirix/radium
src/Language/Translation.php
Translation.calculateNumeral
public function calculateNumeral($numeral) { // Use custom enumerator if ($this->enumerator) { return $this->enumerator($numeral); } return ($numeral > 1 or $numeral < -1 or $numeral == 0) ? 1 : 0; }
php
public function calculateNumeral($numeral) { // Use custom enumerator if ($this->enumerator) { return $this->enumerator($numeral); } return ($numeral > 1 or $numeral < -1 or $numeral == 0) ? 1 : 0; }
[ "public", "function", "calculateNumeral", "(", "$", "numeral", ")", "{", "// Use custom enumerator", "if", "(", "$", "this", "->", "enumerator", ")", "{", "return", "$", "this", "->", "enumerator", "(", "$", "numeral", ")", ";", "}", "return", "(", "$", ...
Determines which replacement to use for plurals. @param integer $numeral @return integer
[ "Determines", "which", "replacement", "to", "use", "for", "plurals", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Language/Translation.php#L100-L108
240,514
nirix/radium
src/Language/Translation.php
Translation.compileString
protected function compileString($string, $vars) { $translation = $string; // Loop through and replace the placeholders // with the values from the $vars array. $count = 0; foreach ($vars as $key => $val) { $count++; // If array key is an integer, ...
php
protected function compileString($string, $vars) { $translation = $string; // Loop through and replace the placeholders // with the values from the $vars array. $count = 0; foreach ($vars as $key => $val) { $count++; // If array key is an integer, ...
[ "protected", "function", "compileString", "(", "$", "string", ",", "$", "vars", ")", "{", "$", "translation", "=", "$", "string", ";", "// Loop through and replace the placeholders", "// with the values from the $vars array.", "$", "count", "=", "0", ";", "foreach", ...
Compiles the translated string with the variables. @example compileString('{plural:$1, {$1 post|$1 posts}}', array(1)); will become "1 post" @param string $string @param array $vars @return string
[ "Compiles", "the", "translated", "string", "with", "the", "variables", "." ]
cc6907bfee296b64a7630b0b188e233d7cdb86fd
https://github.com/nirix/radium/blob/cc6907bfee296b64a7630b0b188e233d7cdb86fd/src/Language/Translation.php#L122-L168
240,515
gossi/trixionary
src/model/Base/Sport.php
Sport.initObjects
public function initObjects($overrideExisting = true) { if (null !== $this->collObjects && !$overrideExisting) { return; } $this->collObjects = new ObjectCollection(); $this->collObjects->setModel('\gossi\trixionary\model\Object'); }
php
public function initObjects($overrideExisting = true) { if (null !== $this->collObjects && !$overrideExisting) { return; } $this->collObjects = new ObjectCollection(); $this->collObjects->setModel('\gossi\trixionary\model\Object'); }
[ "public", "function", "initObjects", "(", "$", "overrideExisting", "=", "true", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "collObjects", "&&", "!", "$", "overrideExisting", ")", "{", "return", ";", "}", "$", "this", "->", "collObjects", "=",...
Initializes the collObjects collection. By default this just sets the collObjects collection to an empty array (like clearcollObjects()); however, you may wish to override this method in your stub class to provide setting appropriate to your application -- for example, setting the initial array to the values stored in...
[ "Initializes", "the", "collObjects", "collection", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L2518-L2525
240,516
gossi/trixionary
src/model/Base/Sport.php
Sport.getObjects
public function getObjects(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collObjectsPartial && !$this->isNew(); if (null === $this->collObjects || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collObjects) { // ...
php
public function getObjects(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collObjectsPartial && !$this->isNew(); if (null === $this->collObjects || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collObjects) { // ...
[ "public", "function", "getObjects", "(", "Criteria", "$", "criteria", "=", "null", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collObjectsPartial", "&&", "!", "$", "this", "->", "isNew", "(", ")...
Gets an array of ChildObject objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria, t...
[ "Gets", "an", "array", "of", "ChildObject", "objects", "which", "contain", "a", "foreign", "key", "that", "references", "this", "object", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L2541-L2583
240,517
gossi/trixionary
src/model/Base/Sport.php
Sport.countObjects
public function countObjects(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collObjectsPartial && !$this->isNew(); if (null === $this->collObjects || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collObjects) {...
php
public function countObjects(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collObjectsPartial && !$this->isNew(); if (null === $this->collObjects || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collObjects) {...
[ "public", "function", "countObjects", "(", "Criteria", "$", "criteria", "=", "null", ",", "$", "distinct", "=", "false", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collObjectsPartial", "&&", "!",...
Returns the number of related Object objects. @param Criteria $criteria @param boolean $distinct @param ConnectionInterface $con @return int Count of related Object objects. @throws PropelException
[ "Returns", "the", "number", "of", "related", "Object", "objects", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L2627-L2650
240,518
gossi/trixionary
src/model/Base/Sport.php
Sport.addObject
public function addObject(ChildObject $l) { if ($this->collObjects === null) { $this->initObjects(); $this->collObjectsPartial = true; } if (!$this->collObjects->contains($l)) { $this->doAddObject($l); } return $this; }
php
public function addObject(ChildObject $l) { if ($this->collObjects === null) { $this->initObjects(); $this->collObjectsPartial = true; } if (!$this->collObjects->contains($l)) { $this->doAddObject($l); } return $this; }
[ "public", "function", "addObject", "(", "ChildObject", "$", "l", ")", "{", "if", "(", "$", "this", "->", "collObjects", "===", "null", ")", "{", "$", "this", "->", "initObjects", "(", ")", ";", "$", "this", "->", "collObjectsPartial", "=", "true", ";",...
Method called to associate a ChildObject object to this object through the ChildObject foreign key attribute. @param ChildObject $l ChildObject @return $this|\gossi\trixionary\model\Sport The current object (for fluent API support)
[ "Method", "called", "to", "associate", "a", "ChildObject", "object", "to", "this", "object", "through", "the", "ChildObject", "foreign", "key", "attribute", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L2659-L2671
240,519
gossi/trixionary
src/model/Base/Sport.php
Sport.initPositions
public function initPositions($overrideExisting = true) { if (null !== $this->collPositions && !$overrideExisting) { return; } $this->collPositions = new ObjectCollection(); $this->collPositions->setModel('\gossi\trixionary\model\Position'); }
php
public function initPositions($overrideExisting = true) { if (null !== $this->collPositions && !$overrideExisting) { return; } $this->collPositions = new ObjectCollection(); $this->collPositions->setModel('\gossi\trixionary\model\Position'); }
[ "public", "function", "initPositions", "(", "$", "overrideExisting", "=", "true", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "collPositions", "&&", "!", "$", "overrideExisting", ")", "{", "return", ";", "}", "$", "this", "->", "collPositions", ...
Initializes the collPositions collection. By default this just sets the collPositions collection to an empty array (like clearcollPositions()); however, you may wish to override this method in your stub class to provide setting appropriate to your application -- for example, setting the initial array to the values sto...
[ "Initializes", "the", "collPositions", "collection", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L2736-L2743
240,520
gossi/trixionary
src/model/Base/Sport.php
Sport.getPositions
public function getPositions(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collPositionsPartial && !$this->isNew(); if (null === $this->collPositions || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collPositions) { ...
php
public function getPositions(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collPositionsPartial && !$this->isNew(); if (null === $this->collPositions || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collPositions) { ...
[ "public", "function", "getPositions", "(", "Criteria", "$", "criteria", "=", "null", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collPositionsPartial", "&&", "!", "$", "this", "->", "isNew", "(", ...
Gets an array of ChildPosition objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria,...
[ "Gets", "an", "array", "of", "ChildPosition", "objects", "which", "contain", "a", "foreign", "key", "that", "references", "this", "object", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L2759-L2801
240,521
gossi/trixionary
src/model/Base/Sport.php
Sport.countPositions
public function countPositions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collPositionsPartial && !$this->isNew(); if (null === $this->collPositions || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collPosi...
php
public function countPositions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null) { $partial = $this->collPositionsPartial && !$this->isNew(); if (null === $this->collPositions || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collPosi...
[ "public", "function", "countPositions", "(", "Criteria", "$", "criteria", "=", "null", ",", "$", "distinct", "=", "false", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collPositionsPartial", "&&", ...
Returns the number of related Position objects. @param Criteria $criteria @param boolean $distinct @param ConnectionInterface $con @return int Count of related Position objects. @throws PropelException
[ "Returns", "the", "number", "of", "related", "Position", "objects", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L2845-L2868
240,522
gossi/trixionary
src/model/Base/Sport.php
Sport.addPosition
public function addPosition(ChildPosition $l) { if ($this->collPositions === null) { $this->initPositions(); $this->collPositionsPartial = true; } if (!$this->collPositions->contains($l)) { $this->doAddPosition($l); } return $this; }
php
public function addPosition(ChildPosition $l) { if ($this->collPositions === null) { $this->initPositions(); $this->collPositionsPartial = true; } if (!$this->collPositions->contains($l)) { $this->doAddPosition($l); } return $this; }
[ "public", "function", "addPosition", "(", "ChildPosition", "$", "l", ")", "{", "if", "(", "$", "this", "->", "collPositions", "===", "null", ")", "{", "$", "this", "->", "initPositions", "(", ")", ";", "$", "this", "->", "collPositionsPartial", "=", "tru...
Method called to associate a ChildPosition object to this object through the ChildPosition foreign key attribute. @param ChildPosition $l ChildPosition @return $this|\gossi\trixionary\model\Sport The current object (for fluent API support)
[ "Method", "called", "to", "associate", "a", "ChildPosition", "object", "to", "this", "object", "through", "the", "ChildPosition", "foreign", "key", "attribute", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L2877-L2889
240,523
gossi/trixionary
src/model/Base/Sport.php
Sport.getSkillsJoinObject
public function getSkillsJoinObject(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildSkillQuery::create(null, $criteria); $query->joinWith('Object', $joinBehavior); return $this->getSkills($query, $con); }
php
public function getSkillsJoinObject(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN) { $query = ChildSkillQuery::create(null, $criteria); $query->joinWith('Object', $joinBehavior); return $this->getSkills($query, $con); }
[ "public", "function", "getSkillsJoinObject", "(", "Criteria", "$", "criteria", "=", "null", ",", "ConnectionInterface", "$", "con", "=", "null", ",", "$", "joinBehavior", "=", "Criteria", "::", "LEFT_JOIN", ")", "{", "$", "query", "=", "ChildSkillQuery", "::",...
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this Sport is new, it will return an empty collection; or if this Sport has previously been saved, it will retrieve related Skills from storage. This method is protected by default in order to keep the p...
[ "If", "this", "collection", "has", "already", "been", "initialized", "with", "an", "identical", "criteria", "it", "returns", "the", "collection", ".", "Otherwise", "if", "this", "Sport", "is", "new", "it", "will", "return", "an", "empty", "collection", ";", ...
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L3205-L3211
240,524
gossi/trixionary
src/model/Base/Sport.php
Sport.initGroups
public function initGroups($overrideExisting = true) { if (null !== $this->collGroups && !$overrideExisting) { return; } $this->collGroups = new ObjectCollection(); $this->collGroups->setModel('\gossi\trixionary\model\Group'); }
php
public function initGroups($overrideExisting = true) { if (null !== $this->collGroups && !$overrideExisting) { return; } $this->collGroups = new ObjectCollection(); $this->collGroups->setModel('\gossi\trixionary\model\Group'); }
[ "public", "function", "initGroups", "(", "$", "overrideExisting", "=", "true", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "collGroups", "&&", "!", "$", "overrideExisting", ")", "{", "return", ";", "}", "$", "this", "->", "collGroups", "=", ...
Initializes the collGroups collection. By default this just sets the collGroups collection to an empty array (like clearcollGroups()); however, you may wish to override this method in your stub class to provide setting appropriate to your application -- for example, setting the initial array to the values stored in da...
[ "Initializes", "the", "collGroups", "collection", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L3422-L3429
240,525
gossi/trixionary
src/model/Base/Sport.php
Sport.getGroups
public function getGroups(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collGroupsPartial && !$this->isNew(); if (null === $this->collGroups || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collGroups) { // retu...
php
public function getGroups(Criteria $criteria = null, ConnectionInterface $con = null) { $partial = $this->collGroupsPartial && !$this->isNew(); if (null === $this->collGroups || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collGroups) { // retu...
[ "public", "function", "getGroups", "(", "Criteria", "$", "criteria", "=", "null", ",", "ConnectionInterface", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collGroupsPartial", "&&", "!", "$", "this", "->", "isNew", "(", ")",...
Gets an array of ChildGroup objects which contain a foreign key that references this object. If the $criteria is not null, it is used to always fetch the results from the database. Otherwise the results are fetched from the database the first time, then cached. Next time the same method is called without $criteria, th...
[ "Gets", "an", "array", "of", "ChildGroup", "objects", "which", "contain", "a", "foreign", "key", "that", "references", "this", "object", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L3445-L3487
240,526
gossi/trixionary
src/model/Base/Sport.php
Sport.addGroup
public function addGroup(ChildGroup $l) { if ($this->collGroups === null) { $this->initGroups(); $this->collGroupsPartial = true; } if (!$this->collGroups->contains($l)) { $this->doAddGroup($l); } return $this; }
php
public function addGroup(ChildGroup $l) { if ($this->collGroups === null) { $this->initGroups(); $this->collGroupsPartial = true; } if (!$this->collGroups->contains($l)) { $this->doAddGroup($l); } return $this; }
[ "public", "function", "addGroup", "(", "ChildGroup", "$", "l", ")", "{", "if", "(", "$", "this", "->", "collGroups", "===", "null", ")", "{", "$", "this", "->", "initGroups", "(", ")", ";", "$", "this", "->", "collGroupsPartial", "=", "true", ";", "}...
Method called to associate a ChildGroup object to this object through the ChildGroup foreign key attribute. @param ChildGroup $l ChildGroup @return $this|\gossi\trixionary\model\Sport The current object (for fluent API support)
[ "Method", "called", "to", "associate", "a", "ChildGroup", "object", "to", "this", "object", "through", "the", "ChildGroup", "foreign", "key", "attribute", "." ]
221a6c5322473d7d7f8e322958a3ee46d87da150
https://github.com/gossi/trixionary/blob/221a6c5322473d7d7f8e322958a3ee46d87da150/src/model/Base/Sport.php#L3563-L3575
240,527
netgloo/benjamin_core
src/Http/Controllers/Api/PagesController.php
PagesController.getAll
public function getAll(Request $request) { // Get the views' directory $viewsPath = base_path() . '/resources/views/'; if (!is_dir($viewsPath)) { error_log("The directory /resources/views/ doesn't exists."); throw new PathNotFoundException(); } // Get the lang' directory $langPath...
php
public function getAll(Request $request) { // Get the views' directory $viewsPath = base_path() . '/resources/views/'; if (!is_dir($viewsPath)) { error_log("The directory /resources/views/ doesn't exists."); throw new PathNotFoundException(); } // Get the lang' directory $langPath...
[ "public", "function", "getAll", "(", "Request", "$", "request", ")", "{", "// Get the views' directory", "$", "viewsPath", "=", "base_path", "(", ")", ".", "'/resources/views/'", ";", "if", "(", "!", "is_dir", "(", "$", "viewsPath", ")", ")", "{", "error_log...
Return a JSON object containing the content of all the pages. The returned object will have this structure: { langDir: 'en', pages: [{ path: '/', title: 'Home', body: '<div> ... </div>' bodyClass: 'some-class' }, { path: '/...', title: '...', body: '...' bodyClass: '...' }, ... ] } @return JSON
[ "Return", "a", "JSON", "object", "containing", "the", "content", "of", "all", "the", "pages", "." ]
8f5000e626104ab2c5e7d003b1e8f420937e8a44
https://github.com/netgloo/benjamin_core/blob/8f5000e626104ab2c5e7d003b1e8f420937e8a44/src/Http/Controllers/Api/PagesController.php#L42-L154
240,528
netgloo/benjamin_core
src/Http/Controllers/Api/PagesController.php
PagesController.getLastMod
private function getLastMod($dirPath) { $dirInfo = new \SplFileInfo($dirPath); $lastMod = $dirInfo->getMTime(); // Check files and subdirectories $iter = new \FilesystemIterator($dirPath); foreach ($iter as $fileInfo) { if ($fileInfo->isDir()) { $mtime = self::getLastMod($fileInfo-...
php
private function getLastMod($dirPath) { $dirInfo = new \SplFileInfo($dirPath); $lastMod = $dirInfo->getMTime(); // Check files and subdirectories $iter = new \FilesystemIterator($dirPath); foreach ($iter as $fileInfo) { if ($fileInfo->isDir()) { $mtime = self::getLastMod($fileInfo-...
[ "private", "function", "getLastMod", "(", "$", "dirPath", ")", "{", "$", "dirInfo", "=", "new", "\\", "SplFileInfo", "(", "$", "dirPath", ")", ";", "$", "lastMod", "=", "$", "dirInfo", "->", "getMTime", "(", ")", ";", "// Check files and subdirectories", "...
Returns the last modification time for all files and directories inside the given directory. @param $dirPath (String) @param $cacheTime (String) @return (int) The unix timestamp for the last modification
[ "Returns", "the", "last", "modification", "time", "for", "all", "files", "and", "directories", "inside", "the", "given", "directory", "." ]
8f5000e626104ab2c5e7d003b1e8f420937e8a44
https://github.com/netgloo/benjamin_core/blob/8f5000e626104ab2c5e7d003b1e8f420937e8a44/src/Http/Controllers/Api/PagesController.php#L169-L191
240,529
netgloo/benjamin_core
src/Http/Controllers/Api/PagesController.php
PagesController.getViewsList
private function getViewsList($dirPath, $checkSubDir = true) { $viewsList = []; $iter = new \FilesystemIterator($dirPath); foreach ($iter as $fileInfo) { $filename = $fileInfo->getFilename(); if ($filename[0] === '_') { continue; } // Directories if ($fileInfo->isDi...
php
private function getViewsList($dirPath, $checkSubDir = true) { $viewsList = []; $iter = new \FilesystemIterator($dirPath); foreach ($iter as $fileInfo) { $filename = $fileInfo->getFilename(); if ($filename[0] === '_') { continue; } // Directories if ($fileInfo->isDi...
[ "private", "function", "getViewsList", "(", "$", "dirPath", ",", "$", "checkSubDir", "=", "true", ")", "{", "$", "viewsList", "=", "[", "]", ";", "$", "iter", "=", "new", "\\", "FilesystemIterator", "(", "$", "dirPath", ")", ";", "foreach", "(", "$", ...
Return a list of all available views in the given directory. These files will be skipped: - Each file or directory starting with '_' - Directory /errors - Directory /layouts - Directory /templates - Directory /vendor - Files not ending with '.blade.php' @param $dirPath (String) @param $checkSubDir (Boolean) Default t...
[ "Return", "a", "list", "of", "all", "available", "views", "in", "the", "given", "directory", "." ]
8f5000e626104ab2c5e7d003b1e8f420937e8a44
https://github.com/netgloo/benjamin_core/blob/8f5000e626104ab2c5e7d003b1e8f420937e8a44/src/Http/Controllers/Api/PagesController.php#L210-L250
240,530
khanhicetea/sifoni
src/Sifoni/Engine.php
Engine.loadLanguages
private function loadLanguages() { $app = $this->app; $engine = $this; $languages = $app['config.app.languages']; $app['multi_languages'] = count($languages) > 1; $app->register(new LocaleServiceProvider()); $app->register(new TranslationServiceProvider(), [ ...
php
private function loadLanguages() { $app = $this->app; $engine = $this; $languages = $app['config.app.languages']; $app['multi_languages'] = count($languages) > 1; $app->register(new LocaleServiceProvider()); $app->register(new TranslationServiceProvider(), [ ...
[ "private", "function", "loadLanguages", "(", ")", "{", "$", "app", "=", "$", "this", "->", "app", ";", "$", "engine", "=", "$", "this", ";", "$", "languages", "=", "$", "app", "[", "'config.app.languages'", "]", ";", "$", "app", "[", "'multi_languages'...
Load languages.
[ "Load", "languages", "." ]
e32a2d2cb16a2bb7939250372bd74ca3ca7eba58
https://github.com/khanhicetea/sifoni/blob/e32a2d2cb16a2bb7939250372bd74ca3ca7eba58/src/Sifoni/Engine.php#L250-L279
240,531
khanhicetea/sifoni
src/Sifoni/Engine.php
Engine.loadRouting
private function loadRouting() { $app = $this->app; $maps = []; $routing_file_path = $this->getAppPath('config').DIRECTORY_SEPARATOR.'routing.php'; if (is_readable($routing_file_path)) { $maps = require $routing_file_path; } if ($maps) { $pre...
php
private function loadRouting() { $app = $this->app; $maps = []; $routing_file_path = $this->getAppPath('config').DIRECTORY_SEPARATOR.'routing.php'; if (is_readable($routing_file_path)) { $maps = require $routing_file_path; } if ($maps) { $pre...
[ "private", "function", "loadRouting", "(", ")", "{", "$", "app", "=", "$", "this", "->", "app", ";", "$", "maps", "=", "[", "]", ";", "$", "routing_file_path", "=", "$", "this", "->", "getAppPath", "(", "'config'", ")", ".", "DIRECTORY_SEPARATOR", ".",...
Load routing.
[ "Load", "routing", "." ]
e32a2d2cb16a2bb7939250372bd74ca3ca7eba58
https://github.com/khanhicetea/sifoni/blob/e32a2d2cb16a2bb7939250372bd74ca3ca7eba58/src/Sifoni/Engine.php#L284-L339
240,532
petitchevalroux/php-configuration-factory
src/Factory.php
Factory.setLoader
public function setLoader(Loader $loader) { $this->loader = $loader; $this->loader->setNamespace($this->getNamespace()); }
php
public function setLoader(Loader $loader) { $this->loader = $loader; $this->loader->setNamespace($this->getNamespace()); }
[ "public", "function", "setLoader", "(", "Loader", "$", "loader", ")", "{", "$", "this", "->", "loader", "=", "$", "loader", ";", "$", "this", "->", "loader", "->", "setNamespace", "(", "$", "this", "->", "getNamespace", "(", ")", ")", ";", "}" ]
Set configuration factory loader. @param Loader $loader
[ "Set", "configuration", "factory", "loader", "." ]
94dfa809f0739dfbcb0d8996ba22af6afe786428
https://github.com/petitchevalroux/php-configuration-factory/blob/94dfa809f0739dfbcb0d8996ba22af6afe786428/src/Factory.php#L23-L27
240,533
lukaszmakuch/haringo
src/Builder/Impl/HaringoBuilderImpl.php
HaringoBuilderImpl.getSerializerValSourceExtBasedOn
private function getSerializerValSourceExtBasedOn(ValueSourceExtension $ext) { return new SerializerValueSourceExtensionImpl( $ext->getMapper(), $ext->getSupportedValueSourceClass(), $ext->getUniqueExtensionId() ); }
php
private function getSerializerValSourceExtBasedOn(ValueSourceExtension $ext) { return new SerializerValueSourceExtensionImpl( $ext->getMapper(), $ext->getSupportedValueSourceClass(), $ext->getUniqueExtensionId() ); }
[ "private", "function", "getSerializerValSourceExtBasedOn", "(", "ValueSourceExtension", "$", "ext", ")", "{", "return", "new", "SerializerValueSourceExtensionImpl", "(", "$", "ext", "->", "getMapper", "(", ")", ",", "$", "ext", "->", "getSupportedValueSourceClass", "(...
Converts a general value source extension into an extension accepted by the mapper. @param ValueSourceExtension $ext @return SerializerValueSourceExtensionImpl
[ "Converts", "a", "general", "value", "source", "extension", "into", "an", "extension", "accepted", "by", "the", "mapper", "." ]
7a2ff30f4e7b215b2573a9562ed449f6495d303d
https://github.com/lukaszmakuch/haringo/blob/7a2ff30f4e7b215b2573a9562ed449f6495d303d/src/Builder/Impl/HaringoBuilderImpl.php#L98-L105
240,534
phlexible/phlexible
src/Phlexible/Component/MediaType/Model/MediaType.php
MediaType.getTitle
public function getTitle($code) { if (!isset($this->titles[$code])) { $code = key($this->getTitles()); } return $this->titles[$code]; }
php
public function getTitle($code) { if (!isset($this->titles[$code])) { $code = key($this->getTitles()); } return $this->titles[$code]; }
[ "public", "function", "getTitle", "(", "$", "code", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "titles", "[", "$", "code", "]", ")", ")", "{", "$", "code", "=", "key", "(", "$", "this", "->", "getTitles", "(", ")", ")", ";", "...
Return localized title. @param string $code @return string
[ "Return", "localized", "title", "." ]
132f24924c9bb0dbb6c1ea84db0a463f97fa3893
https://github.com/phlexible/phlexible/blob/132f24924c9bb0dbb6c1ea84db0a463f97fa3893/src/Phlexible/Component/MediaType/Model/MediaType.php#L113-L120
240,535
Flowpack/Flowpack.SingleSignOn.Client
Classes/Flowpack/SingleSignOn/Client/Security/RequestSigner.php
RequestSigner.getSignatureContent
public function getSignatureContent(\TYPO3\Flow\Http\Request $httpRequest) { $date = $httpRequest->getHeader('Date'); $dateValue = $date instanceof \DateTime ? $date->format(DATE_RFC2822) : ''; $signData = $httpRequest->getMethod() . chr(10) . sha1($httpRequest->getContent()) . chr(10) . $httpRequest->getHe...
php
public function getSignatureContent(\TYPO3\Flow\Http\Request $httpRequest) { $date = $httpRequest->getHeader('Date'); $dateValue = $date instanceof \DateTime ? $date->format(DATE_RFC2822) : ''; $signData = $httpRequest->getMethod() . chr(10) . sha1($httpRequest->getContent()) . chr(10) . $httpRequest->getHe...
[ "public", "function", "getSignatureContent", "(", "\\", "TYPO3", "\\", "Flow", "\\", "Http", "\\", "Request", "$", "httpRequest", ")", "{", "$", "date", "=", "$", "httpRequest", "->", "getHeader", "(", "'Date'", ")", ";", "$", "dateValue", "=", "$", "dat...
Get the content for the signature from the given request @param \TYPO3\Flow\Http\Request $httpRequest @return string
[ "Get", "the", "content", "for", "the", "signature", "from", "the", "given", "request" ]
0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00
https://github.com/Flowpack/Flowpack.SingleSignOn.Client/blob/0512b66bba7cf31fd03c9608a1e4c67a7c1c0e00/Classes/Flowpack/SingleSignOn/Client/Security/RequestSigner.php#L43-L52
240,536
rseyferth/activerecord
lib/Model.php
Model.assignAttribute
public function assignAttribute($name, $value) { $table = static::table(); if (!is_object($value)) { if (array_key_exists($name, $table->columns)) { $value = $table->columns[$name]->cast($value, static::connection()); } else { $col = $table->getColumnByInflectedName($name); if (!is_null($col)){ ...
php
public function assignAttribute($name, $value) { $table = static::table(); if (!is_object($value)) { if (array_key_exists($name, $table->columns)) { $value = $table->columns[$name]->cast($value, static::connection()); } else { $col = $table->getColumnByInflectedName($name); if (!is_null($col)){ ...
[ "public", "function", "assignAttribute", "(", "$", "name", ",", "$", "value", ")", "{", "$", "table", "=", "static", "::", "table", "(", ")", ";", "if", "(", "!", "is_object", "(", "$", "value", ")", ")", "{", "if", "(", "array_key_exists", "(", "$...
Assign a value to an attribute. @param string $name Name of the attribute @param mixed &$value Value of the attribute @return mixed the attribute value
[ "Assign", "a", "value", "to", "an", "attribute", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L462-L490
240,537
rseyferth/activerecord
lib/Model.php
Model.&
public function &readAttribute($name) { // check for aliased attribute if (array_key_exists($name, static::$aliasAttribute)) $name = static::$aliasAttribute[$name]; // check for attribute if (array_key_exists($name,$this->_attributes)) return $this->_attributes[$name]; // check relationships if no at...
php
public function &readAttribute($name) { // check for aliased attribute if (array_key_exists($name, static::$aliasAttribute)) $name = static::$aliasAttribute[$name]; // check for attribute if (array_key_exists($name,$this->_attributes)) return $this->_attributes[$name]; // check relationships if no at...
[ "public", "function", "&", "readAttribute", "(", "$", "name", ")", "{", "// check for aliased attribute", "if", "(", "array_key_exists", "(", "$", "name", ",", "static", "::", "$", "aliasAttribute", ")", ")", "$", "name", "=", "static", "::", "$", "aliasAttr...
Retrieves an attribute's value or a relationship object based on the name passed. If the attribute accessed is 'id' then it will return the model's primary key no matter what the actual attribute name is for the primary key. @param string $name Name of an attribute @return mixed The value of the attribute @throws {@li...
[ "Retrieves", "an", "attribute", "s", "value", "or", "a", "relationship", "object", "based", "on", "the", "name", "passed", ".", "If", "the", "attribute", "accessed", "is", "id", "then", "it", "will", "return", "the", "model", "s", "primary", "key", "no", ...
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L501-L544
240,538
rseyferth/activerecord
lib/Model.php
Model.hasAttribute
public function hasAttribute($attrName) { // In default attributes if (array_key_exists($attrName, $this->_attributes)) return true; // A getter available? if (method_exists($this, "__get_$attrName")) return true; return false; }
php
public function hasAttribute($attrName) { // In default attributes if (array_key_exists($attrName, $this->_attributes)) return true; // A getter available? if (method_exists($this, "__get_$attrName")) return true; return false; }
[ "public", "function", "hasAttribute", "(", "$", "attrName", ")", "{", "// In default attributes", "if", "(", "array_key_exists", "(", "$", "attrName", ",", "$", "this", "->", "_attributes", ")", ")", "return", "true", ";", "// A getter available?", "if", "(", ...
Check if given attribute exists @param string Attribute name @return boolean True or false
[ "Check", "if", "given", "attribute", "exists" ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L551-L563
240,539
rseyferth/activerecord
lib/Model.php
Model.flagDirty
public function flagDirty($name, $dirty = true) { if (!$this->_dirty) $this->_dirty = array(); if ($dirty) { $this->_dirty[$name] = true; } else { if (array_key_exists($name, $this->_dirty)) { unset($this->_dirty[$name]); } } }
php
public function flagDirty($name, $dirty = true) { if (!$this->_dirty) $this->_dirty = array(); if ($dirty) { $this->_dirty[$name] = true; } else { if (array_key_exists($name, $this->_dirty)) { unset($this->_dirty[$name]); } } }
[ "public", "function", "flagDirty", "(", "$", "name", ",", "$", "dirty", "=", "true", ")", "{", "if", "(", "!", "$", "this", "->", "_dirty", ")", "$", "this", "->", "_dirty", "=", "array", "(", ")", ";", "if", "(", "$", "dirty", ")", "{", "$", ...
Flags an attribute as dirty. @param string $name Attribute name
[ "Flags", "an", "attribute", "as", "dirty", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L570-L580
240,540
rseyferth/activerecord
lib/Model.php
Model.dirtyAttributes
public function dirtyAttributes() { if (!$this->_dirty) return null; $dirty = array_intersect_key($this->_attributes, $this->_dirty); return !empty($dirty) ? $dirty : null; }
php
public function dirtyAttributes() { if (!$this->_dirty) return null; $dirty = array_intersect_key($this->_attributes, $this->_dirty); return !empty($dirty) ? $dirty : null; }
[ "public", "function", "dirtyAttributes", "(", ")", "{", "if", "(", "!", "$", "this", "->", "_dirty", ")", "return", "null", ";", "$", "dirty", "=", "array_intersect_key", "(", "$", "this", "->", "_attributes", ",", "$", "this", "->", "_dirty", ")", ";"...
Returns hash of attributes that have been modified since loading the model. @return mixed null if no dirty attributes otherwise returns array of dirty attributes.
[ "Returns", "hash", "of", "attributes", "that", "have", "been", "modified", "since", "loading", "the", "model", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L587-L594
240,541
rseyferth/activerecord
lib/Model.php
Model.attributeIsDirty
public function attributeIsDirty($attribute) { return $this->_dirty && isset($this->_dirty[$attribute]) && array_key_exists($attribute, $this->_attributes); }
php
public function attributeIsDirty($attribute) { return $this->_dirty && isset($this->_dirty[$attribute]) && array_key_exists($attribute, $this->_attributes); }
[ "public", "function", "attributeIsDirty", "(", "$", "attribute", ")", "{", "return", "$", "this", "->", "_dirty", "&&", "isset", "(", "$", "this", "->", "_dirty", "[", "$", "attribute", "]", ")", "&&", "array_key_exists", "(", "$", "attribute", ",", "$",...
Check if a particular attribute has been modified since loading the model. @param string $attribute Name of the attribute @return boolean TRUE if it has been modified.
[ "Check", "if", "a", "particular", "attribute", "has", "been", "modified", "since", "loading", "the", "model", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L601-L604
240,542
rseyferth/activerecord
lib/Model.php
Model.create
public static function create($attributes, $validate = true, $guardAttributes=true) { // Get class and instantiate it $className = get_called_class(); $model = new $className($attributes, $guardAttributes); $model->save($validate); return $model; }
php
public static function create($attributes, $validate = true, $guardAttributes=true) { // Get class and instantiate it $className = get_called_class(); $model = new $className($attributes, $guardAttributes); $model->save($validate); return $model; }
[ "public", "static", "function", "create", "(", "$", "attributes", ",", "$", "validate", "=", "true", ",", "$", "guardAttributes", "=", "true", ")", "{", "// Get class and instantiate it", "$", "className", "=", "get_called_class", "(", ")", ";", "$", "model", ...
Creates a model and saves it to the database. @param array $attributes Array of the models attributes @param boolean $validate True if the validators should be run @param boolean $guard_attributes Set to true to guard protected/non-accessible attributes @return Model
[ "Creates", "a", "model", "and", "saves", "it", "to", "the", "database", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L802-L809
240,543
rseyferth/activerecord
lib/Model.php
Model.insert
private function insert($validate = true) { $this->verifyNotReadonly('insert'); // Check if validation or beforeCreate returns false. if (($validate && !$this->_validate() || !$this->invokeCallback('beforeCreate',false))) { return false; } $table = static::table(); // Get dirty attributes, or when no...
php
private function insert($validate = true) { $this->verifyNotReadonly('insert'); // Check if validation or beforeCreate returns false. if (($validate && !$this->_validate() || !$this->invokeCallback('beforeCreate',false))) { return false; } $table = static::table(); // Get dirty attributes, or when no...
[ "private", "function", "insert", "(", "$", "validate", "=", "true", ")", "{", "$", "this", "->", "verifyNotReadonly", "(", "'insert'", ")", ";", "// Check if validation or beforeCreate returns false.", "if", "(", "(", "$", "validate", "&&", "!", "$", "this", "...
Issue an INSERT sql statement for this model's attribute. @see save @param boolean $validate Set to true or false depending on if you want the validators to run or not @return boolean True if the model was saved to the database otherwise false
[ "Issue", "an", "INSERT", "sql", "statement", "for", "this", "model", "s", "attribute", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L836-L895
240,544
rseyferth/activerecord
lib/Model.php
Model.update
private function update($validate = true) { $this->verifyNotReadonly('update'); // Valid record? if ($validate && !$this->_validate()) { return false; } // Anything to update? if ($this->isDirty()) { // Check my primary key $pk = $this->valuesForPk(); if (empty($pk)) { throw new ActiveRe...
php
private function update($validate = true) { $this->verifyNotReadonly('update'); // Valid record? if ($validate && !$this->_validate()) { return false; } // Anything to update? if ($this->isDirty()) { // Check my primary key $pk = $this->valuesForPk(); if (empty($pk)) { throw new ActiveRe...
[ "private", "function", "update", "(", "$", "validate", "=", "true", ")", "{", "$", "this", "->", "verifyNotReadonly", "(", "'update'", ")", ";", "// Valid record?", "if", "(", "$", "validate", "&&", "!", "$", "this", "->", "_validate", "(", ")", ")", "...
Issue an UPDATE sql statement for this model's dirty attributes. @see save @param boolean $validate Set to true or false depending on if you want the validators to run or not @return boolean True if the model was saved to the database otherwise false
[ "Issue", "an", "UPDATE", "sql", "statement", "for", "this", "model", "s", "dirty", "attributes", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L904-L934
240,545
rseyferth/activerecord
lib/Model.php
Model.delete
public function delete() { $this->verifyNotReadonly('delete'); $pk = $this->valuesForPk(); if (empty($pk)) throw new ActiveRecordException("Cannot delete, no primary key defined for: " . get_called_class()); if (!$this->invokeCallback('beforeDestroy',false)) return false; static::table()->delete($p...
php
public function delete() { $this->verifyNotReadonly('delete'); $pk = $this->valuesForPk(); if (empty($pk)) throw new ActiveRecordException("Cannot delete, no primary key defined for: " . get_called_class()); if (!$this->invokeCallback('beforeDestroy',false)) return false; static::table()->delete($p...
[ "public", "function", "delete", "(", ")", "{", "$", "this", "->", "verifyNotReadonly", "(", "'delete'", ")", ";", "$", "pk", "=", "$", "this", "->", "valuesForPk", "(", ")", ";", "if", "(", "empty", "(", "$", "pk", ")", ")", "throw", "new", "Active...
Deletes this model from the database and returns true if successful. @return boolean
[ "Deletes", "this", "model", "from", "the", "database", "and", "returns", "true", "if", "successful", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1062-L1078
240,546
rseyferth/activerecord
lib/Model.php
Model.valuesFor
public function valuesFor($attributeNames) { $filter = array(); foreach ($attributeNames as $name) $filter[$name] = $this->$name; return $filter; }
php
public function valuesFor($attributeNames) { $filter = array(); foreach ($attributeNames as $name) $filter[$name] = $this->$name; return $filter; }
[ "public", "function", "valuesFor", "(", "$", "attributeNames", ")", "{", "$", "filter", "=", "array", "(", ")", ";", "foreach", "(", "$", "attributeNames", "as", "$", "name", ")", "$", "filter", "[", "$", "name", "]", "=", "$", "this", "->", "$", "...
Helper to return a hash of values for the specified attributes. @param array $attribute_names Array of attribute names @return array An array in the form array(name => value, ...)
[ "Helper", "to", "return", "a", "hash", "of", "values", "for", "the", "specified", "attributes", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1096-L1104
240,547
rseyferth/activerecord
lib/Model.php
Model._validate
protected function _validate() { // Check if validation is necessary and parsed if (static::$validates === false) return true; if (is_null(static::$_validation)) { require_once("Validation/Validation.php"); static::$_validation = Validation\Validation::onModel(get_called_class()); } // Go validate...
php
protected function _validate() { // Check if validation is necessary and parsed if (static::$validates === false) return true; if (is_null(static::$_validation)) { require_once("Validation/Validation.php"); static::$_validation = Validation\Validation::onModel(get_called_class()); } // Go validate...
[ "protected", "function", "_validate", "(", ")", "{", "// Check if validation is necessary and parsed", "if", "(", "static", "::", "$", "validates", "===", "false", ")", "return", "true", ";", "if", "(", "is_null", "(", "static", "::", "$", "_validation", ")", ...
Validates the model. @return boolean True if passed validators otherwise false
[ "Validates", "the", "model", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1111-L1142
240,548
rseyferth/activerecord
lib/Model.php
Model.setTimestamps
public function setTimestamps() { $now = date('Y-m-d H:i:s'); if (isset($this->updated_at)) $this->updated_at = $now; if (isset($this->created_at) && $this->isNewRecord()) $this->created_at = $now; }
php
public function setTimestamps() { $now = date('Y-m-d H:i:s'); if (isset($this->updated_at)) $this->updated_at = $now; if (isset($this->created_at) && $this->isNewRecord()) $this->created_at = $now; }
[ "public", "function", "setTimestamps", "(", ")", "{", "$", "now", "=", "date", "(", "'Y-m-d H:i:s'", ")", ";", "if", "(", "isset", "(", "$", "this", "->", "updated_at", ")", ")", "$", "this", "->", "updated_at", "=", "$", "now", ";", "if", "(", "is...
Updates a model's timestamps.
[ "Updates", "a", "model", "s", "timestamps", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1189-L1198
240,549
rseyferth/activerecord
lib/Model.php
Model.updateAttribute
public function updateAttribute($name, $value) { $this->__set($name, $value); return $this->update(false); }
php
public function updateAttribute($name, $value) { $this->__set($name, $value); return $this->update(false); }
[ "public", "function", "updateAttribute", "(", "$", "name", ",", "$", "value", ")", "{", "$", "this", "->", "__set", "(", "$", "name", ",", "$", "value", ")", ";", "return", "$", "this", "->", "update", "(", "false", ")", ";", "}" ]
Updates a single attribute and saves the record without going through the normal validation procedure. @param string $name Name of attribute @param mixed $value Value of the attribute @return boolean True if successful otherwise false
[ "Updates", "a", "single", "attribute", "and", "saves", "the", "record", "without", "going", "through", "the", "normal", "validation", "procedure", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1219-L1223
240,550
rseyferth/activerecord
lib/Model.php
Model.reload
public function reload() { $this->_relationships = array(); $pk = array_values($this->getValuesFor($this->getPrimaryKey())); $this->setAttributesViaMassAssignment($this->find($pk)->attributes, false); $this->resetDirty(); return $this; }
php
public function reload() { $this->_relationships = array(); $pk = array_values($this->getValuesFor($this->getPrimaryKey())); $this->setAttributesViaMassAssignment($this->find($pk)->attributes, false); $this->resetDirty(); return $this; }
[ "public", "function", "reload", "(", ")", "{", "$", "this", "->", "_relationships", "=", "array", "(", ")", ";", "$", "pk", "=", "array_values", "(", "$", "this", "->", "getValuesFor", "(", "$", "this", "->", "getPrimaryKey", "(", ")", ")", ")", ";",...
Reloads the attributes and relationships of this object from the database. @return Model
[ "Reloads", "the", "attributes", "and", "relationships", "of", "this", "object", "from", "the", "database", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1324-L1333
240,551
rseyferth/activerecord
lib/Model.php
Model.count
public static function count(/* ... */) { $args = func_get_args(); $options = static::extractAndValidateOptions($args); $options['select'] = 'COUNT(*)'; if (!empty($args) && !is_null($args[0]) && !empty($args[0])) { if (is_hash($args[0])) $options['conditions'] = $args[0]; else $options['condi...
php
public static function count(/* ... */) { $args = func_get_args(); $options = static::extractAndValidateOptions($args); $options['select'] = 'COUNT(*)'; if (!empty($args) && !is_null($args[0]) && !empty($args[0])) { if (is_hash($args[0])) $options['conditions'] = $args[0]; else $options['condi...
[ "public", "static", "function", "count", "(", "/* ... */", ")", "{", "$", "args", "=", "func_get_args", "(", ")", ";", "$", "options", "=", "static", "::", "extractAndValidateOptions", "(", "$", "args", ")", ";", "$", "options", "[", "'select'", "]", "="...
Get a count of qualifying records. <code> YourModel::count(array('conditions' => 'amount > 3.14159265')); </code> @see find @return int Number of records that matched the query
[ "Get", "a", "count", "of", "qualifying", "records", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1499-L1517
240,552
rseyferth/activerecord
lib/Model.php
Model.find
public static function find(/* $type, $options */) { $class = get_called_class(); if (func_num_args() <= 0) throw new RecordNotFound("Couldn't find $class without an ID"); $args = func_get_args(); $options = static::extractAndValidateOptions($args); $num_args = count($args); $single = true; if ($nu...
php
public static function find(/* $type, $options */) { $class = get_called_class(); if (func_num_args() <= 0) throw new RecordNotFound("Couldn't find $class without an ID"); $args = func_get_args(); $options = static::extractAndValidateOptions($args); $num_args = count($args); $single = true; if ($nu...
[ "public", "static", "function", "find", "(", "/* $type, $options */", ")", "{", "$", "class", "=", "get_called_class", "(", ")", ";", "if", "(", "func_num_args", "(", ")", "<=", "0", ")", "throw", "new", "RecordNotFound", "(", "\"Couldn't find $class without an ...
Find records in the database. Finding by the primary key: <code> # queries for the model with id=123 YourModel::find(123); # queries for model with id in(1,2,3) YourModel::find(1,2,3); # finding by pk accepts an options array YourModel::find(123,array('order' => 'name desc')); </code> Finding by using a conditions...
[ "Find", "records", "in", "the", "database", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1612-L1661
240,553
rseyferth/activerecord
lib/Model.php
Model.findByPk
public static function findByPk($values, $options) { $options['conditions'] = static::pkConditions($values); $list = static::table()->find($options); $results = count($list); if ($results != ($expected = count($values))) { $class = get_called_class(); if ($expected == 1) { if (!is_array($value...
php
public static function findByPk($values, $options) { $options['conditions'] = static::pkConditions($values); $list = static::table()->find($options); $results = count($list); if ($results != ($expected = count($values))) { $class = get_called_class(); if ($expected == 1) { if (!is_array($value...
[ "public", "static", "function", "findByPk", "(", "$", "values", ",", "$", "options", ")", "{", "$", "options", "[", "'conditions'", "]", "=", "static", "::", "pkConditions", "(", "$", "values", ")", ";", "$", "list", "=", "static", "::", "table", "(", ...
Finder method which will find by a single or array of primary keys for this model. @see find @param array $values An array containing values for the pk @param array $options An options array @return Model @throws {@link RecordNotFound} if a record could not be found
[ "Finder", "method", "which", "will", "find", "by", "a", "single", "or", "array", "of", "primary", "keys", "for", "this", "model", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1672-L1694
240,554
rseyferth/activerecord
lib/Model.php
Model.isOptionsHash
public static function isOptionsHash($array, $throw = true) { if (Arry::isHash($array)) { $keys = array_keys($array); $diff = array_diff($keys,self::$validOptions); if (!empty($diff) && $throw) { throw new ActiveRecordException("Unknown key(s): " . join(', ',$diff)); } $intersect = array_inter...
php
public static function isOptionsHash($array, $throw = true) { if (Arry::isHash($array)) { $keys = array_keys($array); $diff = array_diff($keys,self::$validOptions); if (!empty($diff) && $throw) { throw new ActiveRecordException("Unknown key(s): " . join(', ',$diff)); } $intersect = array_inter...
[ "public", "static", "function", "isOptionsHash", "(", "$", "array", ",", "$", "throw", "=", "true", ")", "{", "if", "(", "Arry", "::", "isHash", "(", "$", "array", ")", ")", "{", "$", "keys", "=", "array_keys", "(", "$", "array", ")", ";", "$", "...
Determines if the specified array is a valid ActiveRecord options array. @param array $array An options array @param bool $throw True to throw an exception if not valid @return boolean True if valid otherwise valse @throws {@link ActiveRecordException} if the array contained any invalid options
[ "Determines", "if", "the", "specified", "array", "is", "a", "valid", "ActiveRecord", "options", "array", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1733-L1751
240,555
rseyferth/activerecord
lib/Model.php
Model.invokeCallback
private function invokeCallback($method_name, $must_exist=true) { return static::table()->callback->invoke($this,$method_name,$must_exist); }
php
private function invokeCallback($method_name, $must_exist=true) { return static::table()->callback->invoke($this,$method_name,$must_exist); }
[ "private", "function", "invokeCallback", "(", "$", "method_name", ",", "$", "must_exist", "=", "true", ")", "{", "return", "static", "::", "table", "(", ")", "->", "callback", "->", "invoke", "(", "$", "this", ",", "$", "method_name", ",", "$", "must_exi...
Invokes the specified callback on this model. @param string $method_name Name of the call back to run. @param boolean $must_exist Set to true to raise an exception if the callback does not exist. @return boolean True if invoked or null if not
[ "Invokes", "the", "specified", "callback", "on", "this", "model", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1913-L1916
240,556
rseyferth/activerecord
lib/Model.php
Model.transaction
public static function transaction($closure) { $connection = static::connection(); try { $connection->transaction(); if ($closure() === false) { $connection->rollback(); return false; } else $connection->commit(); } catch (\Exception $e) { $connection->rollback(); throw $...
php
public static function transaction($closure) { $connection = static::connection(); try { $connection->transaction(); if ($closure() === false) { $connection->rollback(); return false; } else $connection->commit(); } catch (\Exception $e) { $connection->rollback(); throw $...
[ "public", "static", "function", "transaction", "(", "$", "closure", ")", "{", "$", "connection", "=", "static", "::", "connection", "(", ")", ";", "try", "{", "$", "connection", "->", "transaction", "(", ")", ";", "if", "(", "$", "closure", "(", ")", ...
Executes a block of code inside a database transaction. <code> YourModel::transaction(function() { YourModel::create(array("name" => "blah")); }); </code> If an exception is thrown inside the closure the transaction will automatically be rolled back. You can also return false from your closure to cause a rollback: <...
[ "Executes", "a", "block", "of", "code", "inside", "a", "database", "transaction", "." ]
0e7b1cbddd6f967c3a09adf38753babd5f698e39
https://github.com/rseyferth/activerecord/blob/0e7b1cbddd6f967c3a09adf38753babd5f698e39/lib/Model.php#L1949-L1971
240,557
xloit/xloit-bridge-zend-mvc
src/Controller/Plugin/FlashData.php
FlashData.isFromRoute
public function isFromRoute($routeName) { $session = $this->getSession(); /** @noinspection PhpUndefinedFieldInspection */ if ($session->data === null || !is_array($session->source)) { return null; } /** @noinspection PhpUndefinedFieldInspection */ retur...
php
public function isFromRoute($routeName) { $session = $this->getSession(); /** @noinspection PhpUndefinedFieldInspection */ if ($session->data === null || !is_array($session->source)) { return null; } /** @noinspection PhpUndefinedFieldInspection */ retur...
[ "public", "function", "isFromRoute", "(", "$", "routeName", ")", "{", "$", "session", "=", "$", "this", "->", "getSession", "(", ")", ";", "/** @noinspection PhpUndefinedFieldInspection */", "if", "(", "$", "session", "->", "data", "===", "null", "||", "!", ...
Indicates whether current data from the specified route name. @param string $routeName @return bool @throws \Zend\Session\Exception\InvalidArgumentException
[ "Indicates", "whether", "current", "data", "from", "the", "specified", "route", "name", "." ]
9991dc46f0b4b8831289ededc8ff0edaacffadd5
https://github.com/xloit/xloit-bridge-zend-mvc/blob/9991dc46f0b4b8831289ededc8ff0edaacffadd5/src/Controller/Plugin/FlashData.php#L152-L163
240,558
xloit/xloit-bridge-zend-mvc
src/Controller/Plugin/FlashData.php
FlashData.removeData
public function removeData() { $session = $this->getSession(); /** @noinspection PhpUndefinedFieldInspection */ if ($session->data !== null) { unset($session->data); return true; } return false; }
php
public function removeData() { $session = $this->getSession(); /** @noinspection PhpUndefinedFieldInspection */ if ($session->data !== null) { unset($session->data); return true; } return false; }
[ "public", "function", "removeData", "(", ")", "{", "$", "session", "=", "$", "this", "->", "getSession", "(", ")", ";", "/** @noinspection PhpUndefinedFieldInspection */", "if", "(", "$", "session", "->", "data", "!==", "null", ")", "{", "unset", "(", "$", ...
Remove current route data. @return bool @throws \Zend\Session\Exception\InvalidArgumentException
[ "Remove", "current", "route", "data", "." ]
9991dc46f0b4b8831289ededc8ff0edaacffadd5
https://github.com/xloit/xloit-bridge-zend-mvc/blob/9991dc46f0b4b8831289ededc8ff0edaacffadd5/src/Controller/Plugin/FlashData.php#L199-L211
240,559
simple-php-mvc/installer-module
src/InstallerModule/Generator/DBALGenerator.php
DBALGenerator.generate
public function generate(Module $module, $modelName, array $arrayValues) { $modelClass = $module->getNamespace() . '\\Model\\' . $modelName; $modelPath = $module->getPath() . '/Model/' . str_replace('\\', '/', $modelName) . '.php'; $modelCode = $this->generateCode($module, $modelN...
php
public function generate(Module $module, $modelName, array $arrayValues) { $modelClass = $module->getNamespace() . '\\Model\\' . $modelName; $modelPath = $module->getPath() . '/Model/' . str_replace('\\', '/', $modelName) . '.php'; $modelCode = $this->generateCode($module, $modelN...
[ "public", "function", "generate", "(", "Module", "$", "module", ",", "$", "modelName", ",", "array", "$", "arrayValues", ")", "{", "$", "modelClass", "=", "$", "module", "->", "getNamespace", "(", ")", ".", "'\\\\Model\\\\'", ".", "$", "modelName", ";", ...
Generate PDO Model @param Module $module @param string $modelName @param array $arrayValues
[ "Generate", "PDO", "Model" ]
62bd5bac05418b5f712dfcead1edc75ef14d60e3
https://github.com/simple-php-mvc/installer-module/blob/62bd5bac05418b5f712dfcead1edc75ef14d60e3/src/InstallerModule/Generator/DBALGenerator.php#L58-L71
240,560
simple-php-mvc/installer-module
src/InstallerModule/Generator/DBALGenerator.php
DBALGenerator.generateCode
protected function generateCode(Module $module, $modelName, $arrayValues) { $replaces = array( '<namespace>' => 'namespace ' . $module->getNamespace() . '\\Model;', '<modelAnnotation>' => $this->generateDocBlock($modelName), '<modelClassName>' => $modelName, ...
php
protected function generateCode(Module $module, $modelName, $arrayValues) { $replaces = array( '<namespace>' => 'namespace ' . $module->getNamespace() . '\\Model;', '<modelAnnotation>' => $this->generateDocBlock($modelName), '<modelClassName>' => $modelName, ...
[ "protected", "function", "generateCode", "(", "Module", "$", "module", ",", "$", "modelName", ",", "$", "arrayValues", ")", "{", "$", "replaces", "=", "array", "(", "'<namespace>'", "=>", "'namespace '", ".", "$", "module", "->", "getNamespace", "(", ")", ...
Generate model class code @param Module $module @param string $modelName @param array $arrayValues @return string
[ "Generate", "model", "class", "code" ]
62bd5bac05418b5f712dfcead1edc75ef14d60e3
https://github.com/simple-php-mvc/installer-module/blob/62bd5bac05418b5f712dfcead1edc75ef14d60e3/src/InstallerModule/Generator/DBALGenerator.php#L81-L94
240,561
samurai-fw/samurai
src/Samurai/Component/Migration/Phinx/Helper.php
Helper.fileNameStrategy
public function fileNameStrategy($database, $name) { $name = join('_', array_map('lcfirst', preg_split('/(?=[A-Z])/', $name))); return $database . DS . $this->generateVersion() . $name . '.php'; }
php
public function fileNameStrategy($database, $name) { $name = join('_', array_map('lcfirst', preg_split('/(?=[A-Z])/', $name))); return $database . DS . $this->generateVersion() . $name . '.php'; }
[ "public", "function", "fileNameStrategy", "(", "$", "database", ",", "$", "name", ")", "{", "$", "name", "=", "join", "(", "'_'", ",", "array_map", "(", "'lcfirst'", ",", "preg_split", "(", "'/(?=[A-Z])/'", ",", "$", "name", ")", ")", ")", ";", "return...
migration file name adjusting add version prefix (YmdHis + index) @param string $database @param string $name @return string
[ "migration", "file", "name", "adjusting" ]
7ca3847b13f86e2847a17ab5e8e4e20893021d5a
https://github.com/samurai-fw/samurai/blob/7ca3847b13f86e2847a17ab5e8e4e20893021d5a/src/Samurai/Component/Migration/Phinx/Helper.php#L72-L76
240,562
jmpantoja/planb-utils
src/Beautifier/Template/Token.php
Token.style
public function style(): Style { $type = StyleType::get($this->style); return StyleFactory::factory($type) ->lineWidth($this->lineWidth); }
php
public function style(): Style { $type = StyleType::get($this->style); return StyleFactory::factory($type) ->lineWidth($this->lineWidth); }
[ "public", "function", "style", "(", ")", ":", "Style", "{", "$", "type", "=", "StyleType", "::", "get", "(", "$", "this", "->", "style", ")", ";", "return", "StyleFactory", "::", "factory", "(", "$", "type", ")", "->", "lineWidth", "(", "$", "this", ...
Devuelve el estilo @return \PlanB\Beautifier\Style\Style
[ "Devuelve", "el", "estilo" ]
d17fbced4a285275928f8428ee56e269eb851690
https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Template/Token.php#L100-L106
240,563
jmpantoja/planb-utils
src/Beautifier/Template/Token.php
Token.value
public function value(): ?string { if (is_empty($this->key)) { return $this->original; } $value = $this->replacements->get($this->key, null); return $this->convertToString($value); }
php
public function value(): ?string { if (is_empty($this->key)) { return $this->original; } $value = $this->replacements->get($this->key, null); return $this->convertToString($value); }
[ "public", "function", "value", "(", ")", ":", "?", "string", "{", "if", "(", "is_empty", "(", "$", "this", "->", "key", ")", ")", "{", "return", "$", "this", "->", "original", ";", "}", "$", "value", "=", "$", "this", "->", "replacements", "->", ...
Devuelve el valor @return null|string
[ "Devuelve", "el", "valor" ]
d17fbced4a285275928f8428ee56e269eb851690
https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Template/Token.php#L113-L122
240,564
jmpantoja/planb-utils
src/Beautifier/Template/Token.php
Token.width
public function width(): int { $lines = explode("\n", $this->value()); $width = []; foreach ($lines as $line) { $raw = strip_tags($line); $width[] = strlen(trim($raw)); } return max($width); }
php
public function width(): int { $lines = explode("\n", $this->value()); $width = []; foreach ($lines as $line) { $raw = strip_tags($line); $width[] = strlen(trim($raw)); } return max($width); }
[ "public", "function", "width", "(", ")", ":", "int", "{", "$", "lines", "=", "explode", "(", "\"\\n\"", ",", "$", "this", "->", "value", "(", ")", ")", ";", "$", "width", "=", "[", "]", ";", "foreach", "(", "$", "lines", "as", "$", "line", ")",...
Devuelve el ancho del token @return int
[ "Devuelve", "el", "ancho", "del", "token" ]
d17fbced4a285275928f8428ee56e269eb851690
https://github.com/jmpantoja/planb-utils/blob/d17fbced4a285275928f8428ee56e269eb851690/src/Beautifier/Template/Token.php#L143-L154
240,565
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.setUserId
public function setUserId( $userId ) { $this->_user = null; $this->userId = ( (int) $userId ) ?: null; return $this; }
php
public function setUserId( $userId ) { $this->_user = null; $this->userId = ( (int) $userId ) ?: null; return $this; }
[ "public", "function", "setUserId", "(", "$", "userId", ")", "{", "$", "this", "->", "_user", "=", "null", ";", "$", "this", "->", "userId", "=", "(", "(", "int", ")", "$", "userId", ")", "?", ":", "null", ";", "return", "$", "this", ";", "}" ]
Set user-id @param int $userId @return \Grid\Paragraph\Model\Paragraph\Structure\Content
[ "Set", "user", "-", "id" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L294-L299
240,566
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.getUserMapper
protected function getUserMapper() { if ( null === $this->_userMapper ) { $mapper = $this->getMapper(); $this->_userMapper = $this->getServiceLocator() ->get( 'Di' ) ->get( 'Grid\User\Model\User\Mapp...
php
protected function getUserMapper() { if ( null === $this->_userMapper ) { $mapper = $this->getMapper(); $this->_userMapper = $this->getServiceLocator() ->get( 'Di' ) ->get( 'Grid\User\Model\User\Mapp...
[ "protected", "function", "getUserMapper", "(", ")", "{", "if", "(", "null", "===", "$", "this", "->", "_userMapper", ")", "{", "$", "mapper", "=", "$", "this", "->", "getMapper", "(", ")", ";", "$", "this", "->", "_userMapper", "=", "$", "this", "->"...
Get user mapper @return \Grid\User\Model\User\Mapper
[ "Get", "user", "mapper" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L306-L321
240,567
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.setPublishedFrom
public function setPublishedFrom( $date, $format = null ) { $this->publishedFrom = empty( $date ) ? null : $this->inputDate( $date, $format ); return $this; }
php
public function setPublishedFrom( $date, $format = null ) { $this->publishedFrom = empty( $date ) ? null : $this->inputDate( $date, $format ); return $this; }
[ "public", "function", "setPublishedFrom", "(", "$", "date", ",", "$", "format", "=", "null", ")", "{", "$", "this", "->", "publishedFrom", "=", "empty", "(", "$", "date", ")", "?", "null", ":", "$", "this", "->", "inputDate", "(", "$", "date", ",", ...
Set published-from date @param \DateTime|string $date @param string|null $format @return \Grid\Paragraph\Model\Paragraph\Structure\Content
[ "Set", "published", "-", "from", "date" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L453-L457
240,568
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.setPublishedTo
public function setPublishedTo( $date, $format = null ) { $this->publishedTo = empty( $date ) ? null : $this->inputDate( $date, $format ); return $this; }
php
public function setPublishedTo( $date, $format = null ) { $this->publishedTo = empty( $date ) ? null : $this->inputDate( $date, $format ); return $this; }
[ "public", "function", "setPublishedTo", "(", "$", "date", ",", "$", "format", "=", "null", ")", "{", "$", "this", "->", "publishedTo", "=", "empty", "(", "$", "date", ")", "?", "null", ":", "$", "this", "->", "inputDate", "(", "$", "date", ",", "$"...
Set published-to date @param \DateTime|string $date @param string|null $format @return \Grid\Paragraph\Model\Paragraph\Structure\Content
[ "Set", "published", "-", "to", "date" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L466-L470
240,569
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.isPublished
public function isPublished( $now = null ) { if ( ! $this->published ) { return false; } if ( empty( $now ) ) { $now = new DateTime(); } else { $now = $this->inputDate( $now ); } if ( ! empty( $this...
php
public function isPublished( $now = null ) { if ( ! $this->published ) { return false; } if ( empty( $now ) ) { $now = new DateTime(); } else { $now = $this->inputDate( $now ); } if ( ! empty( $this...
[ "public", "function", "isPublished", "(", "$", "now", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "published", ")", "{", "return", "false", ";", "}", "if", "(", "empty", "(", "$", "now", ")", ")", "{", "$", "now", "=", "new", "Dat...
Is published at a given time point @param int|string|\DateTime $now default: null @return bool
[ "Is", "published", "at", "a", "given", "time", "point" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L478-L507
240,570
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.setAccessUsers
public function setAccessUsers( $users ) { $this->accessUsers = array_unique( is_array( $users ) ? $users : preg_split( '/[,\s]+/', $users ) ); return $this; }
php
public function setAccessUsers( $users ) { $this->accessUsers = array_unique( is_array( $users ) ? $users : preg_split( '/[,\s]+/', $users ) ); return $this; }
[ "public", "function", "setAccessUsers", "(", "$", "users", ")", "{", "$", "this", "->", "accessUsers", "=", "array_unique", "(", "is_array", "(", "$", "users", ")", "?", "$", "users", ":", "preg_split", "(", "'/[,\\s]+/'", ",", "$", "users", ")", ")", ...
Set access users @param array|string $users @return \Grid\Paragraph\Model\Paragraph\Structure\Content
[ "Set", "access", "users" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L527-L534
240,571
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.setAccessGroups
public function setAccessGroups( $groups ) { $this->accessGroups = array_unique( is_array( $groups ) ? $groups : preg_split( '/[,\s]+/', $groups ) ); return $this; }
php
public function setAccessGroups( $groups ) { $this->accessGroups = array_unique( is_array( $groups ) ? $groups : preg_split( '/[,\s]+/', $groups ) ); return $this; }
[ "public", "function", "setAccessGroups", "(", "$", "groups", ")", "{", "$", "this", "->", "accessGroups", "=", "array_unique", "(", "is_array", "(", "$", "groups", ")", "?", "$", "groups", ":", "preg_split", "(", "'/[,\\s]+/'", ",", "$", "groups", ")", "...
Set access groups @param array|string $groups @return \Grid\Paragraph\Model\Paragraph\Structure\Content
[ "Set", "access", "groups" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L542-L549
240,572
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.setEditUsers
public function setEditUsers( $users ) { $this->editUsers = array_unique( is_array( $users ) ? $users : preg_split( '/[,\s]+/', $users ) ); return $this; }
php
public function setEditUsers( $users ) { $this->editUsers = array_unique( is_array( $users ) ? $users : preg_split( '/[,\s]+/', $users ) ); return $this; }
[ "public", "function", "setEditUsers", "(", "$", "users", ")", "{", "$", "this", "->", "editUsers", "=", "array_unique", "(", "is_array", "(", "$", "users", ")", "?", "$", "users", ":", "preg_split", "(", "'/[,\\s]+/'", ",", "$", "users", ")", ")", ";",...
Set edit users @param array|string $users @return \Grid\Paragraph\Model\Paragraph\Structure\Content
[ "Set", "edit", "users" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L557-L564
240,573
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.setEditGroups
public function setEditGroups( $groups ) { $this->editGroups = array_unique( is_array( $groups ) ? $groups : preg_split( '/[,\s]+/', $groups ) ); return $this; }
php
public function setEditGroups( $groups ) { $this->editGroups = array_unique( is_array( $groups ) ? $groups : preg_split( '/[,\s]+/', $groups ) ); return $this; }
[ "public", "function", "setEditGroups", "(", "$", "groups", ")", "{", "$", "this", "->", "editGroups", "=", "array_unique", "(", "is_array", "(", "$", "groups", ")", "?", "$", "groups", ":", "preg_split", "(", "'/[,\\s]+/'", ",", "$", "groups", ")", ")", ...
Set edit groups @param array|string $groups @return \Grid\Paragraph\Model\Paragraph\Structure\Content
[ "Set", "edit", "groups" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L572-L579
240,574
webriq/core
module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php
Content.getSeoUri
public function getSeoUri() { if ( ! empty( $this->_seoUri ) ) { return $this->_seoUri; } if ( empty( $this->id ) ) { return ''; } if ( empty( $this->_seoUri ) ) { $this->_seoUriStructure = $this->getUriStructure( ...
php
public function getSeoUri() { if ( ! empty( $this->_seoUri ) ) { return $this->_seoUri; } if ( empty( $this->id ) ) { return ''; } if ( empty( $this->_seoUri ) ) { $this->_seoUriStructure = $this->getUriStructure( ...
[ "public", "function", "getSeoUri", "(", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "_seoUri", ")", ")", "{", "return", "$", "this", "->", "_seoUri", ";", "}", "if", "(", "empty", "(", "$", "this", "->", "id", ")", ")", "{", "ret...
Get seo-friendly uri @return string
[ "Get", "seo", "-", "friendly", "uri" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Paragraph/src/Grid/Paragraph/Model/Paragraph/Structure/Content.php#L663-L689
240,575
webriq/core
module/Menu/src/Grid/Menu/Model/Menu/Structure/Container.php
Container.getUri
public function getUri() { if ( $this->hasChildren() ) { foreach( $this->getChildren() as $child ) { $uri = $child->getUri(); if ( '#' != $uri[0] ) { return $uri; } } } ...
php
public function getUri() { if ( $this->hasChildren() ) { foreach( $this->getChildren() as $child ) { $uri = $child->getUri(); if ( '#' != $uri[0] ) { return $uri; } } } ...
[ "public", "function", "getUri", "(", ")", "{", "if", "(", "$", "this", "->", "hasChildren", "(", ")", ")", "{", "foreach", "(", "$", "this", "->", "getChildren", "(", ")", "as", "$", "child", ")", "{", "$", "uri", "=", "$", "child", "->", "getUri...
Get URI of this menu-item @return string
[ "Get", "URI", "of", "this", "menu", "-", "item" ]
cfeb6e8a4732561c2215ec94e736c07f9b8bc990
https://github.com/webriq/core/blob/cfeb6e8a4732561c2215ec94e736c07f9b8bc990/module/Menu/src/Grid/Menu/Model/Menu/Structure/Container.php#L25-L43
240,576
sadekbaroudi/operation-state
OperationState.php
OperationState.execute
public function execute() { $returnValues = array(); while ($execute = array_shift($this->executeParameters)) { $returnValues[] = $this->run($execute); } return $returnValues; }
php
public function execute() { $returnValues = array(); while ($execute = array_shift($this->executeParameters)) { $returnValues[] = $this->run($execute); } return $returnValues; }
[ "public", "function", "execute", "(", ")", "{", "$", "returnValues", "=", "array", "(", ")", ";", "while", "(", "$", "execute", "=", "array_shift", "(", "$", "this", "->", "executeParameters", ")", ")", "{", "$", "returnValues", "[", "]", "=", "$", "...
This will execute all the actions in the queue. It will not clear the queue! @return array returns the results of the executed actions, with OperationState->getKey() as the array keys
[ "This", "will", "execute", "all", "the", "actions", "in", "the", "queue", ".", "It", "will", "not", "clear", "the", "queue!" ]
75b34571ca8b77380eef4bc1be0cbea35bcb9c68
https://github.com/sadekbaroudi/operation-state/blob/75b34571ca8b77380eef4bc1be0cbea35bcb9c68/OperationState.php#L98-L107
240,577
sadekbaroudi/operation-state
OperationState.php
OperationState.undo
public function undo() { $returnValues = array(); while ($undo = array_shift($this->undoParameters)) { $returnValues[] = $this->run($undo); } return $returnValues; }
php
public function undo() { $returnValues = array(); while ($undo = array_shift($this->undoParameters)) { $returnValues[] = $this->run($undo); } return $returnValues; }
[ "public", "function", "undo", "(", ")", "{", "$", "returnValues", "=", "array", "(", ")", ";", "while", "(", "$", "undo", "=", "array_shift", "(", "$", "this", "->", "undoParameters", ")", ")", "{", "$", "returnValues", "[", "]", "=", "$", "this", ...
This will execute all the undo actions in the queue. It will not clear the queue! @return array returns the results of the undo actions, with OperationState->getKey() as the array keys
[ "This", "will", "execute", "all", "the", "undo", "actions", "in", "the", "queue", ".", "It", "will", "not", "clear", "the", "queue!" ]
75b34571ca8b77380eef4bc1be0cbea35bcb9c68
https://github.com/sadekbaroudi/operation-state/blob/75b34571ca8b77380eef4bc1be0cbea35bcb9c68/OperationState.php#L155-L163
240,578
sadekbaroudi/operation-state
OperationState.php
OperationState.run
protected function run($call) { if (!isset($call['callable'])) { throw new OperationStateException("\$call['callable'] was not set"); } if (!isset($call['arguments'])) { try { is_null($call['arguments']); } catch (\Excepti...
php
protected function run($call) { if (!isset($call['callable'])) { throw new OperationStateException("\$call['callable'] was not set"); } if (!isset($call['arguments'])) { try { is_null($call['arguments']); } catch (\Excepti...
[ "protected", "function", "run", "(", "$", "call", ")", "{", "if", "(", "!", "isset", "(", "$", "call", "[", "'callable'", "]", ")", ")", "{", "throw", "new", "OperationStateException", "(", "\"\\$call['callable'] was not set\"", ")", ";", "}", "if", "(", ...
This will run the action passed, whether execute or undo. @param array $call Contains 'callable' index supporting is_callable and 'arguments' (NULL or args). You can also pass OperationState::NO_ARGUMENT as an argument to call with no argument @throws \RuntimeException @return mixed returns the result of the method ca...
[ "This", "will", "run", "the", "action", "passed", "whether", "execute", "or", "undo", "." ]
75b34571ca8b77380eef4bc1be0cbea35bcb9c68
https://github.com/sadekbaroudi/operation-state/blob/75b34571ca8b77380eef4bc1be0cbea35bcb9c68/OperationState.php#L173-L196
240,579
sadekbaroudi/operation-state
OperationState.php
OperationState.getKey
public function getKey() { if (!isset($this->key)) { $this->key = md5(microtime().rand()); } return $this->key; }
php
public function getKey() { if (!isset($this->key)) { $this->key = md5(microtime().rand()); } return $this->key; }
[ "public", "function", "getKey", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "key", ")", ")", "{", "$", "this", "->", "key", "=", "md5", "(", "microtime", "(", ")", ".", "rand", "(", ")", ")", ";", "}", "return", "$", "this...
Get the a unique key for this object. It should return the same value regardless of when this function is called! @return string
[ "Get", "the", "a", "unique", "key", "for", "this", "object", ".", "It", "should", "return", "the", "same", "value", "regardless", "of", "when", "this", "function", "is", "called!" ]
75b34571ca8b77380eef4bc1be0cbea35bcb9c68
https://github.com/sadekbaroudi/operation-state/blob/75b34571ca8b77380eef4bc1be0cbea35bcb9c68/OperationState.php#L203-L209
240,580
pdenis/SnideTravinizerBundle
Loader/ComposerLoader.php
ComposerLoader.getFile
public function getFile(Repo $repo) { $file = tempnam(sys_get_temp_dir(), 'composer'); $content = file_get_contents($this->helper->getRawFileUrl($repo->getSlug(), 'master', 'composer.json')); file_put_contents($file, $content); return $file; }
php
public function getFile(Repo $repo) { $file = tempnam(sys_get_temp_dir(), 'composer'); $content = file_get_contents($this->helper->getRawFileUrl($repo->getSlug(), 'master', 'composer.json')); file_put_contents($file, $content); return $file; }
[ "public", "function", "getFile", "(", "Repo", "$", "repo", ")", "{", "$", "file", "=", "tempnam", "(", "sys_get_temp_dir", "(", ")", ",", "'composer'", ")", ";", "$", "content", "=", "file_get_contents", "(", "$", "this", "->", "helper", "->", "getRawFil...
Get composer file @param \Snide\Bundle\TravinizerBundle\Model\Repo $repo @return string
[ "Get", "composer", "file" ]
53a6fd647280d81a496018d379e4b5c446f81729
https://github.com/pdenis/SnideTravinizerBundle/blob/53a6fd647280d81a496018d379e4b5c446f81729/Loader/ComposerLoader.php#L40-L47
240,581
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.calculateTotalAmountForDeliveryExpenses
private function calculateTotalAmountForDeliveryExpenses(Transaction $transaction) { $total = 0; foreach ($transaction->getItems() as $productPurchase) { if($productPurchase->getProduct() instanceof Product){ if(!$productPurchase->getProduct()->isFreeTransport()){ ...
php
private function calculateTotalAmountForDeliveryExpenses(Transaction $transaction) { $total = 0; foreach ($transaction->getItems() as $productPurchase) { if($productPurchase->getProduct() instanceof Product){ if(!$productPurchase->getProduct()->isFreeTransport()){ ...
[ "private", "function", "calculateTotalAmountForDeliveryExpenses", "(", "Transaction", "$", "transaction", ")", "{", "$", "total", "=", "0", ";", "foreach", "(", "$", "transaction", "->", "getItems", "(", ")", "as", "$", "productPurchase", ")", "{", "if", "(", ...
Calculate total amount for delivery expenses @param Transaction $transaction @return float $total
[ "Calculate", "total", "amount", "for", "delivery", "expenses" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L169-L186
240,582
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.getCurrentTransaction
public function getCurrentTransaction() { if (false === $this->session->has('transaction-id')) { throw new AccessDeniedHttpException(); } return $this->manager->getRepository('EcommerceBundle:Transaction')->find($this->session->get('transaction-id')); }
php
public function getCurrentTransaction() { if (false === $this->session->has('transaction-id')) { throw new AccessDeniedHttpException(); } return $this->manager->getRepository('EcommerceBundle:Transaction')->find($this->session->get('transaction-id')); }
[ "public", "function", "getCurrentTransaction", "(", ")", "{", "if", "(", "false", "===", "$", "this", "->", "session", "->", "has", "(", "'transaction-id'", ")", ")", "{", "throw", "new", "AccessDeniedHttpException", "(", ")", ";", "}", "return", "$", "thi...
Get current transaction @throws AccessDeniedHttpException @return Transaction
[ "Get", "current", "transaction" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L194-L201
240,583
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.updateTransaction
public function updateTransaction() { $cart = $this->cartProvider->getCart(); if (0 === $cart->countItems() || $this->isTransactionUpdated($cart)) { return; } /** @var TransactionRepository $transactionRepository */ $transactionRepository = $this->manage...
php
public function updateTransaction() { $cart = $this->cartProvider->getCart(); if (0 === $cart->countItems() || $this->isTransactionUpdated($cart)) { return; } /** @var TransactionRepository $transactionRepository */ $transactionRepository = $this->manage...
[ "public", "function", "updateTransaction", "(", ")", "{", "$", "cart", "=", "$", "this", "->", "cartProvider", "->", "getCart", "(", ")", ";", "if", "(", "0", "===", "$", "cart", "->", "countItems", "(", ")", "||", "$", "this", "->", "isTransactionUpda...
Update transaction with cart's contents
[ "Update", "transaction", "with", "cart", "s", "contents" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L206-L267
240,584
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.isTransactionUpdated
private function isTransactionUpdated(Cart $cart) { if (false === $this->session->has('transaction-id')) { return false; } /** @var TransactionRepository $transactionRepository */ $transactionRepository = $this->manager->getRepository('EcommerceBundle:Transaction'); ...
php
private function isTransactionUpdated(Cart $cart) { if (false === $this->session->has('transaction-id')) { return false; } /** @var TransactionRepository $transactionRepository */ $transactionRepository = $this->manager->getRepository('EcommerceBundle:Transaction'); ...
[ "private", "function", "isTransactionUpdated", "(", "Cart", "$", "cart", ")", "{", "if", "(", "false", "===", "$", "this", "->", "session", "->", "has", "(", "'transaction-id'", ")", ")", "{", "return", "false", ";", "}", "/** @var TransactionRepository $trans...
Compare current cart with current transaction @param CartInterface $cart @return boolean
[ "Compare", "current", "cart", "with", "current", "transaction" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L346-L380
240,585
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.getDelivery
public function getDelivery(Transaction $transaction = null) { if ($this->session->has('delivery-id')) { $delivery = $this->manager->getRepository('EcommerceBundle:Delivery')->find($this->session->get('delivery-id')); return $delivery; } $delivery = new Delivery(); ...
php
public function getDelivery(Transaction $transaction = null) { if ($this->session->has('delivery-id')) { $delivery = $this->manager->getRepository('EcommerceBundle:Delivery')->find($this->session->get('delivery-id')); return $delivery; } $delivery = new Delivery(); ...
[ "public", "function", "getDelivery", "(", "Transaction", "$", "transaction", "=", "null", ")", "{", "if", "(", "$", "this", "->", "session", "->", "has", "(", "'delivery-id'", ")", ")", "{", "$", "delivery", "=", "$", "this", "->", "manager", "->", "ge...
Build a delivery object for the current actor @param Transaction $transaction @return Delivery
[ "Build", "a", "delivery", "object", "for", "the", "current", "actor" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L389-L423
240,586
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.saveDelivery
public function saveDelivery(Delivery $delivery, array $params, $cart) { /** @var Carrier $carrier */ // $carrier = $this->manager->getRepository('ModelBundle:Carrier')->find($delivery->getCarrier()); if ('same' === $params['selectDelivery']) { $delivery->setDeliveryContactPerson...
php
public function saveDelivery(Delivery $delivery, array $params, $cart) { /** @var Carrier $carrier */ // $carrier = $this->manager->getRepository('ModelBundle:Carrier')->find($delivery->getCarrier()); if ('same' === $params['selectDelivery']) { $delivery->setDeliveryContactPerson...
[ "public", "function", "saveDelivery", "(", "Delivery", "$", "delivery", ",", "array", "$", "params", ",", "$", "cart", ")", "{", "/** @var Carrier $carrier */", "// $carrier = $this->manager->getRepository('ModelBundle:Carrier')->find($delivery->getCarrier());", "if", "(...
Save delivery fields from billing fields @param Delivery $delivery @param array $params
[ "Save", "delivery", "fields", "from", "billing", "fields" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L431-L489
240,587
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.saveUserBillingAddress
private function saveUserBillingAddress($delivery) { // get billing address /** @var Address $billingAddress */ $billingAddress = $this->manager->getRepository('EcommerceBundle:Address')->findOneBy(array( 'actor' => $this->securityContext->getToken()...
php
private function saveUserBillingAddress($delivery) { // get billing address /** @var Address $billingAddress */ $billingAddress = $this->manager->getRepository('EcommerceBundle:Address')->findOneBy(array( 'actor' => $this->securityContext->getToken()...
[ "private", "function", "saveUserBillingAddress", "(", "$", "delivery", ")", "{", "// get billing address", "/** @var Address $billingAddress */", "$", "billingAddress", "=", "$", "this", "->", "manager", "->", "getRepository", "(", "'EcommerceBundle:Address'", ")", "->", ...
Save user billing address @param Delivery $delivery
[ "Save", "user", "billing", "address" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L496-L530
240,588
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.cleanSession
public function cleanSession() { // remove checkout session parameters $this->session->remove('select-delivery'); $this->session->remove('delivery-id'); $this->session->remove('existing-delivery-address'); $this->session->remove('transaction-id'); // abandon cart ...
php
public function cleanSession() { // remove checkout session parameters $this->session->remove('select-delivery'); $this->session->remove('delivery-id'); $this->session->remove('existing-delivery-address'); $this->session->remove('transaction-id'); // abandon cart ...
[ "public", "function", "cleanSession", "(", ")", "{", "// remove checkout session parameters", "$", "this", "->", "session", "->", "remove", "(", "'select-delivery'", ")", ";", "$", "this", "->", "session", "->", "remove", "(", "'delivery-id'", ")", ";", "$", "...
Clean checkout parameters from session and void the shopping cart
[ "Clean", "checkout", "parameters", "from", "session", "and", "void", "the", "shopping", "cart" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L630-L640
240,589
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.getBillingAddress
public function getBillingAddress($actor=null) { if(is_null($actor)){ $actor = $this->securityContext->getToken()->getUser(); if (!$actor || !is_object($actor)) { throw new \LogicException( 'The getBillingAddress cannot be used without an authentic...
php
public function getBillingAddress($actor=null) { if(is_null($actor)){ $actor = $this->securityContext->getToken()->getUser(); if (!$actor || !is_object($actor)) { throw new \LogicException( 'The getBillingAddress cannot be used without an authentic...
[ "public", "function", "getBillingAddress", "(", "$", "actor", "=", "null", ")", "{", "if", "(", "is_null", "(", "$", "actor", ")", ")", "{", "$", "actor", "=", "$", "this", "->", "securityContext", "->", "getToken", "(", ")", "->", "getUser", "(", ")...
Get billing address @return Address
[ "Get", "billing", "address" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L647-L674
240,590
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.isCurrentUserOwner
public function isCurrentUserOwner(Transaction $transaction) { if($this->securityContext->getToken()->getUser()->isGranted('ROLE_ADMIN')){ return true; } $currentUserId = $this->securityContext->getToken()->getUser()->getId(); //actor owner if($transactio...
php
public function isCurrentUserOwner(Transaction $transaction) { if($this->securityContext->getToken()->getUser()->isGranted('ROLE_ADMIN')){ return true; } $currentUserId = $this->securityContext->getToken()->getUser()->getId(); //actor owner if($transactio...
[ "public", "function", "isCurrentUserOwner", "(", "Transaction", "$", "transaction", ")", "{", "if", "(", "$", "this", "->", "securityContext", "->", "getToken", "(", ")", "->", "getUser", "(", ")", "->", "isGranted", "(", "'ROLE_ADMIN'", ")", ")", "{", "re...
Check if current user is the transaction owner @param Transaction $transaction @return boolean
[ "Check", "if", "current", "user", "is", "the", "transaction", "owner" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L683-L700
240,591
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.processBankTransfer
public function processBankTransfer(Transaction $transaction) { $transaction->setStatus(Transaction::STATUS_PENDING_TRANSFER); $pm = $this->manager->getRepository('EcommerceBundle:PaymentMethod')->findOneBySlug('bank-transfer-test'); $transaction->setPaymentMethod($pm); $this->manag...
php
public function processBankTransfer(Transaction $transaction) { $transaction->setStatus(Transaction::STATUS_PENDING_TRANSFER); $pm = $this->manager->getRepository('EcommerceBundle:PaymentMethod')->findOneBySlug('bank-transfer-test'); $transaction->setPaymentMethod($pm); $this->manag...
[ "public", "function", "processBankTransfer", "(", "Transaction", "$", "transaction", ")", "{", "$", "transaction", "->", "setStatus", "(", "Transaction", "::", "STATUS_PENDING_TRANSFER", ")", ";", "$", "pm", "=", "$", "this", "->", "manager", "->", "getRepositor...
Process a bank transfer request @param Transaction $transaction
[ "Process", "a", "bank", "transfer", "request" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L1549-L1559
240,592
sebardo/ecommerce
EcommerceBundle/Service/CheckoutManager.php
CheckoutManager.processRedsysTransaction
public function processRedsysTransaction($ds_response, Transaction $transaction) { if ($ds_response > 99) { return false; } $transaction->setStatus(Transaction::STATUS_PAID); $pm = $this->manager->getRepository('EcommerceBundle:PaymentMethod')->findOneBySlug('redsys'); ...
php
public function processRedsysTransaction($ds_response, Transaction $transaction) { if ($ds_response > 99) { return false; } $transaction->setStatus(Transaction::STATUS_PAID); $pm = $this->manager->getRepository('EcommerceBundle:PaymentMethod')->findOneBySlug('redsys'); ...
[ "public", "function", "processRedsysTransaction", "(", "$", "ds_response", ",", "Transaction", "$", "transaction", ")", "{", "if", "(", "$", "ds_response", ">", "99", ")", "{", "return", "false", ";", "}", "$", "transaction", "->", "setStatus", "(", "Transac...
Process a redsys transaction @param int $ds_response @param Transaction $transaction @return boolean
[ "Process", "a", "redsys", "transaction" ]
3e17545e69993f10a1df17f9887810c7378fc7f9
https://github.com/sebardo/ecommerce/blob/3e17545e69993f10a1df17f9887810c7378fc7f9/EcommerceBundle/Service/CheckoutManager.php#L1569-L1583
240,593
themichaelhall/bluemvc-core
src/Collections/ResponseCookieCollection.php
ResponseCookieCollection.get
public function get(string $name): ?ResponseCookieInterface { if (!isset($this->responseCookies[$name])) { return null; } return $this->responseCookies[$name]; }
php
public function get(string $name): ?ResponseCookieInterface { if (!isset($this->responseCookies[$name])) { return null; } return $this->responseCookies[$name]; }
[ "public", "function", "get", "(", "string", "$", "name", ")", ":", "?", "ResponseCookieInterface", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "responseCookies", "[", "$", "name", "]", ")", ")", "{", "return", "null", ";", "}", "return", "$...
Returns the response cookie by name if it exists, null otherwise. @since 1.0.0 @param string $name The name. @return ResponseCookieInterface|null The response cookie by name if it exists, null otherwise.
[ "Returns", "the", "response", "cookie", "by", "name", "if", "it", "exists", "null", "otherwise", "." ]
cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680
https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Collections/ResponseCookieCollection.php#L64-L71
240,594
themichaelhall/bluemvc-core
src/Collections/ResponseCookieCollection.php
ResponseCookieCollection.set
public function set(string $name, ResponseCookieInterface $responseCookie): void { $this->responseCookies[$name] = $responseCookie; }
php
public function set(string $name, ResponseCookieInterface $responseCookie): void { $this->responseCookies[$name] = $responseCookie; }
[ "public", "function", "set", "(", "string", "$", "name", ",", "ResponseCookieInterface", "$", "responseCookie", ")", ":", "void", "{", "$", "this", "->", "responseCookies", "[", "$", "name", "]", "=", "$", "responseCookie", ";", "}" ]
Sets a response cookie by name. @since 1.0.0 @param string $name The name. @param ResponseCookieInterface $responseCookie The response cookie.
[ "Sets", "a", "response", "cookie", "by", "name", "." ]
cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680
https://github.com/themichaelhall/bluemvc-core/blob/cbc8ccf8ed4f15ec6105837b29c2bd3db3f93680/src/Collections/ResponseCookieCollection.php#L113-L116
240,595
Becklyn/BecklynSymfonyBase
src/LocalAccess.php
LocalAccess.isLocalIp
private function isLocalIp () { $ip = $this->serverData["REMOTE_ADDR"]; if (!is_string($ip)) { return false; } if (in_array($ip, ['127.0.0.1', 'fe80::1', '::1'], true)) { return true; } // allowed (= local) IPs include ...
php
private function isLocalIp () { $ip = $this->serverData["REMOTE_ADDR"]; if (!is_string($ip)) { return false; } if (in_array($ip, ['127.0.0.1', 'fe80::1', '::1'], true)) { return true; } // allowed (= local) IPs include ...
[ "private", "function", "isLocalIp", "(", ")", "{", "$", "ip", "=", "$", "this", "->", "serverData", "[", "\"REMOTE_ADDR\"", "]", ";", "if", "(", "!", "is_string", "(", "$", "ip", ")", ")", "{", "return", "false", ";", "}", "if", "(", "in_array", "(...
Returns whether remote IP is a local one @return bool
[ "Returns", "whether", "remote", "IP", "is", "a", "local", "one" ]
f912694c3e3ed46af37fe7ecf08bc503c77a5b41
https://github.com/Becklyn/BecklynSymfonyBase/blob/f912694c3e3ed46af37fe7ecf08bc503c77a5b41/src/LocalAccess.php#L69-L88
240,596
franzip/serp-page-serializer
src/SerpPageSerializer.php
SerpPageSerializer.serialize
public function serialize($serializablePage, $format) { // check if supported serialization format if (!SerpPageSerializerHelper::validFormat($format, self::$supportedFormatSerialization)) throw new \Franzip\SerpPageSerializer\Exceptions\UnsupportedSerializationFormatException('Invalid S...
php
public function serialize($serializablePage, $format) { // check if supported serialization format if (!SerpPageSerializerHelper::validFormat($format, self::$supportedFormatSerialization)) throw new \Franzip\SerpPageSerializer\Exceptions\UnsupportedSerializationFormatException('Invalid S...
[ "public", "function", "serialize", "(", "$", "serializablePage", ",", "$", "format", ")", "{", "// check if supported serialization format", "if", "(", "!", "SerpPageSerializerHelper", "::", "validFormat", "(", "$", "format", ",", "self", "::", "$", "supportedFormat...
Serialize a SerializableSerpPage object in the target format @param SerializableSerpPage $serializablePage @param string $format @return string
[ "Serialize", "a", "SerializableSerpPage", "object", "in", "the", "target", "format" ]
d3b67682e9a5ef87dcd56fb4191a23c4eeebc716
https://github.com/franzip/serp-page-serializer/blob/d3b67682e9a5ef87dcd56fb4191a23c4eeebc716/src/SerpPageSerializer.php#L58-L74
240,597
franzip/serp-page-serializer
src/SerpPageSerializer.php
SerpPageSerializer.deserialize
public function deserialize($serializedPage, $format) { // check if supported deserialization format if (!SerpPageSerializerHelper::validFormat($format, self::$supportedFormatDeserialization)) throw new \Franzip\SerpPageSerializer\Exceptions\UnsupportedDeserializationFormatException('Inv...
php
public function deserialize($serializedPage, $format) { // check if supported deserialization format if (!SerpPageSerializerHelper::validFormat($format, self::$supportedFormatDeserialization)) throw new \Franzip\SerpPageSerializer\Exceptions\UnsupportedDeserializationFormatException('Inv...
[ "public", "function", "deserialize", "(", "$", "serializedPage", ",", "$", "format", ")", "{", "// check if supported deserialization format", "if", "(", "!", "SerpPageSerializerHelper", "::", "validFormat", "(", "$", "format", ",", "self", "::", "$", "supportedForm...
Deserialize a serialized page. YAML deserialization is not currently supported. @param SerializedSerpPage $serializedPage @param string $format @return SerializableSerpPage
[ "Deserialize", "a", "serialized", "page", ".", "YAML", "deserialization", "is", "not", "currently", "supported", "." ]
d3b67682e9a5ef87dcd56fb4191a23c4eeebc716
https://github.com/franzip/serp-page-serializer/blob/d3b67682e9a5ef87dcd56fb4191a23c4eeebc716/src/SerpPageSerializer.php#L83-L95
240,598
franzip/serp-page-serializer
src/SerpPageSerializer.php
SerpPageSerializer.prepareForSerialization
private function prepareForSerialization($serializablePage, $format, $entries) { $engine = $serializablePage->getEngine(); $keyword = $serializablePage->getKeyword(); $pageUrl = $serializablePage->getPageUrl(); $pageNumber = $serializablePage->getPageNumber(); $age ...
php
private function prepareForSerialization($serializablePage, $format, $entries) { $engine = $serializablePage->getEngine(); $keyword = $serializablePage->getKeyword(); $pageUrl = $serializablePage->getPageUrl(); $pageNumber = $serializablePage->getPageNumber(); $age ...
[ "private", "function", "prepareForSerialization", "(", "$", "serializablePage", ",", "$", "format", ",", "$", "entries", ")", "{", "$", "engine", "=", "$", "serializablePage", "->", "getEngine", "(", ")", ";", "$", "keyword", "=", "$", "serializablePage", "-...
Map SerializableSerpPage to an easy serializable SerpPage. The serialization format is resolved at runtime. @param SerializableSerpPage $serializablePage @param string $format @param array $entries @return SerpPageJSON|SerpPageXML|SerpPageYML
[ "Map", "SerializableSerpPage", "to", "an", "easy", "serializable", "SerpPage", ".", "The", "serialization", "format", "is", "resolved", "at", "runtime", "." ]
d3b67682e9a5ef87dcd56fb4191a23c4eeebc716
https://github.com/franzip/serp-page-serializer/blob/d3b67682e9a5ef87dcd56fb4191a23c4eeebc716/src/SerpPageSerializer.php#L114-L123
240,599
franzip/serp-page-serializer
src/SerpPageSerializer.php
SerpPageSerializer.createEntries
private function createEntries($serializablePage, $format) { $result = array(); $entries = $serializablePage->getEntries(); for ($i = 0; $i < count($entries); $i++) { $args = array(($i + 1), $entries[$i]['url'], $entries[$i]['title'], $entries[$i]['snippet']); array_p...
php
private function createEntries($serializablePage, $format) { $result = array(); $entries = $serializablePage->getEntries(); for ($i = 0; $i < count($entries); $i++) { $args = array(($i + 1), $entries[$i]['url'], $entries[$i]['title'], $entries[$i]['snippet']); array_p...
[ "private", "function", "createEntries", "(", "$", "serializablePage", ",", "$", "format", ")", "{", "$", "result", "=", "array", "(", ")", ";", "$", "entries", "=", "$", "serializablePage", "->", "getEntries", "(", ")", ";", "for", "(", "$", "i", "=", ...
Map SerializableSerpPage entries to SerpPageEntries. The serialization format is resolved at runtime. @param SerializableSerpPage $serializablePage @param string $format @return SerpPageEntryJSON|SerpPageEntryXML|SerpPageEntryYAML
[ "Map", "SerializableSerpPage", "entries", "to", "SerpPageEntries", ".", "The", "serialization", "format", "is", "resolved", "at", "runtime", "." ]
d3b67682e9a5ef87dcd56fb4191a23c4eeebc716
https://github.com/franzip/serp-page-serializer/blob/d3b67682e9a5ef87dcd56fb4191a23c4eeebc716/src/SerpPageSerializer.php#L132-L141