repository_name
stringlengths
5
67
func_path_in_repository
stringlengths
4
234
func_name
stringlengths
0
314
whole_func_string
stringlengths
52
3.87M
language
stringclasses
6 values
func_code_string
stringlengths
52
3.87M
func_code_tokens
listlengths
15
672k
func_documentation_string
stringlengths
1
47.2k
func_documentation_tokens
listlengths
1
3.92k
split_name
stringclasses
1 value
func_code_url
stringlengths
85
339
limen/php-jobs
src/Contracts/BaseJobset.php
BaseJobset.execute
public function execute() { // If the jobset is finished or failed // the jobset may need to be dispatched // so we return true if ($this->isFinished() || $this->isFailed()) { return true; } // Just return false to tell to terminate the process if ...
php
public function execute() { // If the jobset is finished or failed // the jobset may need to be dispatched // so we return true if ($this->isFinished() || $this->isFailed()) { return true; } // Just return false to tell to terminate the process if ...
[ "public", "function", "execute", "(", ")", "{", "// If the jobset is finished or failed", "// the jobset may need to be dispatched", "// so we return true", "if", "(", "$", "this", "->", "isFinished", "(", ")", "||", "$", "this", "->", "isFailed", "(", ")", ")", "{"...
If return true, the jobset should be dispatched with considering its status Or the jobset process should be terminated @return bool @throws \Exception
[ "If", "return", "true", "the", "jobset", "should", "be", "dispatched", "with", "considering", "its", "status", "Or", "the", "jobset", "process", "should", "be", "terminated" ]
train
https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Contracts/BaseJobset.php#L206-L244
limen/php-jobs
src/Contracts/BaseJobset.php
BaseJobset.dispatched
public function dispatched() { // Only finished or failed jobset should be dispatched if ($this->isFinished() || $this->isFailed()) { $status = $this->isFinished() ? JobsConst::JOB_SET_STATUS_FINISHED_AND_DISPATCHED : JobsConst::JOB_SET_STATUS_FAILED_AND_DISPATCHED; ...
php
public function dispatched() { // Only finished or failed jobset should be dispatched if ($this->isFinished() || $this->isFailed()) { $status = $this->isFinished() ? JobsConst::JOB_SET_STATUS_FINISHED_AND_DISPATCHED : JobsConst::JOB_SET_STATUS_FAILED_AND_DISPATCHED; ...
[ "public", "function", "dispatched", "(", ")", "{", "// Only finished or failed jobset should be dispatched", "if", "(", "$", "this", "->", "isFinished", "(", ")", "||", "$", "this", "->", "isFailed", "(", ")", ")", "{", "$", "status", "=", "$", "this", "->",...
After successfully notice to commander, we mark the jobset as dispatched here.
[ "After", "successfully", "notice", "to", "commander", "we", "mark", "the", "jobset", "as", "dispatched", "here", "." ]
train
https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Contracts/BaseJobset.php#L309-L320
limen/php-jobs
src/Contracts/BaseJobset.php
BaseJobset.getJobsetExecutionStatus
public function getJobsetExecutionStatus() { $finished = count($this->jobs) > 0 ? true : false; $failed = false; $middle = false; foreach ($this->jobs as $job) { if ($job->isFailed()) { $finished = false; $middle = false; $...
php
public function getJobsetExecutionStatus() { $finished = count($this->jobs) > 0 ? true : false; $failed = false; $middle = false; foreach ($this->jobs as $job) { if ($job->isFailed()) { $finished = false; $middle = false; $...
[ "public", "function", "getJobsetExecutionStatus", "(", ")", "{", "$", "finished", "=", "count", "(", "$", "this", "->", "jobs", ")", ">", "0", "?", "true", ":", "false", ";", "$", "failed", "=", "false", ";", "$", "middle", "=", "false", ";", "foreac...
Get jobset execution status from sub jobs statuses. At least one job failed, the jobset is failed. All jobs finished, the jobset is finished. At least one job has been executed, the jobset is ongoing. All jobs have not been executed, the jobset is in default status. @return int
[ "Get", "jobset", "execution", "status", "from", "sub", "jobs", "statuses", ".", "At", "least", "one", "job", "failed", "the", "jobset", "is", "failed", ".", "All", "jobs", "finished", "the", "jobset", "is", "finished", ".", "At", "least", "one", "job", "...
train
https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Contracts/BaseJobset.php#L341-L369
limen/php-jobs
src/Contracts/BaseJobset.php
BaseJobset.doOrderedJobs
protected function doOrderedJobs() { $jobNames = $this->getOrderedJobNames(); foreach ($jobNames as $jobName) { $job = $this->getLocalJob($jobName); if (!$job) { throw new \Exception("job [$jobName] not exists"); } $job->execute(); ...
php
protected function doOrderedJobs() { $jobNames = $this->getOrderedJobNames(); foreach ($jobNames as $jobName) { $job = $this->getLocalJob($jobName); if (!$job) { throw new \Exception("job [$jobName] not exists"); } $job->execute(); ...
[ "protected", "function", "doOrderedJobs", "(", ")", "{", "$", "jobNames", "=", "$", "this", "->", "getOrderedJobNames", "(", ")", ";", "foreach", "(", "$", "jobNames", "as", "$", "jobName", ")", "{", "$", "job", "=", "$", "this", "->", "getLocalJob", "...
Do ordered jobs
[ "Do", "ordered", "jobs" ]
train
https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Contracts/BaseJobset.php#L374-L388
limen/php-jobs
src/Contracts/BaseJobset.php
BaseJobset.doUnorderedJobs
protected function doUnorderedJobs() { $jobNames = $this->getUnorderedJobNames(); foreach ($jobNames as $jobName) { $job = $this->getLocalJob($jobName); if (!$job) { throw new \Exception("job [$jobName] not exists"); } $job->execute();...
php
protected function doUnorderedJobs() { $jobNames = $this->getUnorderedJobNames(); foreach ($jobNames as $jobName) { $job = $this->getLocalJob($jobName); if (!$job) { throw new \Exception("job [$jobName] not exists"); } $job->execute();...
[ "protected", "function", "doUnorderedJobs", "(", ")", "{", "$", "jobNames", "=", "$", "this", "->", "getUnorderedJobNames", "(", ")", ";", "foreach", "(", "$", "jobNames", "as", "$", "jobName", ")", "{", "$", "job", "=", "$", "this", "->", "getLocalJob",...
Do unordered jobs
[ "Do", "unordered", "jobs" ]
train
https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Contracts/BaseJobset.php#L393-L405
limen/php-jobs
src/Contracts/BaseJobset.php
BaseJobset.getJobsEarliestTryAt
protected function getJobsEarliestTryAt() { $tryAt = date('Y-m-d H:i:s'); foreach ($this->jobs as $job) { if (!$job->isFinished() && Helper::datetimeLT($job->getTryAt(), $tryAt)) { $tryAt = $job->getTryAt(); } } return $tryAt; }
php
protected function getJobsEarliestTryAt() { $tryAt = date('Y-m-d H:i:s'); foreach ($this->jobs as $job) { if (!$job->isFinished() && Helper::datetimeLT($job->getTryAt(), $tryAt)) { $tryAt = $job->getTryAt(); } } return $tryAt; }
[ "protected", "function", "getJobsEarliestTryAt", "(", ")", "{", "$", "tryAt", "=", "date", "(", "'Y-m-d H:i:s'", ")", ";", "foreach", "(", "$", "this", "->", "jobs", "as", "$", "job", ")", "{", "if", "(", "!", "$", "job", "->", "isFinished", "(", ")"...
get the earliest job try at time, except the finished jobs @return false|mixed|string
[ "get", "the", "earliest", "job", "try", "at", "time", "except", "the", "finished", "jobs" ]
train
https://github.com/limen/php-jobs/blob/525f4082b49a7a3e69acb4cea3a622244f1616b9/src/Contracts/BaseJobset.php#L412-L423
seeruo/framework
src/Command/BuildCommand.php
BuildCommand.execute
protected function execute(InputInterface $input, OutputInterface $output) { try { $output->writeln([ 'Start Building...', '<bg=yellow;>=================================</>', ]); $build = new BuildService(); $active = $input->...
php
protected function execute(InputInterface $input, OutputInterface $output) { try { $output->writeln([ 'Start Building...', '<bg=yellow;>=================================</>', ]); $build = new BuildService(); $active = $input->...
[ "protected", "function", "execute", "(", "InputInterface", "$", "input", ",", "OutputInterface", "$", "output", ")", "{", "try", "{", "$", "output", "->", "writeln", "(", "[", "'Start Building...'", ",", "'<bg=yellow;>=================================</>'", ",", "]"...
[执行命令] @DateTime 2018-12-13 @param InputInterface $input 输入对象 @param OutputInterface $output 输出对象
[ "[", "执行命令", "]" ]
train
https://github.com/seeruo/framework/blob/689c6e95bc95fe2ae037e056d8228820dd08d7e9/src/Command/BuildCommand.php#L43-L66
traderinteractive/util-string-php
src/Strings.php
Strings.format
public static function format(string $format, string ...$arguments) : string { foreach ($arguments as $key => $value) { $format = str_replace("{{$key}}", (string)$value, $format); } return $format; }
php
public static function format(string $format, string ...$arguments) : string { foreach ($arguments as $key => $value) { $format = str_replace("{{$key}}", (string)$value, $format); } return $format; }
[ "public", "static", "function", "format", "(", "string", "$", "format", ",", "string", "...", "$", "arguments", ")", ":", "string", "{", "foreach", "(", "$", "arguments", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "format", "=", "str_replace"...
Replaces the format items in a specified string with the string representation of n specified objects. @param string $format A composit format string @param mixed $arguments Variable number of items to format. @return string Returns a copy of format in which the format items have been replaced by the string represen...
[ "Replaces", "the", "format", "items", "in", "a", "specified", "string", "with", "the", "string", "representation", "of", "n", "specified", "objects", "." ]
train
https://github.com/traderinteractive/util-string-php/blob/5c05605fd836f3a2822065d474e814c8644857b8/src/Strings.php#L22-L29
traderinteractive/util-string-php
src/Strings.php
Strings.endsWith
public static function endsWith(string $string, string $suffix, &$nonSuffix = null) : bool { $suffixLength = strlen($suffix); if ($suffixLength === 0) { $nonSuffix = $string; return true; } if (empty($string)) { $nonSuffix = ''; retur...
php
public static function endsWith(string $string, string $suffix, &$nonSuffix = null) : bool { $suffixLength = strlen($suffix); if ($suffixLength === 0) { $nonSuffix = $string; return true; } if (empty($string)) { $nonSuffix = ''; retur...
[ "public", "static", "function", "endsWith", "(", "string", "$", "string", ",", "string", "$", "suffix", ",", "&", "$", "nonSuffix", "=", "null", ")", ":", "bool", "{", "$", "suffixLength", "=", "strlen", "(", "$", "suffix", ")", ";", "if", "(", "$", ...
Checks if $string ends with $suffix and puts the rest of the $string in $nonSuffix. @param string $string The string to check @param string $suffix The suffix to check for @param mixed &$nonSuffix This is the part of the string that is not the suffix. @return bool whether the $string ended with $suffix or not.
[ "Checks", "if", "$string", "ends", "with", "$suffix", "and", "puts", "the", "rest", "of", "the", "$string", "in", "$nonSuffix", "." ]
train
https://github.com/traderinteractive/util-string-php/blob/5c05605fd836f3a2822065d474e814c8644857b8/src/Strings.php#L40-L61
traderinteractive/util-string-php
src/Strings.php
Strings.ellipsize
public static function ellipsize(string $string, int $maxLength, string $suffix = '...') : string { if ($maxLength < 0) { throw new \InvalidArgumentException('$maxLength is negative'); } if (strlen($string) <= $maxLength) { return $string; } $trimmed...
php
public static function ellipsize(string $string, int $maxLength, string $suffix = '...') : string { if ($maxLength < 0) { throw new \InvalidArgumentException('$maxLength is negative'); } if (strlen($string) <= $maxLength) { return $string; } $trimmed...
[ "public", "static", "function", "ellipsize", "(", "string", "$", "string", ",", "int", "$", "maxLength", ",", "string", "$", "suffix", "=", "'...'", ")", ":", "string", "{", "if", "(", "$", "maxLength", "<", "0", ")", "{", "throw", "new", "\\", "Inva...
Truncates the string to the given length, with an ellipsis at the end. @param string $string The string to shorten. @param int $maxLength The length to truncate the string to. The result will not be longer than this, but may be shorter. @param string $suffix The string to append when truncating. Typically this will ...
[ "Truncates", "the", "string", "to", "the", "given", "length", "with", "an", "ellipsis", "at", "the", "end", "." ]
train
https://github.com/traderinteractive/util-string-php/blob/5c05605fd836f3a2822065d474e814c8644857b8/src/Strings.php#L75-L93
trafficgate/shell-command
src/ShellOption.php
ShellOption.enable
public function enable($enable = true) { if (! is_bool($enable)) { throw new InvalidArgumentException("enable must be a boolean. [$enable] given."); } $this->enabled = $enable; return $this; }
php
public function enable($enable = true) { if (! is_bool($enable)) { throw new InvalidArgumentException("enable must be a boolean. [$enable] given."); } $this->enabled = $enable; return $this; }
[ "public", "function", "enable", "(", "$", "enable", "=", "true", ")", "{", "if", "(", "!", "is_bool", "(", "$", "enable", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"enable must be a boolean. [$enable] given.\"", ")", ";", "}", "$", "t...
Enable the option. @param bool|true $enable @throws InvalidArgumentException @return $this
[ "Enable", "the", "option", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L100-L109
trafficgate/shell-command
src/ShellOption.php
ShellOption.hasValue
public function hasValue($value) { $index = array_search($value, $this->values); if ($index === false) { return false; } return true; }
php
public function hasValue($value) { $index = array_search($value, $this->values); if ($index === false) { return false; } return true; }
[ "public", "function", "hasValue", "(", "$", "value", ")", "{", "$", "index", "=", "array_search", "(", "$", "value", ",", "$", "this", "->", "values", ")", ";", "if", "(", "$", "index", "===", "false", ")", "{", "return", "false", ";", "}", "return...
Return whether this option has the given value or not. @param mixed $value @return bool
[ "Return", "whether", "this", "option", "has", "the", "given", "value", "or", "not", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L150-L159
trafficgate/shell-command
src/ShellOption.php
ShellOption.addValue
public function addValue($value) { $this->assertCanHaveValue(); $this->assertValueIsValid($value); if ($this->canHaveMultipleValues() && ! $this->hasValue($value)) { $value = array_merge($this->values, (array) $value); } $this->values = (array) $value; ...
php
public function addValue($value) { $this->assertCanHaveValue(); $this->assertValueIsValid($value); if ($this->canHaveMultipleValues() && ! $this->hasValue($value)) { $value = array_merge($this->values, (array) $value); } $this->values = (array) $value; ...
[ "public", "function", "addValue", "(", "$", "value", ")", "{", "$", "this", "->", "assertCanHaveValue", "(", ")", ";", "$", "this", "->", "assertValueIsValid", "(", "$", "value", ")", ";", "if", "(", "$", "this", "->", "canHaveMultipleValues", "(", ")", ...
Add a new value to this option. @param int|string $value @return $this
[ "Add", "a", "new", "value", "to", "this", "option", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L178-L190
trafficgate/shell-command
src/ShellOption.php
ShellOption.addValues
public function addValues(array $values = []) { $this->assertCanHaveMultipleValues(); foreach ($values as $value) { $this->addValue($value); } return $this; }
php
public function addValues(array $values = []) { $this->assertCanHaveMultipleValues(); foreach ($values as $value) { $this->addValue($value); } return $this; }
[ "public", "function", "addValues", "(", "array", "$", "values", "=", "[", "]", ")", "{", "$", "this", "->", "assertCanHaveMultipleValues", "(", ")", ";", "foreach", "(", "$", "values", "as", "$", "value", ")", "{", "$", "this", "->", "addValue", "(", ...
Add multiple values to this option. @param array $values @return $this
[ "Add", "multiple", "values", "to", "this", "option", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L199-L208
trafficgate/shell-command
src/ShellOption.php
ShellOption.removeValue
public function removeValue($value) { if (! $this->canHaveMultipleValues() && ! isset($value)) { $this->values = []; $this->enable($enable = false); return $this; } $this->assertValueIsValid($value); $this->assertCanHaveValue(); if ($thi...
php
public function removeValue($value) { if (! $this->canHaveMultipleValues() && ! isset($value)) { $this->values = []; $this->enable($enable = false); return $this; } $this->assertValueIsValid($value); $this->assertCanHaveValue(); if ($thi...
[ "public", "function", "removeValue", "(", "$", "value", ")", "{", "if", "(", "!", "$", "this", "->", "canHaveMultipleValues", "(", ")", "&&", "!", "isset", "(", "$", "value", ")", ")", "{", "$", "this", "->", "values", "=", "[", "]", ";", "$", "t...
Remove the given value from the option. @param int|string $value @return $this
[ "Remove", "the", "given", "value", "from", "the", "option", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L217-L236
trafficgate/shell-command
src/ShellOption.php
ShellOption.removeValues
public function removeValues(array $values = []) { $this->assertCanHaveMultipleValues(); foreach ($values as $value) { $this->removeValue($value); } return $this; }
php
public function removeValues(array $values = []) { $this->assertCanHaveMultipleValues(); foreach ($values as $value) { $this->removeValue($value); } return $this; }
[ "public", "function", "removeValues", "(", "array", "$", "values", "=", "[", "]", ")", "{", "$", "this", "->", "assertCanHaveMultipleValues", "(", ")", ";", "foreach", "(", "$", "values", "as", "$", "value", ")", "{", "$", "this", "->", "removeValue", ...
Remove the given values from the option. @param array $values @return $this
[ "Remove", "the", "given", "values", "from", "the", "option", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L245-L254
trafficgate/shell-command
src/ShellOption.php
ShellOption.getArray
public function getArray() { $options = []; if ($this->isDisabled() || $this->canHaveValue() && empty($this->values)) { return $options; } foreach ($this->values as $value) { $options[] = $this->flag(); $options[] = $value; } if ...
php
public function getArray() { $options = []; if ($this->isDisabled() || $this->canHaveValue() && empty($this->values)) { return $options; } foreach ($this->values as $value) { $options[] = $this->flag(); $options[] = $value; } if ...
[ "public", "function", "getArray", "(", ")", "{", "$", "options", "=", "[", "]", ";", "if", "(", "$", "this", "->", "isDisabled", "(", ")", "||", "$", "this", "->", "canHaveValue", "(", ")", "&&", "empty", "(", "$", "this", "->", "values", ")", ")...
Get the option and its values as an array. @return array
[ "Get", "the", "option", "and", "its", "values", "as", "an", "array", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L261-L279
trafficgate/shell-command
src/ShellOption.php
ShellOption.parseFlag
private function parseFlag($flag) { $flag = trim($flag); $pattern = '/^'.// Match start of string '('.// Start Group '(?<flag>(?:-\w|--\w[\w-]+))'.// Match Group <flag> '(?<enable>\+)?'.//Enable option by default (useful for creating special commands) ...
php
private function parseFlag($flag) { $flag = trim($flag); $pattern = '/^'.// Match start of string '('.// Start Group '(?<flag>(?:-\w|--\w[\w-]+))'.// Match Group <flag> '(?<enable>\+)?'.//Enable option by default (useful for creating special commands) ...
[ "private", "function", "parseFlag", "(", "$", "flag", ")", "{", "$", "flag", "=", "trim", "(", "$", "flag", ")", ";", "$", "pattern", "=", "'/^'", ".", "// Match start of string", "'('", ".", "// Start Group", "'(?<flag>(?:-\\w|--\\w[\\w-]+))'", ".", "// Match...
Parse a given flag. The flag should be in one of the following formats: - "-v" - "--verbose" - "-a=" - "--address=" - "-a=*" - "--address=*" @param string $flag @return array
[ "Parse", "a", "given", "flag", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L296-L370
trafficgate/shell-command
src/ShellOption.php
ShellOption.setDescription
private function setDescription($description = null) { if (isset($description) && ! is_string($description)) { throw new InvalidArgumentException("Description must be a string. [$description] given."); } $this->description = $description; }
php
private function setDescription($description = null) { if (isset($description) && ! is_string($description)) { throw new InvalidArgumentException("Description must be a string. [$description] given."); } $this->description = $description; }
[ "private", "function", "setDescription", "(", "$", "description", "=", "null", ")", "{", "if", "(", "isset", "(", "$", "description", ")", "&&", "!", "is_string", "(", "$", "description", ")", ")", "{", "throw", "new", "InvalidArgumentException", "(", "\"D...
Set the description. @param string|null $description @throws InvalidArgumentException
[ "Set", "the", "description", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L439-L446
trafficgate/shell-command
src/ShellOption.php
ShellOption.setValues
private function setValues($values) { if (! empty($values)) { if ($this->canHaveMultipleValues()) { $this->addValues($values); } elseif ($this->canHaveValue()) { $this->addValue($values); } } return $this; }
php
private function setValues($values) { if (! empty($values)) { if ($this->canHaveMultipleValues()) { $this->addValues($values); } elseif ($this->canHaveValue()) { $this->addValue($values); } } return $this; }
[ "private", "function", "setValues", "(", "$", "values", ")", "{", "if", "(", "!", "empty", "(", "$", "values", ")", ")", "{", "if", "(", "$", "this", "->", "canHaveMultipleValues", "(", ")", ")", "{", "$", "this", "->", "addValues", "(", "$", "valu...
Set the values for this option. @param array $values @return $this
[ "Set", "the", "values", "for", "this", "option", "." ]
train
https://github.com/trafficgate/shell-command/blob/1a5f3fcf689f33098b192c34839effe309202c0e/src/ShellOption.php#L455-L466
webtorque7/link-field
code/WTTreeDropdownField.php
WTTreeDropdownField.Link
public function Link($action = null) { $name = $this->name; if (($pos = stripos($name, '[')) !== false) { $name = substr($name, 0, $pos); $action = substr($this->name, $pos + 1, strlen($this->name) - 1 - ($pos + 1)) . 'Tree'; ...
php
public function Link($action = null) { $name = $this->name; if (($pos = stripos($name, '[')) !== false) { $name = substr($name, 0, $pos); $action = substr($this->name, $pos + 1, strlen($this->name) - 1 - ($pos + 1)) . 'Tree'; ...
[ "public", "function", "Link", "(", "$", "action", "=", "null", ")", "{", "$", "name", "=", "$", "this", "->", "name", ";", "if", "(", "(", "$", "pos", "=", "stripos", "(", "$", "name", ",", "'['", ")", ")", "!==", "false", ")", "{", "$", "nam...
Return a Link to this field
[ "Return", "a", "Link", "to", "this", "field" ]
train
https://github.com/webtorque7/link-field/blob/b846644e1d35676419e71f3127cfc8f150aff081/code/WTTreeDropdownField.php#L8-L18
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setupColumnArrays
private function setupColumnArrays() { /* Example: SELECT partial fos_user.{id}, partial posts_comments.{title,id}, partial posts.{id,title} FROM AppBundle\Entity\User fos_user LEFT JOIN ...
php
private function setupColumnArrays() { /* Example: SELECT partial fos_user.{id}, partial posts_comments.{title,id}, partial posts.{id,title} FROM AppBundle\Entity\User fos_user LEFT JOIN ...
[ "private", "function", "setupColumnArrays", "(", ")", "{", "/* Example:\n SELECT\n partial fos_user.{id},\n partial posts_comments.{title,id},\n partial posts.{id,title}\n FROM\n AppBundle\\Entity\\User fos_use...
Setup column arrays. @return $this
[ "Setup", "column", "arrays", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L228-L324
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.buildQuery
public function buildQuery() { $this->setSelectFrom(); $this->setLeftJoins($this->qb); $this->setWhere($this->qb); $this->setWhereResultCallback($this->qb); $this->setWhereAllCallback($this->qb); $this->setOrderBy(); $this->setLimit(); return $this; ...
php
public function buildQuery() { $this->setSelectFrom(); $this->setLeftJoins($this->qb); $this->setWhere($this->qb); $this->setWhereResultCallback($this->qb); $this->setWhereAllCallback($this->qb); $this->setOrderBy(); $this->setLimit(); return $this; ...
[ "public", "function", "buildQuery", "(", ")", "{", "$", "this", "->", "setSelectFrom", "(", ")", ";", "$", "this", "->", "setLeftJoins", "(", "$", "this", "->", "qb", ")", ";", "$", "this", "->", "setWhere", "(", "$", "this", "->", "qb", ")", ";", ...
Build query. @return $this
[ "Build", "query", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L331-L342
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setWhereResultCallback
private function setWhereResultCallback(QueryBuilder $qb) { if (!empty($this->callbacks['WhereResult'])) { foreach ($this->callbacks['WhereResult'] as $callback) { $callback($qb); } } return $this; }
php
private function setWhereResultCallback(QueryBuilder $qb) { if (!empty($this->callbacks['WhereResult'])) { foreach ($this->callbacks['WhereResult'] as $callback) { $callback($qb); } } return $this; }
[ "private", "function", "setWhereResultCallback", "(", "QueryBuilder", "$", "qb", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "callbacks", "[", "'WhereResult'", "]", ")", ")", "{", "foreach", "(", "$", "this", "->", "callbacks", "[", "'Wher...
Set where result callback. @param QueryBuilder $qb @return $this
[ "Set", "where", "result", "callback", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L419-L428
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setWhereAllCallback
private function setWhereAllCallback(QueryBuilder $qb) { if (!empty($this->callbacks['WhereAll'])) { foreach ($this->callbacks['WhereAll'] as $callback) { $callback($qb); } } return $this; }
php
private function setWhereAllCallback(QueryBuilder $qb) { if (!empty($this->callbacks['WhereAll'])) { foreach ($this->callbacks['WhereAll'] as $callback) { $callback($qb); } } return $this; }
[ "private", "function", "setWhereAllCallback", "(", "QueryBuilder", "$", "qb", ")", "{", "if", "(", "!", "empty", "(", "$", "this", "->", "callbacks", "[", "'WhereAll'", "]", ")", ")", "{", "foreach", "(", "$", "this", "->", "callbacks", "[", "'WhereAll'"...
Set where all callback. @param QueryBuilder $qb @return $this
[ "Set", "where", "all", "callback", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L437-L446
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setSelectFrom
private function setSelectFrom() { foreach ($this->selectColumns as $key => $value) { $this->qb->addSelect($key); } $this->qb->from($this->entity, $this->tableName); return $this; }
php
private function setSelectFrom() { foreach ($this->selectColumns as $key => $value) { $this->qb->addSelect($key); } $this->qb->from($this->entity, $this->tableName); return $this; }
[ "private", "function", "setSelectFrom", "(", ")", "{", "foreach", "(", "$", "this", "->", "selectColumns", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "this", "->", "qb", "->", "addSelect", "(", "$", "key", ")", ";", "}", "$", "this", "->"...
Set select from. @return $this
[ "Set", "select", "from", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L457-L466
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setLeftJoins
private function setLeftJoins(QueryBuilder $qb) { foreach ($this->joins as $key => $value) { $qb->leftJoin($key, $value); } return $this; }
php
private function setLeftJoins(QueryBuilder $qb) { foreach ($this->joins as $key => $value) { $qb->leftJoin($key, $value); } return $this; }
[ "private", "function", "setLeftJoins", "(", "QueryBuilder", "$", "qb", ")", "{", "foreach", "(", "$", "this", "->", "joins", "as", "$", "key", "=>", "$", "value", ")", "{", "$", "qb", "->", "leftJoin", "(", "$", "key", ",", "$", "value", ")", ";", ...
Set leftJoins. @param QueryBuilder $qb @return $this
[ "Set", "leftJoins", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L475-L482
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setWhere
private function setWhere(QueryBuilder $qb) { $globalSearch = $this->requestParams['search']['value']; // global filtering if ('' != $globalSearch) { $orExpr = $qb->expr()->orX(); foreach ($this->columns as $key => $column) { if (true === $this->isSe...
php
private function setWhere(QueryBuilder $qb) { $globalSearch = $this->requestParams['search']['value']; // global filtering if ('' != $globalSearch) { $orExpr = $qb->expr()->orX(); foreach ($this->columns as $key => $column) { if (true === $this->isSe...
[ "private", "function", "setWhere", "(", "QueryBuilder", "$", "qb", ")", "{", "$", "globalSearch", "=", "$", "this", "->", "requestParams", "[", "'search'", "]", "[", "'value'", "]", ";", "// global filtering", "if", "(", "''", "!=", "$", "globalSearch", ")...
Searching / Filtering. Construct the WHERE clause for server-side processing SQL query. @param QueryBuilder $qb @return $this
[ "Searching", "/", "Filtering", ".", "Construct", "the", "WHERE", "clause", "for", "server", "-", "side", "processing", "SQL", "query", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L492-L549
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.addCondition
private function addCondition(Andx $andExpr, QueryBuilder $pivot, $searchType, $searchField, $searchValue, $i) { switch ($searchType) { case 'like': $andExpr->add($pivot->expr()->like($searchField, '?'.$i)); $pivot->setParameter($i, '%'.$searchValue.'%'); ...
php
private function addCondition(Andx $andExpr, QueryBuilder $pivot, $searchType, $searchField, $searchValue, $i) { switch ($searchType) { case 'like': $andExpr->add($pivot->expr()->like($searchField, '?'.$i)); $pivot->setParameter($i, '%'.$searchValue.'%'); ...
[ "private", "function", "addCondition", "(", "Andx", "$", "andExpr", ",", "QueryBuilder", "$", "pivot", ",", "$", "searchType", ",", "$", "searchField", ",", "$", "searchValue", ",", "$", "i", ")", "{", "switch", "(", "$", "searchType", ")", "{", "case", ...
Add a condition. @param Andx $andExpr @param QueryBuilder $pivot @param string $searchType @param string $searchField @param string $searchValue @param int $i @return Andx
[ "Add", "a", "condition", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L563-L615
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setOrderBy
private function setOrderBy() { if (isset($this->requestParams['order']) && count($this->requestParams['order'])) { $counter = count($this->requestParams['order']); for ($i = 0; $i < $counter; ++$i) { $columnIdx = (integer) $this->requestParams['order'][$i]['column']...
php
private function setOrderBy() { if (isset($this->requestParams['order']) && count($this->requestParams['order'])) { $counter = count($this->requestParams['order']); for ($i = 0; $i < $counter; ++$i) { $columnIdx = (integer) $this->requestParams['order'][$i]['column']...
[ "private", "function", "setOrderBy", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "requestParams", "[", "'order'", "]", ")", "&&", "count", "(", "$", "this", "->", "requestParams", "[", "'order'", "]", ")", ")", "{", "$", "counter", "="...
Ordering. Construct the ORDER BY clause for server-side processing SQL query. @return $this
[ "Ordering", ".", "Construct", "the", "ORDER", "BY", "clause", "for", "server", "-", "side", "processing", "SQL", "query", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L623-L642
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setLimit
private function setLimit() { if (isset($this->requestParams['start']) && -1 != $this->requestParams['length']) { $this->qb->setFirstResult($this->requestParams['start'])->setMaxResults($this->requestParams['length']); } return $this; }
php
private function setLimit() { if (isset($this->requestParams['start']) && -1 != $this->requestParams['length']) { $this->qb->setFirstResult($this->requestParams['start'])->setMaxResults($this->requestParams['length']); } return $this; }
[ "private", "function", "setLimit", "(", ")", "{", "if", "(", "isset", "(", "$", "this", "->", "requestParams", "[", "'start'", "]", ")", "&&", "-", "1", "!=", "$", "this", "->", "requestParams", "[", "'length'", "]", ")", "{", "$", "this", "->", "q...
Paging. Construct the LIMIT clause for server-side processing SQL query. @return $this
[ "Paging", ".", "Construct", "the", "LIMIT", "clause", "for", "server", "-", "side", "processing", "SQL", "query", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L650-L657
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.getCountAllResults
private function getCountAllResults($rootEntityIdentifier) { $qb = $this->em->createQueryBuilder(); $qb->select('count(distinct '.$this->tableName.'.'.$rootEntityIdentifier.')'); $qb->from($this->entity, $this->tableName); $this->setLeftJoins($qb); $this->setWhereAllCallback...
php
private function getCountAllResults($rootEntityIdentifier) { $qb = $this->em->createQueryBuilder(); $qb->select('count(distinct '.$this->tableName.'.'.$rootEntityIdentifier.')'); $qb->from($this->entity, $this->tableName); $this->setLeftJoins($qb); $this->setWhereAllCallback...
[ "private", "function", "getCountAllResults", "(", "$", "rootEntityIdentifier", ")", "{", "$", "qb", "=", "$", "this", "->", "em", "->", "createQueryBuilder", "(", ")", ";", "$", "qb", "->", "select", "(", "'count(distinct '", ".", "$", "this", "->", "table...
Query results before filtering. @param int $rootEntityIdentifier @return int
[ "Query", "results", "before", "filtering", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L670-L680
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.execute
private function execute() { $query = $this->qb->getQuery(); if (true === $this->configs['translation_query_hints']) { if (true === $this->doctrineExtensions) { $query->setHint( \Doctrine\ORM\Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedm...
php
private function execute() { $query = $this->qb->getQuery(); if (true === $this->configs['translation_query_hints']) { if (true === $this->doctrineExtensions) { $query->setHint( \Doctrine\ORM\Query::HINT_CUSTOM_OUTPUT_WALKER, 'Gedm...
[ "private", "function", "execute", "(", ")", "{", "$", "query", "=", "$", "this", "->", "qb", "->", "getQuery", "(", ")", ";", "if", "(", "true", "===", "$", "this", "->", "configs", "[", "'translation_query_hints'", "]", ")", "{", "if", "(", "true", ...
Constructs a Query instance. @return Query @throws \Exception
[ "Constructs", "a", "Query", "instance", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L709-L737
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.entityFieldToArray
private function entityFieldToArray(array $data, $entity, $path) { $parts = explode('.', $path, 2); if (count($parts) === 1) { if ($entity instanceof \Traversable) { $data = []; foreach ($entity as $item) { $id = $this->em->getClassMe...
php
private function entityFieldToArray(array $data, $entity, $path) { $parts = explode('.', $path, 2); if (count($parts) === 1) { if ($entity instanceof \Traversable) { $data = []; foreach ($entity as $item) { $id = $this->em->getClassMe...
[ "private", "function", "entityFieldToArray", "(", "array", "$", "data", ",", "$", "entity", ",", "$", "path", ")", "{", "$", "parts", "=", "explode", "(", "'.'", ",", "$", "path", ",", "2", ")", ";", "if", "(", "count", "(", "$", "parts", ")", "=...
Normalizes an entity path into an array. Each entity of each level will have its id set. All values are retrieved using a property accessor with magic call activated. @param array $data @param object $entity Entity to normalize @param string $path Path to set in the array @return array Normalized data
[ "Normalizes", "an", "entity", "path", "into", "an", "array", ".", "Each", "entity", "of", "each", "level", "will", "have", "its", "id", "set", ".", "All", "values", "are", "retrieved", "using", "a", "property", "accessor", "with", "magic", "call", "activat...
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L754-L790
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.addSearchOrderColumn
private function addSearchOrderColumn($key, $columnTableName, $data) { $column = $this->columns[$key]; true === $column->getOrderable() ? $this->orderColumns[] = $columnTableName.'.'.$data : $this->orderColumns[] = null; true === $column->getSearchable() ? $this->searchColumns[] = $columnTa...
php
private function addSearchOrderColumn($key, $columnTableName, $data) { $column = $this->columns[$key]; true === $column->getOrderable() ? $this->orderColumns[] = $columnTableName.'.'.$data : $this->orderColumns[] = null; true === $column->getSearchable() ? $this->searchColumns[] = $columnTa...
[ "private", "function", "addSearchOrderColumn", "(", "$", "key", ",", "$", "columnTableName", ",", "$", "data", ")", "{", "$", "column", "=", "$", "this", "->", "columns", "[", "$", "key", "]", ";", "true", "===", "$", "column", "->", "getOrderable", "(...
Add search/order columns. @param int $key @param string $columnTableName @param string $data
[ "Add", "search", "/", "order", "columns", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L889-L895
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.getMetadata
private function getMetadata($entity) { try { $metadata = $this->em->getMetadataFactory()->getMetadataFor($entity); } catch (MappingException $e) { throw new \Exception('getMetadata(): Given object '.$entity.' is not a Doctrine Entity.'); } return $metadata; ...
php
private function getMetadata($entity) { try { $metadata = $this->em->getMetadataFactory()->getMetadataFor($entity); } catch (MappingException $e) { throw new \Exception('getMetadata(): Given object '.$entity.' is not a Doctrine Entity.'); } return $metadata; ...
[ "private", "function", "getMetadata", "(", "$", "entity", ")", "{", "try", "{", "$", "metadata", "=", "$", "this", "->", "em", "->", "getMetadataFactory", "(", ")", "->", "getMetadataFor", "(", "$", "entity", ")", ";", "}", "catch", "(", "MappingExceptio...
Get metadata. @param string $entity @return ClassMetadata @throws \Exception
[ "Get", "metadata", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L906-L915
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.setIdentifierFromAssociation
private function setIdentifierFromAssociation($association, $key = '', $i = 0, $metadata = null) { if (null === $metadata) { $metadata = $this->metadata; } if (is_string($association)) { $targetEntityClass = $metadata->getAssociationTargetClass($association); ...
php
private function setIdentifierFromAssociation($association, $key = '', $i = 0, $metadata = null) { if (null === $metadata) { $metadata = $this->metadata; } if (is_string($association)) { $targetEntityClass = $metadata->getAssociationTargetClass($association); ...
[ "private", "function", "setIdentifierFromAssociation", "(", "$", "association", ",", "$", "key", "=", "''", ",", "$", "i", "=", "0", ",", "$", "metadata", "=", "null", ")", "{", "if", "(", "null", "===", "$", "metadata", ")", "{", "$", "metadata", "=...
Set identifier from association. @param string|array $association @param string $key @param int $i @param ClassMetadata|null $metadata @return $this @throws \Exception
[ "Set", "identifier", "from", "association", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L955-L983
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.isSelectColumn
private function isSelectColumn($data) { if (null !== $data && !in_array($data, $this->virtualColumns)) { return true; } return false; }
php
private function isSelectColumn($data) { if (null !== $data && !in_array($data, $this->virtualColumns)) { return true; } return false; }
[ "private", "function", "isSelectColumn", "(", "$", "data", ")", "{", "if", "(", "null", "!==", "$", "data", "&&", "!", "in_array", "(", "$", "data", ",", "$", "this", "->", "virtualColumns", ")", ")", "{", "return", "true", ";", "}", "return", "false...
Is select column. @param string $data @return bool
[ "Is", "select", "column", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L1004-L1011
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.isSearchColumn
private function isSearchColumn(AbstractColumn $column) { if (false === $this->configs['search_on_non_visible_columns']) { if (null !== $column->getDql() && true === $column->getSearchable() && true === $column->getVisible()) { return true; } } else { ...
php
private function isSearchColumn(AbstractColumn $column) { if (false === $this->configs['search_on_non_visible_columns']) { if (null !== $column->getDql() && true === $column->getSearchable() && true === $column->getVisible()) { return true; } } else { ...
[ "private", "function", "isSearchColumn", "(", "AbstractColumn", "$", "column", ")", "{", "if", "(", "false", "===", "$", "this", "->", "configs", "[", "'search_on_non_visible_columns'", "]", ")", "{", "if", "(", "null", "!==", "$", "column", "->", "getDql", ...
Is search column. @param AbstractColumn $column @return bool
[ "Is", "search", "column", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L1020-L1033
Sedona-Solutions/sedona-sbo
src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php
DatatableQuery.renderImage
private function renderImage($imageName, ImageColumn $column) { return $this->twig->render( 'SgDatatablesBundle:Helper:ii_render_image.html.twig', array( 'image_id' => 'sg_image_'.uniqid(rand(10000, 99999)), 'image_name' => $imageName, ...
php
private function renderImage($imageName, ImageColumn $column) { return $this->twig->render( 'SgDatatablesBundle:Helper:ii_render_image.html.twig', array( 'image_id' => 'sg_image_'.uniqid(rand(10000, 99999)), 'image_name' => $imageName, ...
[ "private", "function", "renderImage", "(", "$", "imageName", ",", "ImageColumn", "$", "column", ")", "{", "return", "$", "this", "->", "twig", "->", "render", "(", "'SgDatatablesBundle:Helper:ii_render_image.html.twig'", ",", "array", "(", "'image_id'", "=>", "'sg...
Render image. @param string $imageName @param ImageColumn $column @return string
[ "Render", "image", "." ]
train
https://github.com/Sedona-Solutions/sedona-sbo/blob/8548be4170d191cb1a3e263577aaaab49f04d5ce/src/Sedona/SBORuntimeBundle/Datatable/Data/DatatableQuery.php#L1043-L1058
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.setName
public function setName($v) { if ($v !== null) { $v = (string) $v; } if ($this->name !== $v) { $this->name = $v; $this->modifiedColumns[] = RolePeer::NAME; } return $this; }
php
public function setName($v) { if ($v !== null) { $v = (string) $v; } if ($this->name !== $v) { $this->name = $v; $this->modifiedColumns[] = RolePeer::NAME; } return $this; }
[ "public", "function", "setName", "(", "$", "v", ")", "{", "if", "(", "$", "v", "!==", "null", ")", "{", "$", "v", "=", "(", "string", ")", "$", "v", ";", "}", "if", "(", "$", "this", "->", "name", "!==", "$", "v", ")", "{", "$", "this", "...
Set the value of [name] column. @param string $v new value @return Role The current object (for fluent API support)
[ "Set", "the", "value", "of", "[", "name", "]", "column", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L153-L166
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.setRole
public function setRole($v) { if ($v !== null) { $v = (string) $v; } if ($this->role !== $v) { $this->role = $v; $this->modifiedColumns[] = RolePeer::ROLE; } return $this; }
php
public function setRole($v) { if ($v !== null) { $v = (string) $v; } if ($this->role !== $v) { $this->role = $v; $this->modifiedColumns[] = RolePeer::ROLE; } return $this; }
[ "public", "function", "setRole", "(", "$", "v", ")", "{", "if", "(", "$", "v", "!==", "null", ")", "{", "$", "v", "=", "(", "string", ")", "$", "v", ";", "}", "if", "(", "$", "this", "->", "role", "!==", "$", "v", ")", "{", "$", "this", "...
Set the value of [role] column. @param string $v new value @return Role The current object (for fluent API support)
[ "Set", "the", "value", "of", "[", "role", "]", "column", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L174-L187
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.hydrate
public function hydrate($row, $startcol = 0, $rehydrate = false) { try { $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; $this->role = ($row[$startcol + 2] ...
php
public function hydrate($row, $startcol = 0, $rehydrate = false) { try { $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null; $this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null; $this->role = ($row[$startcol + 2] ...
[ "public", "function", "hydrate", "(", "$", "row", ",", "$", "startcol", "=", "0", ",", "$", "rehydrate", "=", "false", ")", "{", "try", "{", "$", "this", "->", "id", "=", "(", "$", "row", "[", "$", "startcol", "+", "0", "]", "!==", "null", ")",...
Hydrates (populates) the object variables with values from the database resultset. An offset (0-based "start column") is specified so that objects can be hydrated with a subset of the columns in the resultset rows. This is needed, for example, for results of JOIN queries where the resultset row includes columns from ...
[ "Hydrates", "(", "populates", ")", "the", "object", "variables", "with", "values", "from", "the", "database", "resultset", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L217-L238
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.doSave
protected function doSave(PropelPDO $con) { $affectedRows = 0; // initialize var to track total num of affected rows if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->isNew() || $this->isModified()) { // persist changes if (...
php
protected function doSave(PropelPDO $con) { $affectedRows = 0; // initialize var to track total num of affected rows if (!$this->alreadyInSave) { $this->alreadyInSave = true; if ($this->isNew() || $this->isModified()) { // persist changes if (...
[ "protected", "function", "doSave", "(", "PropelPDO", "$", "con", ")", "{", "$", "affectedRows", "=", "0", ";", "// initialize var to track total num of affected rows", "if", "(", "!", "$", "this", "->", "alreadyInSave", ")", "{", "$", "this", "->", "alreadyInSav...
Performs the work of inserting or updating the row in the database. If the object is new, it inserts it; otherwise an update is performed. All related objects are also updated in this method. @param PropelPDO $con @return int The number of rows affected by this insert/update and any referring fk objects' ...
[ "Performs", "the", "work", "of", "inserting", "or", "updating", "the", "row", "in", "the", "database", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L404-L443
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.doInsert
protected function doInsert(PropelPDO $con) { $modifiedColumns = array(); $index = 0; $this->modifiedColumns[] = RolePeer::ID; if (null !== $this->id) { throw new PropelException('Cannot insert a value for auto-increment primary key (' . RolePeer::ID . ')'); } ...
php
protected function doInsert(PropelPDO $con) { $modifiedColumns = array(); $index = 0; $this->modifiedColumns[] = RolePeer::ID; if (null !== $this->id) { throw new PropelException('Cannot insert a value for auto-increment primary key (' . RolePeer::ID . ')'); } ...
[ "protected", "function", "doInsert", "(", "PropelPDO", "$", "con", ")", "{", "$", "modifiedColumns", "=", "array", "(", ")", ";", "$", "index", "=", "0", ";", "$", "this", "->", "modifiedColumns", "[", "]", "=", "RolePeer", "::", "ID", ";", "if", "("...
Insert the row in the database. @param PropelPDO $con @throws PropelException @see doSave()
[ "Insert", "the", "row", "in", "the", "database", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L453-L509
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.doValidate
protected function doValidate($columns = null) { if (!$this->alreadyInValidation) { $this->alreadyInValidation = true; $retval = null; $failureMap = array(); if (($retval = RolePeer::doValidate($this, $columns)) !== true) { $failureMap = arr...
php
protected function doValidate($columns = null) { if (!$this->alreadyInValidation) { $this->alreadyInValidation = true; $retval = null; $failureMap = array(); if (($retval = RolePeer::doValidate($this, $columns)) !== true) { $failureMap = arr...
[ "protected", "function", "doValidate", "(", "$", "columns", "=", "null", ")", "{", "if", "(", "!", "$", "this", "->", "alreadyInValidation", ")", "{", "$", "this", "->", "alreadyInValidation", "=", "true", ";", "$", "retval", "=", "null", ";", "$", "fa...
This function performs the validation work for complex object models. In addition to checking the current object, all related objects will also be validated. If all pass then <code>true</code> is returned; otherwise an aggregated array of ValidationFailed objects will be returned. @param array $columns Array of colu...
[ "This", "function", "performs", "the", "validation", "work", "for", "complex", "object", "models", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L578-L605
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.getByPosition
public function getByPosition($pos) { switch ($pos) { case 0: return $this->getId(); break; case 1: return $this->getName(); break; case 2: return $this->getRole(); break; ...
php
public function getByPosition($pos) { switch ($pos) { case 0: return $this->getId(); break; case 1: return $this->getName(); break; case 2: return $this->getRole(); break; ...
[ "public", "function", "getByPosition", "(", "$", "pos", ")", "{", "switch", "(", "$", "pos", ")", "{", "case", "0", ":", "return", "$", "this", "->", "getId", "(", ")", ";", "break", ";", "case", "1", ":", "return", "$", "this", "->", "getName", ...
Retrieves a field from the object by Position as specified in the xml schema. Zero-based. @param int $pos position in xml schema @return mixed Value of field at $pos
[ "Retrieves", "a", "field", "from", "the", "object", "by", "Position", "as", "specified", "in", "the", "xml", "schema", ".", "Zero", "-", "based", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L632-L648
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.toArray
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['Role'][$this->getPrimaryKey()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Role'][...
php
public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false) { if (isset($alreadyDumpedObjects['Role'][$this->getPrimaryKey()])) { return '*RECURSION*'; } $alreadyDumpedObjects['Role'][...
[ "public", "function", "toArray", "(", "$", "keyType", "=", "BasePeer", "::", "TYPE_PHPNAME", ",", "$", "includeLazyLoadColumns", "=", "true", ",", "$", "alreadyDumpedObjects", "=", "array", "(", ")", ",", "$", "includeForeignObjects", "=", "false", ")", "{", ...
Exports the object as an array. You can specify the key type of the array by passing one of the class type constants. @param string $keyType (optional) One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM. Defau...
[ "Exports", "the", "object", "as", "an", "array", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L665-L689
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.setByPosition
public function setByPosition($pos, $value) { switch ($pos) { case 0: $this->setId($value); break; case 1: $this->setName($value); break; case 2: $this->setRole($value); break;...
php
public function setByPosition($pos, $value) { switch ($pos) { case 0: $this->setId($value); break; case 1: $this->setName($value); break; case 2: $this->setRole($value); break;...
[ "public", "function", "setByPosition", "(", "$", "pos", ",", "$", "value", ")", "{", "switch", "(", "$", "pos", ")", "{", "case", "0", ":", "$", "this", "->", "setId", "(", "$", "value", ")", ";", "break", ";", "case", "1", ":", "$", "this", "-...
Sets a field from the object by Position as specified in the xml schema. Zero-based. @param int $pos position in xml schema @param mixed $value field value @return void
[ "Sets", "a", "field", "from", "the", "object", "by", "Position", "as", "specified", "in", "the", "xml", "schema", ".", "Zero", "-", "based", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L717-L730
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.fromArray
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = RolePeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); if (array_key_exists($keys[2], $a...
php
public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME) { $keys = RolePeer::getFieldNames($keyType); if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]); if (array_key_exists($keys[1], $arr)) $this->setName($arr[$keys[1]]); if (array_key_exists($keys[2], $a...
[ "public", "function", "fromArray", "(", "$", "arr", ",", "$", "keyType", "=", "BasePeer", "::", "TYPE_PHPNAME", ")", "{", "$", "keys", "=", "RolePeer", "::", "getFieldNames", "(", "$", "keyType", ")", ";", "if", "(", "array_key_exists", "(", "$", "keys",...
Populates the object using an array. This is particularly useful when populating an object from one of the request arrays (e.g. $_POST). This method goes through the column names, checking to see whether a matching key exists in populated array. If so the setByName() method is called for that column. You can specify...
[ "Populates", "the", "object", "using", "an", "array", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L749-L756
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.buildCriteria
public function buildCriteria() { $criteria = new Criteria(RolePeer::DATABASE_NAME); if ($this->isColumnModified(RolePeer::ID)) $criteria->add(RolePeer::ID, $this->id); if ($this->isColumnModified(RolePeer::NAME)) $criteria->add(RolePeer::NAME, $this->name); if ($this->isColumnModif...
php
public function buildCriteria() { $criteria = new Criteria(RolePeer::DATABASE_NAME); if ($this->isColumnModified(RolePeer::ID)) $criteria->add(RolePeer::ID, $this->id); if ($this->isColumnModified(RolePeer::NAME)) $criteria->add(RolePeer::NAME, $this->name); if ($this->isColumnModif...
[ "public", "function", "buildCriteria", "(", ")", "{", "$", "criteria", "=", "new", "Criteria", "(", "RolePeer", "::", "DATABASE_NAME", ")", ";", "if", "(", "$", "this", "->", "isColumnModified", "(", "RolePeer", "::", "ID", ")", ")", "$", "criteria", "->...
Build a Criteria object containing the values of all modified columns in this object. @return Criteria The Criteria object containing all modified values.
[ "Build", "a", "Criteria", "object", "containing", "the", "values", "of", "all", "modified", "columns", "in", "this", "object", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L763-L772
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.copyInto
public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setName($this->getName()); $copyObj->setRole($this->getRole()); if ($deepCopy && !$this->startCopy) { // important: temporarily setNew(false) because this affects the behavior of // th...
php
public function copyInto($copyObj, $deepCopy = false, $makeNew = true) { $copyObj->setName($this->getName()); $copyObj->setRole($this->getRole()); if ($deepCopy && !$this->startCopy) { // important: temporarily setNew(false) because this affects the behavior of // th...
[ "public", "function", "copyInto", "(", "$", "copyObj", ",", "$", "deepCopy", "=", "false", ",", "$", "makeNew", "=", "true", ")", "{", "$", "copyObj", "->", "setName", "(", "$", "this", "->", "getName", "(", ")", ")", ";", "$", "copyObj", "->", "se...
Sets contents of passed object to values from current object. If desired, this method can also make copies of all associated (fkey referrers) objects. @param object $copyObj An object of Role (or compatible) type. @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row. @param b...
[ "Sets", "contents", "of", "passed", "object", "to", "values", "from", "current", "object", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L831-L857
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.initUserRoles
public function initUserRoles($overrideExisting = true) { if (null !== $this->collUserRoles && !$overrideExisting) { return; } $this->collUserRoles = new PropelObjectCollection(); $this->collUserRoles->setModel('UserRole'); }
php
public function initUserRoles($overrideExisting = true) { if (null !== $this->collUserRoles && !$overrideExisting) { return; } $this->collUserRoles = new PropelObjectCollection(); $this->collUserRoles->setModel('UserRole'); }
[ "public", "function", "initUserRoles", "(", "$", "overrideExisting", "=", "true", ")", "{", "if", "(", "null", "!==", "$", "this", "->", "collUserRoles", "&&", "!", "$", "overrideExisting", ")", "{", "return", ";", "}", "$", "this", "->", "collUserRoles", ...
Initializes the collUserRoles collection. By default this just sets the collUserRoles collection to an empty array (like clearcollUserRoles()); 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", "collUserRoles", "collection", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L954-L961
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.setUserRoles
public function setUserRoles(PropelCollection $userRoles, PropelPDO $con = null) { $userRolesToDelete = $this->getUserRoles(new Criteria(), $con)->diff($userRoles); //since at least one column in the foreign key is at the same time a PK //we can not just set a PK to NULL in the lines below...
php
public function setUserRoles(PropelCollection $userRoles, PropelPDO $con = null) { $userRolesToDelete = $this->getUserRoles(new Criteria(), $con)->diff($userRoles); //since at least one column in the foreign key is at the same time a PK //we can not just set a PK to NULL in the lines below...
[ "public", "function", "setUserRoles", "(", "PropelCollection", "$", "userRoles", ",", "PropelPDO", "$", "con", "=", "null", ")", "{", "$", "userRolesToDelete", "=", "$", "this", "->", "getUserRoles", "(", "new", "Criteria", "(", ")", ",", "$", "con", ")", ...
Sets a collection of UserRole objects related by a one-to-many relationship to the current object. It will also schedule objects for deletion based on a diff between old objects (aka persisted) and new objects from the given Propel collection. @param PropelCollection $userRoles A Propel collection. @param PropelPDO $c...
[ "Sets", "a", "collection", "of", "UserRole", "objects", "related", "by", "a", "one", "-", "to", "-", "many", "relationship", "to", "the", "current", "object", ".", "It", "will", "also", "schedule", "objects", "for", "deletion", "based", "on", "a", "diff", ...
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L1032-L1055
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.countUserRoles
public function countUserRoles(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { $partial = $this->collUserRolesPartial && !$this->isNew(); if (null === $this->collUserRoles || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collUserRoles) { ...
php
public function countUserRoles(Criteria $criteria = null, $distinct = false, PropelPDO $con = null) { $partial = $this->collUserRolesPartial && !$this->isNew(); if (null === $this->collUserRoles || null !== $criteria || $partial) { if ($this->isNew() && null === $this->collUserRoles) { ...
[ "public", "function", "countUserRoles", "(", "Criteria", "$", "criteria", "=", "null", ",", "$", "distinct", "=", "false", ",", "PropelPDO", "$", "con", "=", "null", ")", "{", "$", "partial", "=", "$", "this", "->", "collUserRolesPartial", "&&", "!", "$"...
Returns the number of related UserRole objects. @param Criteria $criteria @param boolean $distinct @param PropelPDO $con @return int Count of related UserRole objects. @throws PropelException
[ "Returns", "the", "number", "of", "related", "UserRole", "objects", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L1066-L1088
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.addUserRole
public function addUserRole(UserRole $l) { if ($this->collUserRoles === null) { $this->initUserRoles(); $this->collUserRolesPartial = true; } if (!in_array($l, $this->collUserRoles->getArrayCopy(), true)) { // only add it if the **same** object is not already associa...
php
public function addUserRole(UserRole $l) { if ($this->collUserRoles === null) { $this->initUserRoles(); $this->collUserRolesPartial = true; } if (!in_array($l, $this->collUserRoles->getArrayCopy(), true)) { // only add it if the **same** object is not already associa...
[ "public", "function", "addUserRole", "(", "UserRole", "$", "l", ")", "{", "if", "(", "$", "this", "->", "collUserRoles", "===", "null", ")", "{", "$", "this", "->", "initUserRoles", "(", ")", ";", "$", "this", "->", "collUserRolesPartial", "=", "true", ...
Method called to associate a UserRole object to this object through the UserRole foreign key attribute. @param UserRole $l UserRole @return Role The current object (for fluent API support)
[ "Method", "called", "to", "associate", "a", "UserRole", "object", "to", "this", "object", "through", "the", "UserRole", "foreign", "key", "attribute", "." ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L1097-L1113
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.getUserRolesJoinUser
public function getUserRolesJoinUser($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $query = UserRoleQuery::create(null, $criteria); $query->joinWith('User', $join_behavior); return $this->getUserRoles($query, $con); }
php
public function getUserRolesJoinUser($criteria = null, $con = null, $join_behavior = Criteria::LEFT_JOIN) { $query = UserRoleQuery::create(null, $criteria); $query->joinWith('User', $join_behavior); return $this->getUserRoles($query, $con); }
[ "public", "function", "getUserRolesJoinUser", "(", "$", "criteria", "=", "null", ",", "$", "con", "=", "null", ",", "$", "join_behavior", "=", "Criteria", "::", "LEFT_JOIN", ")", "{", "$", "query", "=", "UserRoleQuery", "::", "create", "(", "null", ",", ...
If this collection has already been initialized with an identical criteria, it returns the collection. Otherwise if this Role is new, it will return an empty collection; or if this Role has previously been saved, it will retrieve related UserRoles from storage. This method is protected by default in order to keep the ...
[ "If", "this", "collection", "has", "already", "been", "initialized", "with", "an", "identical", "criteria", "it", "returns", "the", "collection", ".", "Otherwise", "if", "this", "Role", "is", "new", "it", "will", "return", "an", "empty", "collection", ";", "...
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L1160-L1166
slashworks/control-bundle
src/Slashworks/BackendBundle/Model/om/BaseRole.php
BaseRole.clear
public function clear() { $this->id = null; $this->name = null; $this->role = null; $this->alreadyInSave = false; $this->alreadyInValidation = false; $this->alreadyInClearAllReferencesDeep = false; $this->clearAllReferences(); $this->resetModified(); ...
php
public function clear() { $this->id = null; $this->name = null; $this->role = null; $this->alreadyInSave = false; $this->alreadyInValidation = false; $this->alreadyInClearAllReferencesDeep = false; $this->clearAllReferences(); $this->resetModified(); ...
[ "public", "function", "clear", "(", ")", "{", "$", "this", "->", "id", "=", "null", ";", "$", "this", "->", "name", "=", "null", ";", "$", "this", "->", "role", "=", "null", ";", "$", "this", "->", "alreadyInSave", "=", "false", ";", "$", "this",...
Clears the current object and sets all attributes to their default values
[ "Clears", "the", "current", "object", "and", "sets", "all", "attributes", "to", "their", "default", "values" ]
train
https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/BackendBundle/Model/om/BaseRole.php#L1171-L1183
PortaText/php-sdk
src/PortaText/Command/Api/Inspect.php
Inspect.getEndpoint
protected function getEndpoint($method) { $endpoint = 'inspect'; $number = $this->getArgument("number"); if (!is_null($number)) { $endpoint .= "/$number"; $this->delArgument("number"); } return $endpoint; }
php
protected function getEndpoint($method) { $endpoint = 'inspect'; $number = $this->getArgument("number"); if (!is_null($number)) { $endpoint .= "/$number"; $this->delArgument("number"); } return $endpoint; }
[ "protected", "function", "getEndpoint", "(", "$", "method", ")", "{", "$", "endpoint", "=", "'inspect'", ";", "$", "number", "=", "$", "this", "->", "getArgument", "(", "\"number\"", ")", ";", "if", "(", "!", "is_null", "(", "$", "number", ")", ")", ...
Returns a string with the endpoint for the given command. @param string $method Method for this command. @return string
[ "Returns", "a", "string", "with", "the", "endpoint", "for", "the", "given", "command", "." ]
train
https://github.com/PortaText/php-sdk/blob/dbe04ef043db5b251953f9de57aa4d0f1785dfcc/src/PortaText/Command/Api/Inspect.php#L50-L59
redaigbaria/oauth2
src/TokenType/Bearer.php
Bearer.generateResponse
public function generateResponse() { $return = [ 'access_token' => $this->getParam('access_token'), 'token_type' => 'Bearer', 'expires_in' => $this->getParam('expires_in'), ]; if (!is_null($this->getParam('refresh_token'))) { $return...
php
public function generateResponse() { $return = [ 'access_token' => $this->getParam('access_token'), 'token_type' => 'Bearer', 'expires_in' => $this->getParam('expires_in'), ]; if (!is_null($this->getParam('refresh_token'))) { $return...
[ "public", "function", "generateResponse", "(", ")", "{", "$", "return", "=", "[", "'access_token'", "=>", "$", "this", "->", "getParam", "(", "'access_token'", ")", ",", "'token_type'", "=>", "'Bearer'", ",", "'expires_in'", "=>", "$", "this", "->", "getPara...
{@inheritdoc}
[ "{" ]
train
https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/TokenType/Bearer.php#L21-L34
redaigbaria/oauth2
src/TokenType/Bearer.php
Bearer.determineAccessTokenInHeader
public function determineAccessTokenInHeader(Request $request) { if ($request->headers->has('Authorization') === false) { return; } $header = $request->headers->get('Authorization'); $header = explode(',', $header)[0]; if (substr($header, 0, 7) !== 'Bearer ') { ...
php
public function determineAccessTokenInHeader(Request $request) { if ($request->headers->has('Authorization') === false) { return; } $header = $request->headers->get('Authorization'); $header = explode(',', $header)[0]; if (substr($header, 0, 7) !== 'Bearer ') { ...
[ "public", "function", "determineAccessTokenInHeader", "(", "Request", "$", "request", ")", "{", "if", "(", "$", "request", "->", "headers", "->", "has", "(", "'Authorization'", ")", "===", "false", ")", "{", "return", ";", "}", "$", "header", "=", "$", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/src/TokenType/Bearer.php#L39-L53
JBZoo/Less
src/Driver/Iless.php
Iless._compile
protected function _compile($fullPath, $relPath) { $this->_initCompiler(); $this->_compiler->parseFile($fullPath); $resultCss = $this->_compiler->getCSS(); return $resultCss; }
php
protected function _compile($fullPath, $relPath) { $this->_initCompiler(); $this->_compiler->parseFile($fullPath); $resultCss = $this->_compiler->getCSS(); return $resultCss; }
[ "protected", "function", "_compile", "(", "$", "fullPath", ",", "$", "relPath", ")", "{", "$", "this", "->", "_initCompiler", "(", ")", ";", "$", "this", "->", "_compiler", "->", "parseFile", "(", "$", "fullPath", ")", ";", "$", "resultCss", "=", "$", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/JBZoo/Less/blob/9e9c41e3c7b76222c0d81379dead222413f2f042/src/Driver/Iless.php#L37-L46
SAREhub/PHP_Commons
src/SAREhub/Commons/Zmq/RequestReply/RequestSender.php
RequestSender.sendRequest
public function sendRequest($request, $wait = self::WAIT) { $this->getSocket()->send($request, ($wait) ? 0 : \ZMQ::MODE_DONTWAIT); return $this; }
php
public function sendRequest($request, $wait = self::WAIT) { $this->getSocket()->send($request, ($wait) ? 0 : \ZMQ::MODE_DONTWAIT); return $this; }
[ "public", "function", "sendRequest", "(", "$", "request", ",", "$", "wait", "=", "self", "::", "WAIT", ")", "{", "$", "this", "->", "getSocket", "(", ")", "->", "send", "(", "$", "request", ",", "(", "$", "wait", ")", "?", "0", ":", "\\", "ZMQ", ...
Send request via ZMQ socket. @param string $request Request payload. @param bool $wait If true that operation would be block. @return $this @throws \ZMQSocketException
[ "Send", "request", "via", "ZMQ", "socket", "." ]
train
https://github.com/SAREhub/PHP_Commons/blob/4e1769ab6411a584112df1151dcc90e6b82fe2bb/src/SAREhub/Commons/Zmq/RequestReply/RequestSender.php#L75-L79
redaigbaria/oauth2
examples/relational/Storage/AccessTokenStorage.php
AccessTokenStorage.get
public function get($token) { $result = Capsule::table('oauth_access_tokens') ->where('access_token', $token) ->get(); if (count($result) === 1) { $token = (new AccessTokenEntity($this->server)) ->setId($res...
php
public function get($token) { $result = Capsule::table('oauth_access_tokens') ->where('access_token', $token) ->get(); if (count($result) === 1) { $token = (new AccessTokenEntity($this->server)) ->setId($res...
[ "public", "function", "get", "(", "$", "token", ")", "{", "$", "result", "=", "Capsule", "::", "table", "(", "'oauth_access_tokens'", ")", "->", "where", "(", "'access_token'", ",", "$", "token", ")", "->", "get", "(", ")", ";", "if", "(", "count", "...
{@inheritdoc}
[ "{" ]
train
https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/examples/relational/Storage/AccessTokenStorage.php#L16-L31
redaigbaria/oauth2
examples/relational/Storage/AccessTokenStorage.php
AccessTokenStorage.create
public function create($token, $expireTime, $sessionId) { Capsule::table('oauth_access_tokens') ->insert([ 'access_token' => $token, 'session_id' => $sessionId, 'expire_time' => $expireTime, ...
php
public function create($token, $expireTime, $sessionId) { Capsule::table('oauth_access_tokens') ->insert([ 'access_token' => $token, 'session_id' => $sessionId, 'expire_time' => $expireTime, ...
[ "public", "function", "create", "(", "$", "token", ",", "$", "expireTime", ",", "$", "sessionId", ")", "{", "Capsule", "::", "table", "(", "'oauth_access_tokens'", ")", "->", "insert", "(", "[", "'access_token'", "=>", "$", "token", ",", "'session_id'", "=...
{@inheritdoc}
[ "{" ]
train
https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/examples/relational/Storage/AccessTokenStorage.php#L62-L70
redaigbaria/oauth2
examples/relational/Storage/AccessTokenStorage.php
AccessTokenStorage.associateScope
public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { Capsule::table('oauth_access_token_scopes') ->insert([ 'access_token' => $token->getId(), 'scope' => $scope->getId(), ]); }
php
public function associateScope(AccessTokenEntity $token, ScopeEntity $scope) { Capsule::table('oauth_access_token_scopes') ->insert([ 'access_token' => $token->getId(), 'scope' => $scope->getId(), ]); }
[ "public", "function", "associateScope", "(", "AccessTokenEntity", "$", "token", ",", "ScopeEntity", "$", "scope", ")", "{", "Capsule", "::", "table", "(", "'oauth_access_token_scopes'", ")", "->", "insert", "(", "[", "'access_token'", "=>", "$", "token", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/examples/relational/Storage/AccessTokenStorage.php#L75-L82
adammbalogh/key-value-store-memory
src/Adapter/MemoryAdapter/ValueTrait.php
ValueTrait.getValue
protected function getValue($key) { if (!array_key_exists($key, $this->store)) { throw new KeyNotFoundException(); } $getResult = $this->store[$key]; $unserialized = @unserialize($getResult); if (Util::hasInternalExpireTime($unserialized)) { $this->h...
php
protected function getValue($key) { if (!array_key_exists($key, $this->store)) { throw new KeyNotFoundException(); } $getResult = $this->store[$key]; $unserialized = @unserialize($getResult); if (Util::hasInternalExpireTime($unserialized)) { $this->h...
[ "protected", "function", "getValue", "(", "$", "key", ")", "{", "if", "(", "!", "array_key_exists", "(", "$", "key", ",", "$", "this", "->", "store", ")", ")", "{", "throw", "new", "KeyNotFoundException", "(", ")", ";", "}", "$", "getResult", "=", "$...
Gets value, watches expiring. @param string $key @return mixed @throws KeyNotFoundException
[ "Gets", "value", "watches", "expiring", "." ]
train
https://github.com/adammbalogh/key-value-store-memory/blob/6bafb9037d61911f76343a7aa7270866b1a11995/src/Adapter/MemoryAdapter/ValueTrait.php#L49-L65
adammbalogh/key-value-store-memory
src/Adapter/MemoryAdapter/ValueTrait.php
ValueTrait.handleTtl
protected function handleTtl($key, $expireSetTs, $expireSec) { $ttl = $expireSetTs + $expireSec - time(); if ($ttl <= 0) { unset($this->store[$key]); throw new KeyNotFoundException(); } return $ttl; }
php
protected function handleTtl($key, $expireSetTs, $expireSec) { $ttl = $expireSetTs + $expireSec - time(); if ($ttl <= 0) { unset($this->store[$key]); throw new KeyNotFoundException(); } return $ttl; }
[ "protected", "function", "handleTtl", "(", "$", "key", ",", "$", "expireSetTs", ",", "$", "expireSec", ")", "{", "$", "ttl", "=", "$", "expireSetTs", "+", "$", "expireSec", "-", "time", "(", ")", ";", "if", "(", "$", "ttl", "<=", "0", ")", "{", "...
If ttl is lesser or equals 0 delete key. @param string $key @param int $expireSetTs @param int $expireSec @return int ttl @throws KeyNotFoundException
[ "If", "ttl", "is", "lesser", "or", "equals", "0", "delete", "key", "." ]
train
https://github.com/adammbalogh/key-value-store-memory/blob/6bafb9037d61911f76343a7aa7270866b1a11995/src/Adapter/MemoryAdapter/ValueTrait.php#L78-L88
phpmob/changmin
src/PhpMob/MediaBundle/Imagine/Cache/CacheManager.php
CacheManager.generateUrl
public function generateUrl($path, $filter, array $runtimeConfig = array(), $resolver = null) { $params = array( 'path' => ltrim($path, '/'), 'filter' => $filter, ); if ($resolver) { $params['resolver'] = $resolver; } if (empty($runtimeCo...
php
public function generateUrl($path, $filter, array $runtimeConfig = array(), $resolver = null) { $params = array( 'path' => ltrim($path, '/'), 'filter' => $filter, ); if ($resolver) { $params['resolver'] = $resolver; } if (empty($runtimeCo...
[ "public", "function", "generateUrl", "(", "$", "path", ",", "$", "filter", ",", "array", "$", "runtimeConfig", "=", "array", "(", ")", ",", "$", "resolver", "=", "null", ")", "{", "$", "params", "=", "array", "(", "'path'", "=>", "ltrim", "(", "$", ...
Returns a web accessible URL. @param string $path The path where the resolved file is expected @param string $filter The name of the imagine filter in effect @param array $runtimeConfig @param string $resolver @return string
[ "Returns", "a", "web", "accessible", "URL", "." ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/MediaBundle/Imagine/Cache/CacheManager.php#L45-L73
nyeholt/silverstripe-external-content
thirdparty/Zend/Http/Client/Adapter/Proxy.php
Zend_Http_Client_Adapter_Proxy.connect
public function connect($host, $port = 80, $secure = false) { // If no proxy is set, fall back to Socket adapter if (! $this->config['proxy_host']) return parent::connect($host, $port, $secure); // Go through a proxy - the connection is actually to the proxy server $host = $this->co...
php
public function connect($host, $port = 80, $secure = false) { // If no proxy is set, fall back to Socket adapter if (! $this->config['proxy_host']) return parent::connect($host, $port, $secure); // Go through a proxy - the connection is actually to the proxy server $host = $this->co...
[ "public", "function", "connect", "(", "$", "host", ",", "$", "port", "=", "80", ",", "$", "secure", "=", "false", ")", "{", "// If no proxy is set, fall back to Socket adapter", "if", "(", "!", "$", "this", "->", "config", "[", "'proxy_host'", "]", ")", "r...
Connect to the remote server Will try to connect to the proxy server. If no proxy was set, will fall back to the target server (behave like regular Socket adapter) @param string $host @param int $port @param boolean $secure @param int $timeout
[ "Connect", "to", "the", "remote", "server" ]
train
https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Http/Client/Adapter/Proxy.php#L78-L111
nyeholt/silverstripe-external-content
thirdparty/Zend/Http/Client/Adapter/Proxy.php
Zend_Http_Client_Adapter_Proxy.write
public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '') { // If no proxy is set, fall back to default Socket adapter if (! $this->config['proxy_host']) return parent::write($method, $uri, $http_ver, $headers, $body); // Make sure we're properly connected ...
php
public function write($method, $uri, $http_ver = '1.1', $headers = array(), $body = '') { // If no proxy is set, fall back to default Socket adapter if (! $this->config['proxy_host']) return parent::write($method, $uri, $http_ver, $headers, $body); // Make sure we're properly connected ...
[ "public", "function", "write", "(", "$", "method", ",", "$", "uri", ",", "$", "http_ver", "=", "'1.1'", ",", "$", "headers", "=", "array", "(", ")", ",", "$", "body", "=", "''", ")", "{", "// If no proxy is set, fall back to default Socket adapter", "if", ...
Send request to the proxy server @param string $method @param Zend_Uri_Http $uri @param string $http_ver @param array $headers @param string $body @return string Request as string
[ "Send", "request", "to", "the", "proxy", "server" ]
train
https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Http/Client/Adapter/Proxy.php#L123-L177
nyeholt/silverstripe-external-content
thirdparty/Zend/Http/Client/Adapter/Proxy.php
Zend_Http_Client_Adapter_Proxy.connectHandshake
protected function connectHandshake($host, $port = 443, $http_ver = '1.1', array &$headers = array()) { $request = "CONNECT $host:$port HTTP/$http_ver\r\n" . "Host: " . $this->config['proxy_host'] . "\r\n"; // Add the user-agent header if (isset($this->config['useragent'...
php
protected function connectHandshake($host, $port = 443, $http_ver = '1.1', array &$headers = array()) { $request = "CONNECT $host:$port HTTP/$http_ver\r\n" . "Host: " . $this->config['proxy_host'] . "\r\n"; // Add the user-agent header if (isset($this->config['useragent'...
[ "protected", "function", "connectHandshake", "(", "$", "host", ",", "$", "port", "=", "443", ",", "$", "http_ver", "=", "'1.1'", ",", "array", "&", "$", "headers", "=", "array", "(", ")", ")", "{", "$", "request", "=", "\"CONNECT $host:$port HTTP/$http_ver...
Preform handshaking with HTTPS proxy using CONNECT method @param string $host @param integer $port @param string $http_ver @param array $headers
[ "Preform", "handshaking", "with", "HTTPS", "proxy", "using", "CONNECT", "method" ]
train
https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Http/Client/Adapter/Proxy.php#L187-L249
inpsyde/inpsyde-filter
src/WordPress/AutoP.php
AutoP.filter
public function filter( $value ) { if ( ! is_string( $value ) || empty( $value ) ) { do_action( 'inpsyde.filter.error', 'The given value is not a string or empty.', [ 'method' => __METHOD__, 'value' => $value ] ); return $value; } $br = (bool) $this->options[ 'br' ]; return wpautop( $value, $br ); }
php
public function filter( $value ) { if ( ! is_string( $value ) || empty( $value ) ) { do_action( 'inpsyde.filter.error', 'The given value is not a string or empty.', [ 'method' => __METHOD__, 'value' => $value ] ); return $value; } $br = (bool) $this->options[ 'br' ]; return wpautop( $value, $br ); }
[ "public", "function", "filter", "(", "$", "value", ")", "{", "if", "(", "!", "is_string", "(", "$", "value", ")", "||", "empty", "(", "$", "value", ")", ")", "{", "do_action", "(", "'inpsyde.filter.error'", ",", "'The given value is not a string or empty.'", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/inpsyde/inpsyde-filter/blob/777a6208ea4dfbeed89e6d0712a35dc25eab498b/src/WordPress/AutoP.php#L24-L35
webforge-labs/psc-cms
lib/Psc/HTML/Tag.php
Tag.after
public function after(Tag $after) { $id = $after->guid(); $this->templateAppend('%'.$id.'%'); $this->templateContent->$id =& $after; }
php
public function after(Tag $after) { $id = $after->guid(); $this->templateAppend('%'.$id.'%'); $this->templateContent->$id =& $after; }
[ "public", "function", "after", "(", "Tag", "$", "after", ")", "{", "$", "id", "=", "$", "after", "->", "guid", "(", ")", ";", "$", "this", "->", "templateAppend", "(", "'%'", ".", "$", "id", ".", "'%'", ")", ";", "$", "this", "->", "templateConte...
Fügt hinter diesem Element ein anderes Element an
[ "Fügt", "hinter", "diesem", "Element", "ein", "anderes", "Element", "an" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/HTML/Tag.php#L476-L480
christianblos/markdown2html
src/Theme/NavItem.php
NavItem.getChildById
public function getChildById($id) { foreach ($this->children as $child) { if ($child->id === $id) { return $child; } $subChild = $child->getChildById($id); if ($subChild !== null) { return $subChild; } } ...
php
public function getChildById($id) { foreach ($this->children as $child) { if ($child->id === $id) { return $child; } $subChild = $child->getChildById($id); if ($subChild !== null) { return $subChild; } } ...
[ "public", "function", "getChildById", "(", "$", "id", ")", "{", "foreach", "(", "$", "this", "->", "children", "as", "$", "child", ")", "{", "if", "(", "$", "child", "->", "id", "===", "$", "id", ")", "{", "return", "$", "child", ";", "}", "$", ...
@param string $id @return NavItem|null
[ "@param", "string", "$id" ]
train
https://github.com/christianblos/markdown2html/blob/2ae1177d71fe313c802962dbb9226b5a90bbc65a/src/Theme/NavItem.php#L72-L86
anexia-it/anexia-laravel-encryption
src/PostgresPgpEncryption.php
PostgresPgpEncryption.getEncryptExpression
public function getEncryptExpression($text, $encryptionKey, $quote = true) { $quotedText = $quote ? DB::connection()->getPdo()->quote($text) : $text; $quotedEncryptKey = DB::connection()->getPdo()->quote($encryptionKey); return "pgp_sym_encrypt($quotedText, $quotedEncryptKey)"; }
php
public function getEncryptExpression($text, $encryptionKey, $quote = true) { $quotedText = $quote ? DB::connection()->getPdo()->quote($text) : $text; $quotedEncryptKey = DB::connection()->getPdo()->quote($encryptionKey); return "pgp_sym_encrypt($quotedText, $quotedEncryptKey)"; }
[ "public", "function", "getEncryptExpression", "(", "$", "text", ",", "$", "encryptionKey", ",", "$", "quote", "=", "true", ")", "{", "$", "quotedText", "=", "$", "quote", "?", "DB", "::", "connection", "(", ")", "->", "getPdo", "(", ")", "->", "quote",...
Returns a encrypt expression @param string $text text to encrypt or field name @param string $encryptionKey @param bool $quote use false if $text is a field name @return string
[ "Returns", "a", "encrypt", "expression" ]
train
https://github.com/anexia-it/anexia-laravel-encryption/blob/b7c72d99916ebca2d2cf2dbab1d4c0f84e383081/src/PostgresPgpEncryption.php#L18-L23
anexia-it/anexia-laravel-encryption
src/PostgresPgpEncryption.php
PostgresPgpEncryption.getDecryptExpression
public function getDecryptExpression($text, $decryptionKey, $quote = false) { $quotedText = $quote ? DB::connection()->getPdo()->quote($text) : $text; $quotedDecryptKey = DB::connection()->getPdo()->quote($decryptionKey); return "pgp_sym_decrypt({$quotedText}::bytea, $quotedDecryptKey)"; ...
php
public function getDecryptExpression($text, $decryptionKey, $quote = false) { $quotedText = $quote ? DB::connection()->getPdo()->quote($text) : $text; $quotedDecryptKey = DB::connection()->getPdo()->quote($decryptionKey); return "pgp_sym_decrypt({$quotedText}::bytea, $quotedDecryptKey)"; ...
[ "public", "function", "getDecryptExpression", "(", "$", "text", ",", "$", "decryptionKey", ",", "$", "quote", "=", "false", ")", "{", "$", "quotedText", "=", "$", "quote", "?", "DB", "::", "connection", "(", ")", "->", "getPdo", "(", ")", "->", "quote"...
Returns a encrypt expression @param string $text text to encrypt or field name @param string $decryptionKey @param bool $quote use false if $text is a field name @return string
[ "Returns", "a", "encrypt", "expression" ]
train
https://github.com/anexia-it/anexia-laravel-encryption/blob/b7c72d99916ebca2d2cf2dbab1d4c0f84e383081/src/PostgresPgpEncryption.php#L32-L37
meccado/acl-admin-control-panel
src/Http/Controllers/Admin/ProfileController.php
ProfileController.update
public function update(ProfileImageFormRequest $request, $id) { if($request->hasFile('avatar')) { $user = User::with('profile')->findOrFail($id); // REMOVE OLD AVATAR: if ($user->profile->avatar != NULL) { // DELETE FROM THE DIRECTORY: File::delete($user->profil...
php
public function update(ProfileImageFormRequest $request, $id) { if($request->hasFile('avatar')) { $user = User::with('profile')->findOrFail($id); // REMOVE OLD AVATAR: if ($user->profile->avatar != NULL) { // DELETE FROM THE DIRECTORY: File::delete($user->profil...
[ "public", "function", "update", "(", "ProfileImageFormRequest", "$", "request", ",", "$", "id", ")", "{", "if", "(", "$", "request", "->", "hasFile", "(", "'avatar'", ")", ")", "{", "$", "user", "=", "User", "::", "with", "(", "'profile'", ")", "->", ...
Update the specified resource in storage. @param \Illuminate\Http\Request $request @param int $id @return \Illuminate\Http\Response
[ "Update", "the", "specified", "resource", "in", "storage", "." ]
train
https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/ProfileController.php#L91-L116
meccado/acl-admin-control-panel
src/Http/Controllers/Admin/ProfileController.php
ProfileController.updateImage
public function updateImage(Request $request, $id) { if($request->hasFile('avatar')) { $avatar = $request->file('avatar'); $user = User::with('profile')->findOrFail($id); // REMOVE OLD AVATAR: if ($user->profile->avatar != NULL) { // DELETE FROM THE DIRECTORY: ...
php
public function updateImage(Request $request, $id) { if($request->hasFile('avatar')) { $avatar = $request->file('avatar'); $user = User::with('profile')->findOrFail($id); // REMOVE OLD AVATAR: if ($user->profile->avatar != NULL) { // DELETE FROM THE DIRECTORY: ...
[ "public", "function", "updateImage", "(", "Request", "$", "request", ",", "$", "id", ")", "{", "if", "(", "$", "request", "->", "hasFile", "(", "'avatar'", ")", ")", "{", "$", "avatar", "=", "$", "request", "->", "file", "(", "'avatar'", ")", ";", ...
Update the specified resource in storage. @param \Illuminate\Http\Request $request @param int $id @return \Illuminate\Http\Response
[ "Update", "the", "specified", "resource", "in", "storage", "." ]
train
https://github.com/meccado/acl-admin-control-panel/blob/50ac4c0dbf8bd49944ecad6a70708a70411b7378/src/Http/Controllers/Admin/ProfileController.php#L140-L165
JeanWolf/yii2-jrbac
controllers/MenuController.php
MenuController.actionDelete
public function actionDelete($id) { $subCount = Menu::find()->where('`pid`=:id',[':id'=>$id])->count(); if($subCount == 0) { //不包含子菜单时 方可删除 $this->findModel($id)->delete(); } return $this->redirect(['index']); }
php
public function actionDelete($id) { $subCount = Menu::find()->where('`pid`=:id',[':id'=>$id])->count(); if($subCount == 0) { //不包含子菜单时 方可删除 $this->findModel($id)->delete(); } return $this->redirect(['index']); }
[ "public", "function", "actionDelete", "(", "$", "id", ")", "{", "$", "subCount", "=", "Menu", "::", "find", "(", ")", "->", "where", "(", "'`pid`=:id'", ",", "[", "':id'", "=>", "$", "id", "]", ")", "->", "count", "(", ")", ";", "if", "(", "$", ...
删除菜单 Deletes an existing Menu model. If deletion is successful, the browser will be redirected to the 'index' page. @param integer $id @return mixed
[ "删除菜单", "Deletes", "an", "existing", "Menu", "model", ".", "If", "deletion", "is", "successful", "the", "browser", "will", "be", "redirected", "to", "the", "index", "page", "." ]
train
https://github.com/JeanWolf/yii2-jrbac/blob/1e5c80038451bd5b385f83cb9344c3bd5edd85e0/controllers/MenuController.php#L84-L91
factorio-item-browser/export-data
src/Entity/LocalisedString.php
LocalisedString.setTranslation
public function setTranslation(string $locale, string $value) { if (strlen($value) === 0) { unset($this->translations[$locale]); } else { $this->translations[$locale] = mb_convert_encoding($value, 'UTF-8', 'UTF-8'); } return $this; }
php
public function setTranslation(string $locale, string $value) { if (strlen($value) === 0) { unset($this->translations[$locale]); } else { $this->translations[$locale] = mb_convert_encoding($value, 'UTF-8', 'UTF-8'); } return $this; }
[ "public", "function", "setTranslation", "(", "string", "$", "locale", ",", "string", "$", "value", ")", "{", "if", "(", "strlen", "(", "$", "value", ")", "===", "0", ")", "{", "unset", "(", "$", "this", "->", "translations", "[", "$", "locale", "]", ...
Sets a translation of the localised string. @param string $locale @param string $value @return $this
[ "Sets", "a", "translation", "of", "the", "localised", "string", "." ]
train
https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/LocalisedString.php#L30-L38
phpmob/changmin
src/PhpMob/CmsBundle/Form/Type/TemplateChoiceType.php
TemplateChoiceType.configureOptions
public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'choices' => function (Options $options) { return $this->repository->findNoneAbstractTemplates(); }, 'choice_value' => 'id', 'choice_label' => 'name', ...
php
public function configureOptions(OptionsResolver $resolver): void { $resolver->setDefaults([ 'choices' => function (Options $options) { return $this->repository->findNoneAbstractTemplates(); }, 'choice_value' => 'id', 'choice_label' => 'name', ...
[ "public", "function", "configureOptions", "(", "OptionsResolver", "$", "resolver", ")", ":", "void", "{", "$", "resolver", "->", "setDefaults", "(", "[", "'choices'", "=>", "function", "(", "Options", "$", "options", ")", "{", "return", "$", "this", "->", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CmsBundle/Form/Type/TemplateChoiceType.php#L41-L51
webforge-labs/psc-cms
lib/Psc/JS/AST/CodeWriter.php
CodeWriter.writeHashMap
public function writeHashMap(stdClass $walkedHashMap, Type $type) { $hashMap = '{'; if (count((array) $walkedHashMap) > 0) { foreach ($walkedHashMap as $field => $walkedValue) { $hashMap .= sprintf("'%s': %s, ", $field, $walkedValue); } $hashMap = mb_substr($hashMap, 0, -2); } ...
php
public function writeHashMap(stdClass $walkedHashMap, Type $type) { $hashMap = '{'; if (count((array) $walkedHashMap) > 0) { foreach ($walkedHashMap as $field => $walkedValue) { $hashMap .= sprintf("'%s': %s, ", $field, $walkedValue); } $hashMap = mb_substr($hashMap, 0, -2); } ...
[ "public", "function", "writeHashMap", "(", "stdClass", "$", "walkedHashMap", ",", "Type", "$", "type", ")", "{", "$", "hashMap", "=", "'{'", ";", "if", "(", "count", "(", "(", "array", ")", "$", "walkedHashMap", ")", ">", "0", ")", "{", "foreach", "(...
Eine HashMap hat signifikante Schlüssel (integer oder string) z.B. in Javascript {} (ein Object-Literal) nach der schließen klammer } ist kein umbruch, für maximale flexibilität
[ "Eine", "HashMap", "hat", "signifikante", "Schlüssel", "(", "integer", "oder", "string", ")" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/JS/AST/CodeWriter.php#L90-L100
webforge-labs/psc-cms
lib/Psc/CMS/ProjectMain.php
ProjectMain.initDoctrinePackage
public function initDoctrinePackage() { $module = $GLOBALS['env']['container']->getModule('Doctrine'); $this->dc = new DCPackage($module, $module->getEntityManager($this->getConnectionName())); $this->attachEntityMetaListener(); // ganz wichtig das hier zu machen, weil das sonst das doctrinepackage initiali...
php
public function initDoctrinePackage() { $module = $GLOBALS['env']['container']->getModule('Doctrine'); $this->dc = new DCPackage($module, $module->getEntityManager($this->getConnectionName())); $this->attachEntityMetaListener(); // ganz wichtig das hier zu machen, weil das sonst das doctrinepackage initiali...
[ "public", "function", "initDoctrinePackage", "(", ")", "{", "$", "module", "=", "$", "GLOBALS", "[", "'env'", "]", "[", "'container'", "]", "->", "getModule", "(", "'Doctrine'", ")", ";", "$", "this", "->", "dc", "=", "new", "DCPackage", "(", "$", "mod...
Erstellt das DCPackage wird vom getter aufgerufen, damit es immer da ist
[ "Erstellt", "das", "DCPackage" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/ProjectMain.php#L195-L199
webforge-labs/psc-cms
lib/Psc/CMS/ProjectMain.php
ProjectMain.initServices
public function initServices() { $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService()); // wir mappen den users controller auf den in Psc $entityService->setControllerClass('User', 'Psc\CMS\Controller\UserEntityController'); }
php
public function initServices() { $this->getFrontController()->getRequestHandler()->addService($entityService = $this->getEntityService()); // wir mappen den users controller auf den in Psc $entityService->setControllerClass('User', 'Psc\CMS\Controller\UserEntityController'); }
[ "public", "function", "initServices", "(", ")", "{", "$", "this", "->", "getFrontController", "(", ")", "->", "getRequestHandler", "(", ")", "->", "addService", "(", "$", "entityService", "=", "$", "this", "->", "getEntityService", "(", ")", ")", ";", "// ...
Intialisiert zusätzliche Services für den RequestHandler standardmäßig wird der EntityService hinzugefügt
[ "Intialisiert", "zusätzliche", "Services", "für", "den", "RequestHandler" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/ProjectMain.php#L218-L223
webforge-labs/psc-cms
lib/Psc/CMS/ProjectMain.php
ProjectMain.hydrateEntity
public function hydrateEntity($entityName, $identifier) { return $this->getDoctrinePackage()->getRepository( $this->getDoctrinePackage()->getModule()->getEntityName($entityName) )->hydrate($identifier); }
php
public function hydrateEntity($entityName, $identifier) { return $this->getDoctrinePackage()->getRepository( $this->getDoctrinePackage()->getModule()->getEntityName($entityName) )->hydrate($identifier); }
[ "public", "function", "hydrateEntity", "(", "$", "entityName", ",", "$", "identifier", ")", "{", "return", "$", "this", "->", "getDoctrinePackage", "(", ")", "->", "getRepository", "(", "$", "this", "->", "getDoctrinePackage", "(", ")", "->", "getModule", "(...
Hydriert ein einzelnes Entity @param string $entityName kann der FQN oder Shortname sein @return Psc\CMS\Entity
[ "Hydriert", "ein", "einzelnes", "Entity" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/ProjectMain.php#L262-L266
webforge-labs/psc-cms
lib/Psc/CMS/ProjectMain.php
ProjectMain.getAuthController
public function getAuthController() { if (!isset($this->authController)) { $this->authController = new \Psc\CMS\Controller\AuthController( new Auth( $this->session, $this->cookieManager, $this->getUserManager() ) ); $this->authController->setUserClass(...
php
public function getAuthController() { if (!isset($this->authController)) { $this->authController = new \Psc\CMS\Controller\AuthController( new Auth( $this->session, $this->cookieManager, $this->getUserManager() ) ); $this->authController->setUserClass(...
[ "public", "function", "getAuthController", "(", ")", "{", "if", "(", "!", "isset", "(", "$", "this", "->", "authController", ")", ")", "{", "$", "this", "->", "authController", "=", "new", "\\", "Psc", "\\", "CMS", "\\", "Controller", "\\", "AuthControll...
ganz wichtig, das hier zu überschreiben, damit der authcontroller auf jeden fall den richtigen EntityManager bekommt
[ "ganz", "wichtig", "das", "hier", "zu", "überschreiben", "damit", "der", "authcontroller", "auf", "jeden", "fall", "den", "richtigen", "EntityManager", "bekommt" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/ProjectMain.php#L518-L532
php-rise/rise
src/Dispatcher.php
Dispatcher.dispatch
public function dispatch() { $handler = current($this->handlers); if (!$handler) { return; } $this->resolveHandler($handler); return $this; }
php
public function dispatch() { $handler = current($this->handlers); if (!$handler) { return; } $this->resolveHandler($handler); return $this; }
[ "public", "function", "dispatch", "(", ")", "{", "$", "handler", "=", "current", "(", "$", "this", "->", "handlers", ")", ";", "if", "(", "!", "$", "handler", ")", "{", "return", ";", "}", "$", "this", "->", "resolveHandler", "(", "$", "handler", "...
Dispatch handlers. @return self
[ "Dispatch", "handlers", "." ]
train
https://github.com/php-rise/rise/blob/cd14ef9956f1b6875b7bcd642545dcef6a9152b7/src/Dispatcher.php#L26-L35
maniaplanet/maniaplanet-ws-sdk
libraries/Maniaplanet/WebServices/TrustCircles.php
TrustCircles.getKarma
function getKarma($circle, $player) { if(!$circle) { throw new Exception('Invalid circle'); } if(!$player) { throw new Exception('Invalid player'); } return $this->execute('GET', '/trust/%s/karma/%s/', array($circle, $player)); }
php
function getKarma($circle, $player) { if(!$circle) { throw new Exception('Invalid circle'); } if(!$player) { throw new Exception('Invalid player'); } return $this->execute('GET', '/trust/%s/karma/%s/', array($circle, $player)); }
[ "function", "getKarma", "(", "$", "circle", ",", "$", "player", ")", "{", "if", "(", "!", "$", "circle", ")", "{", "throw", "new", "Exception", "(", "'Invalid circle'", ")", ";", "}", "if", "(", "!", "$", "player", ")", "{", "throw", "new", "Except...
Get how many times a player has been blacklisted and whitelisted within a circle @param string $circle @param string $player @return object Numbers of blacklistings and whitelistings @throws Exception
[ "Get", "how", "many", "times", "a", "player", "has", "been", "blacklisted", "and", "whitelisted", "within", "a", "circle" ]
train
https://github.com/maniaplanet/maniaplanet-ws-sdk/blob/027a458388035fe66f2f56ff3ea1f85eff2a5a4e/libraries/Maniaplanet/WebServices/TrustCircles.php#L21-L33
redaigbaria/oauth2
examples/relational/Storage/ScopeStorage.php
ScopeStorage.get
public function get($scope, $grantType = null, $clientId = null) { $result = Capsule::table('oauth_scopes') ->where('id', $scope) ->get(); if (count($result) === 0) { return; } return (new ScopeEntity($this...
php
public function get($scope, $grantType = null, $clientId = null) { $result = Capsule::table('oauth_scopes') ->where('id', $scope) ->get(); if (count($result) === 0) { return; } return (new ScopeEntity($this...
[ "public", "function", "get", "(", "$", "scope", ",", "$", "grantType", "=", "null", ",", "$", "clientId", "=", "null", ")", "{", "$", "result", "=", "Capsule", "::", "table", "(", "'oauth_scopes'", ")", "->", "where", "(", "'id'", ",", "$", "scope", ...
{@inheritdoc}
[ "{" ]
train
https://github.com/redaigbaria/oauth2/blob/54cca4aaaff6a095cbf1c8010f2fe2cc7de4e45a/examples/relational/Storage/ScopeStorage.php#L15-L29
yuncms/framework
src/widgets/MultipleUpload.php
MultipleUpload.formatAttachment
protected function formatAttachment($attachment) { if (!empty($attachment) && is_string($attachment)) { return ['url' => $attachment, 'path' => $attachment,]; } else if (is_array($attachment)) { return $attachment; } else if ($attachment instanceof Arrayable) ...
php
protected function formatAttachment($attachment) { if (!empty($attachment) && is_string($attachment)) { return ['url' => $attachment, 'path' => $attachment,]; } else if (is_array($attachment)) { return $attachment; } else if ($attachment instanceof Arrayable) ...
[ "protected", "function", "formatAttachment", "(", "$", "attachment", ")", "{", "if", "(", "!", "empty", "(", "$", "attachment", ")", "&&", "is_string", "(", "$", "attachment", ")", ")", "{", "return", "[", "'url'", "=>", "$", "attachment", ",", "'path'",...
格式化附件 @param $attachment @return array
[ "格式化附件" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/widgets/MultipleUpload.php#L160-L169
yuncms/framework
src/widgets/MultipleUpload.php
MultipleUpload.registerClientScript
public function registerClientScript() { Html::addCssClass($this->wrapperOptions, "upload-kit"); UploadAsset::register($this->getView()); if ($this->sortable) { JuiAsset::register($this->getView()); } $options = Json::encode($this->clientOptions); $this->g...
php
public function registerClientScript() { Html::addCssClass($this->wrapperOptions, "upload-kit"); UploadAsset::register($this->getView()); if ($this->sortable) { JuiAsset::register($this->getView()); } $options = Json::encode($this->clientOptions); $this->g...
[ "public", "function", "registerClientScript", "(", ")", "{", "Html", "::", "addCssClass", "(", "$", "this", "->", "wrapperOptions", ",", "\"upload-kit\"", ")", ";", "UploadAsset", "::", "register", "(", "$", "this", "->", "getView", "(", ")", ")", ";", "if...
Registers required script for the plugin to work as jQuery File Uploader
[ "Registers", "required", "script", "for", "the", "plugin", "to", "work", "as", "jQuery", "File", "Uploader" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/widgets/MultipleUpload.php#L192-L201
yuncms/framework
src/oauth2/grant/types/WeChatMiniCredentials.php
WeChatMiniCredentials.init
public function init() { parent::init(); if (!Yii::$app->has('wechat')) { throw new InvalidConfigException("Unknown component ID: wechat."); } $this->wechat = Yii::$app->wechat; }
php
public function init() { parent::init(); if (!Yii::$app->has('wechat')) { throw new InvalidConfigException("Unknown component ID: wechat."); } $this->wechat = Yii::$app->wechat; }
[ "public", "function", "init", "(", ")", "{", "parent", "::", "init", "(", ")", ";", "if", "(", "!", "Yii", "::", "$", "app", "->", "has", "(", "'wechat'", ")", ")", "{", "throw", "new", "InvalidConfigException", "(", "\"Unknown component ID: wechat.\"", ...
初始化模型 @throws InvalidConfigException
[ "初始化模型" ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/oauth2/grant/types/WeChatMiniCredentials.php#L85-L92
yuncms/framework
src/admin/controllers/UserRuleController.php
UserRuleController.actionCreate
public function actionCreate() { $model = new UserBizRule(null); if ($model->load(Yii::$app->request->post()) && $model->save()) { UserRBACHelper::invalidate(); Yii::$app->getSession()->setFlash('success', Yii::t('yuncms','Create success.')); return $this->redirec...
php
public function actionCreate() { $model = new UserBizRule(null); if ($model->load(Yii::$app->request->post()) && $model->save()) { UserRBACHelper::invalidate(); Yii::$app->getSession()->setFlash('success', Yii::t('yuncms','Create success.')); return $this->redirec...
[ "public", "function", "actionCreate", "(", ")", "{", "$", "model", "=", "new", "UserBizRule", "(", "null", ")", ";", "if", "(", "$", "model", "->", "load", "(", "Yii", "::", "$", "app", "->", "request", "->", "post", "(", ")", ")", "&&", "$", "mo...
Creates a new AuthItem model. If creation is successful, the browser will be redirected to the 'view' page. @return mixed @throws \Exception
[ "Creates", "a", "new", "AuthItem", "model", ".", "If", "creation", "is", "successful", "the", "browser", "will", "be", "redirected", "to", "the", "view", "page", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/controllers/UserRuleController.php#L71-L81
yuncms/framework
src/admin/controllers/UserRuleController.php
UserRuleController.findModel
protected function findModel($id) { $item = UserRBACHelper::getAuthManager()->getRule($id); if ($item) { return new UserBizRule($item); } else { throw new NotFoundHttpException(Yii::t('yuncms', 'The requested page does not exist.')); } }
php
protected function findModel($id) { $item = UserRBACHelper::getAuthManager()->getRule($id); if ($item) { return new UserBizRule($item); } else { throw new NotFoundHttpException(Yii::t('yuncms', 'The requested page does not exist.')); } }
[ "protected", "function", "findModel", "(", "$", "id", ")", "{", "$", "item", "=", "UserRBACHelper", "::", "getAuthManager", "(", ")", "->", "getRule", "(", "$", "id", ")", ";", "if", "(", "$", "item", ")", "{", "return", "new", "UserBizRule", "(", "$...
Finds the AuthItem model based on its primary key value. If the model is not found, a 404 HTTP exception will be thrown. @param string $id @return UserBizRule the loaded model @throws NotFoundHttpException if the model cannot be found @throws \yii\base\InvalidConfigException
[ "Finds", "the", "AuthItem", "model", "based", "on", "its", "primary", "key", "value", ".", "If", "the", "model", "is", "not", "found", "a", "404", "HTTP", "exception", "will", "be", "thrown", "." ]
train
https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/admin/controllers/UserRuleController.php#L128-L136
ufocoder/yii2-SyncSocial
src/components/services/Facebook.php
Facebook.publishPost
public function publishPost( $message, $url = null ) { $response = $this->service->api( 'me/feed', 'POST', [ 'message' => $message, ] ); if ( ! isset( $response['id'] ) ) { return [ ]; } return $this->parsePublishPost( $this->service->api( $...
php
public function publishPost( $message, $url = null ) { $response = $this->service->api( 'me/feed', 'POST', [ 'message' => $message, ] ); if ( ! isset( $response['id'] ) ) { return [ ]; } return $this->parsePublishPost( $this->service->api( $...
[ "public", "function", "publishPost", "(", "$", "message", ",", "$", "url", "=", "null", ")", "{", "$", "response", "=", "$", "this", "->", "service", "->", "api", "(", "'me/feed'", ",", "'POST'", ",", "[", "'message'", "=>", "$", "message", ",", "]",...
@param $message @param null $url @return array @throws \yii\base\Exception
[ "@param", "$message", "@param", "null", "$url" ]
train
https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/services/Facebook.php#L32-L51
webforge-labs/psc-cms
lib/Psc/Doctrine/PersistentCollectionSynchronizer.php
PersistentCollectionSynchronizer.createFor
public static function createFor($entityClass, $collectionPropertyName, DCPackage $dc) { $entityMeta = $dc->getEntityMeta($entityClass); $property = $entityMeta->getPropertyMeta($collectionPropertyName); $collectionClass = $property->getRelationEntityClass(); $synchronizer = new static( ...
php
public static function createFor($entityClass, $collectionPropertyName, DCPackage $dc) { $entityMeta = $dc->getEntityMeta($entityClass); $property = $entityMeta->getPropertyMeta($collectionPropertyName); $collectionClass = $property->getRelationEntityClass(); $synchronizer = new static( ...
[ "public", "static", "function", "createFor", "(", "$", "entityClass", ",", "$", "collectionPropertyName", ",", "DCPackage", "$", "dc", ")", "{", "$", "entityMeta", "=", "$", "dc", "->", "getEntityMeta", "(", "$", "entityClass", ")", ";", "$", "property", "...
Erstellt einen Synchronizer für das $collectionPropertyName in $entityClass @return PersistentCollectionSynchronizer
[ "Erstellt", "einen", "Synchronizer", "für", "das", "$collectionPropertyName", "in", "$entityClass" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/PersistentCollectionSynchronizer.php#L49-L62
webforge-labs/psc-cms
lib/Psc/Doctrine/PersistentCollectionSynchronizer.php
PersistentCollectionSynchronizer.init
public function init(Entity $entity) { parent::init($entity); $hydrator = $this->hydrator; $factory = $this->factory; $repository = $hydrator->getRepository(); $identifier = $factory->getEntityMeta()->getIdentifier(); $skipFields = array(); if ($identifier->isAutogeneratedValue(...
php
public function init(Entity $entity) { parent::init($entity); $hydrator = $this->hydrator; $factory = $this->factory; $repository = $hydrator->getRepository(); $identifier = $factory->getEntityMeta()->getIdentifier(); $skipFields = array(); if ($identifier->isAutogeneratedValue(...
[ "public", "function", "init", "(", "Entity", "$", "entity", ")", "{", "parent", "::", "init", "(", "$", "entity", ")", ";", "$", "hydrator", "=", "$", "this", "->", "hydrator", ";", "$", "factory", "=", "$", "this", "->", "factory", ";", "$", "repo...
Initialisiert die Defaults für alle on* Methoden für das Entity mit der Collection ein CollectionSynchronizer kann mehrere Collections eines Types von mehreren Entities synchronisieren wenn jeweils init() für das aktuelle Entity aufgerufen wird new Synchronizer(); foreach ($articles as $article) { $synchronizer->init...
[ "Initialisiert", "die", "Defaults", "für", "alle", "on", "*", "Methoden", "für", "das", "Entity", "mit", "der", "Collection" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/PersistentCollectionSynchronizer.php#L76-L135
NasExt/VisualPaginator
src/NasExt/Controls/VisualPaginator.php
VisualPaginator.render
public function render() { $paginator = $this->getPaginator(); $page = $paginator->page; if ($paginator->pageCount < 2) { $steps = array($page); } else { $arr = range(max($paginator->firstPage, $page - 3), min($paginator->lastPage, $page + 3)); if ($this->countBlocks) { $quotient = ($paginator->pa...
php
public function render() { $paginator = $this->getPaginator(); $page = $paginator->page; if ($paginator->pageCount < 2) { $steps = array($page); } else { $arr = range(max($paginator->firstPage, $page - 3), min($paginator->lastPage, $page + 3)); if ($this->countBlocks) { $quotient = ($paginator->pa...
[ "public", "function", "render", "(", ")", "{", "$", "paginator", "=", "$", "this", "->", "getPaginator", "(", ")", ";", "$", "page", "=", "$", "paginator", "->", "page", ";", "if", "(", "$", "paginator", "->", "pageCount", "<", "2", ")", "{", "$", ...
Renders paginator. @return void
[ "Renders", "paginator", "." ]
train
https://github.com/NasExt/VisualPaginator/blob/cd03481be6a9074883716f5354293c5cd0f7da84/src/NasExt/Controls/VisualPaginator.php#L125-L150
webforge-labs/psc-cms
lib/PHPWord/PHPWord.php
PHPWord.createSection
public function createSection($settings = null) { $sectionCount = $this->_countSections() + 1; $section = new PHPWord_Section($sectionCount, $settings); $this->_sectionCollection[] = $section; return $section; }
php
public function createSection($settings = null) { $sectionCount = $this->_countSections() + 1; $section = new PHPWord_Section($sectionCount, $settings); $this->_sectionCollection[] = $section; return $section; }
[ "public", "function", "createSection", "(", "$", "settings", "=", "null", ")", "{", "$", "sectionCount", "=", "$", "this", "->", "_countSections", "(", ")", "+", "1", ";", "$", "section", "=", "new", "PHPWord_Section", "(", "$", "sectionCount", ",", "$",...
Create a new Section @param PHPWord_Section_Settings $settings @return PHPWord_Section
[ "Create", "a", "new", "Section" ]
train
https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord.php#L100-L106