id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
200,100 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Expression/Expr.php | Expr.not | public function not(Expr $subexpression)
{
$not = new Condition\Logical\Not;
$not->add($subexpression->condition);
return $this;
} | php | public function not(Expr $subexpression)
{
$not = new Condition\Logical\Not;
$not->add($subexpression->condition);
return $this;
} | [
"public",
"function",
"not",
"(",
"Expr",
"$",
"subexpression",
")",
"{",
"$",
"not",
"=",
"new",
"Condition",
"\\",
"Logical",
"\\",
"Not",
";",
"$",
"not",
"->",
"add",
"(",
"$",
"subexpression",
"->",
"condition",
")",
";",
"return",
"$",
"this",
... | Add a NOT clause to the expression.
@see QueryBuilder::not()
@param Expr $subexpression
@return QueryBuilder|$this | [
"Add",
"a",
"NOT",
"clause",
"to",
"the",
"expression",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Expression/Expr.php#L212-L218 |
200,101 | cloudtek/dynamodm | lib/Cloudtek/DynamoDM/Expression/Expr.php | Expr.value | public function value($value)
{
if (!$value instanceof Operand\OperandInterface && !$value instanceof Update\Func) {
$value = new Operand\Value($this, $value);
}
return $value;
} | php | public function value($value)
{
if (!$value instanceof Operand\OperandInterface && !$value instanceof Update\Func) {
$value = new Operand\Value($this, $value);
}
return $value;
} | [
"public",
"function",
"value",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"value",
"instanceof",
"Operand",
"\\",
"OperandInterface",
"&&",
"!",
"$",
"value",
"instanceof",
"Update",
"\\",
"Func",
")",
"{",
"$",
"value",
"=",
"new",
"Operand",
"... | Return a value object, used for building an expression.
@param Operand\OperandInterface|Update\Func|mixed $value
@return Operand\Value|Operand\OperandInterface|Update\Func|mixed | [
"Return",
"a",
"value",
"object",
"used",
"for",
"building",
"an",
"expression",
"."
] | 119d355e2c5cbaef1f867970349b4432f5704fcd | https://github.com/cloudtek/dynamodm/blob/119d355e2c5cbaef1f867970349b4432f5704fcd/lib/Cloudtek/DynamoDM/Expression/Expr.php#L227-L234 |
200,102 | mermshaus/kaloa-renderer | src/Inigo/Parser.php | Parser.getNextTag | private function getNextTag(&$s, $i, &$position)
{
$j = mb_strpos($s, '[', $i);
$k = mb_strpos($s, ']', $j + 1);
if ($j === false || $k === false) {
$position = false;
return null;
}
$t = mb_substr($s, $j + 1, $k - ($j + 1));
$l = mb_strrpos(... | php | private function getNextTag(&$s, $i, &$position)
{
$j = mb_strpos($s, '[', $i);
$k = mb_strpos($s, ']', $j + 1);
if ($j === false || $k === false) {
$position = false;
return null;
}
$t = mb_substr($s, $j + 1, $k - ($j + 1));
$l = mb_strrpos(... | [
"private",
"function",
"getNextTag",
"(",
"&",
"$",
"s",
",",
"$",
"i",
",",
"&",
"$",
"position",
")",
"{",
"$",
"j",
"=",
"mb_strpos",
"(",
"$",
"s",
",",
"'['",
",",
"$",
"i",
")",
";",
"$",
"k",
"=",
"mb_strpos",
"(",
"$",
"s",
",",
"']... | Gets the next tag
@param string $s String to parse
@param int $i Offset where search begins
@param int $position Will be filled with next tag's offset (FALSE if
there are no more tags)
@return Tag | [
"Gets",
"the",
"next",
"tag"
] | ece78bfa1d5cec75a1409759e1f944b8c47d2aac | https://github.com/mermshaus/kaloa-renderer/blob/ece78bfa1d5cec75a1409759e1f944b8c47d2aac/src/Inigo/Parser.php#L193-L215 |
200,103 | mermshaus/kaloa-renderer | src/Inigo/Parser.php | Parser.formatString | private function formatString($s)
{
static $last_tag = null;
if ($this->m_stack->count() > 0
&& $this->m_stack->top()->isOfType(self::TAG_PRE)
) {
// Do not format text inside of TAG_PRE tags
return $s;
}
/*
* TODO Replace doubl... | php | private function formatString($s)
{
static $last_tag = null;
if ($this->m_stack->count() > 0
&& $this->m_stack->top()->isOfType(self::TAG_PRE)
) {
// Do not format text inside of TAG_PRE tags
return $s;
}
/*
* TODO Replace doubl... | [
"private",
"function",
"formatString",
"(",
"$",
"s",
")",
"{",
"static",
"$",
"last_tag",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"m_stack",
"->",
"count",
"(",
")",
">",
"0",
"&&",
"$",
"this",
"->",
"m_stack",
"->",
"top",
"(",
")",
"-... | Formats small pieces of CDATA
@param string $s
@return string | [
"Formats",
"small",
"pieces",
"of",
"CDATA"
] | ece78bfa1d5cec75a1409759e1f944b8c47d2aac | https://github.com/mermshaus/kaloa-renderer/blob/ece78bfa1d5cec75a1409759e1f944b8c47d2aac/src/Inigo/Parser.php#L409-L460 |
200,104 | mermshaus/kaloa-renderer | src/Inigo/Parser.php | Parser.printCData | private function printCData(&$cdata, $outline = false)
{
$cdata = trim($cdata);
$ret = '';
/*$t = '';
if ($outline) {
//echo $tag->getName();
$t = ' yes';
}*/
if ($cdata === '') {
return $ret;
}
//$e = function (... | php | private function printCData(&$cdata, $outline = false)
{
$cdata = trim($cdata);
$ret = '';
/*$t = '';
if ($outline) {
//echo $tag->getName();
$t = ' yes';
}*/
if ($cdata === '') {
return $ret;
}
//$e = function (... | [
"private",
"function",
"printCData",
"(",
"&",
"$",
"cdata",
",",
"$",
"outline",
"=",
"false",
")",
"{",
"$",
"cdata",
"=",
"trim",
"(",
"$",
"cdata",
")",
";",
"$",
"ret",
"=",
"''",
";",
"/*$t = '';\n\n if ($outline) {\n //echo $tag->getNa... | Formats whole blocks of CDATA
@param string $cdata
@param boolean $outline
@return string | [
"Formats",
"whole",
"blocks",
"of",
"CDATA"
] | ece78bfa1d5cec75a1409759e1f944b8c47d2aac | https://github.com/mermshaus/kaloa-renderer/blob/ece78bfa1d5cec75a1409759e1f944b8c47d2aac/src/Inigo/Parser.php#L469-L534 |
200,105 | pdscopes/php-arrays | src/Collection.php | Collection.nth | public function nth($position)
{
if ($position < 0) {
$position = $this->count() + $position;
}
if ($position < 0 || $this->count() < $position) {
throw new \InvalidArgumentException('Invalid Position');
}
$slice = array_slice($this->items, $position,... | php | public function nth($position)
{
if ($position < 0) {
$position = $this->count() + $position;
}
if ($position < 0 || $this->count() < $position) {
throw new \InvalidArgumentException('Invalid Position');
}
$slice = array_slice($this->items, $position,... | [
"public",
"function",
"nth",
"(",
"$",
"position",
")",
"{",
"if",
"(",
"$",
"position",
"<",
"0",
")",
"{",
"$",
"position",
"=",
"$",
"this",
"->",
"count",
"(",
")",
"+",
"$",
"position",
";",
"}",
"if",
"(",
"$",
"position",
"<",
"0",
"||",... | Get the nth item in the collection.
@param int $position
@return mixed | [
"Get",
"the",
"nth",
"item",
"in",
"the",
"collection",
"."
] | 4648ef6d34a63682f4cb367716ba7c205b60ae1f | https://github.com/pdscopes/php-arrays/blob/4648ef6d34a63682f4cb367716ba7c205b60ae1f/src/Collection.php#L87-L98 |
200,106 | pdscopes/php-arrays | src/Collection.php | Collection.implode | public function implode($glue = '', callable $callback = null)
{
return implode($glue, $callback ? array_map($callback, $this->items) : $this->items);
} | php | public function implode($glue = '', callable $callback = null)
{
return implode($glue, $callback ? array_map($callback, $this->items) : $this->items);
} | [
"public",
"function",
"implode",
"(",
"$",
"glue",
"=",
"''",
",",
"callable",
"$",
"callback",
"=",
"null",
")",
"{",
"return",
"implode",
"(",
"$",
"glue",
",",
"$",
"callback",
"?",
"array_map",
"(",
"$",
"callback",
",",
"$",
"this",
"->",
"items... | Implode the collection values.
@see implode()
@param string $glue
@param callable|null $callback
@return string | [
"Implode",
"the",
"collection",
"values",
"."
] | 4648ef6d34a63682f4cb367716ba7c205b60ae1f | https://github.com/pdscopes/php-arrays/blob/4648ef6d34a63682f4cb367716ba7c205b60ae1f/src/Collection.php#L349-L352 |
200,107 | phpffcms/ffcms-core | src/Exception/TemplateException.php | TemplateException.display | public function display()
{
// hide path root and stip tags from exception message
$msg = Str::replace(root, '$DOCUMENT_ROOT', $this->getMessage());
$msg = App::$Security->strip_tags($msg);
// get message translation
$this->text = App::$Translate->get('Default', $this->text, ... | php | public function display()
{
// hide path root and stip tags from exception message
$msg = Str::replace(root, '$DOCUMENT_ROOT', $this->getMessage());
$msg = App::$Security->strip_tags($msg);
// get message translation
$this->text = App::$Translate->get('Default', $this->text, ... | [
"public",
"function",
"display",
"(",
")",
"{",
"// hide path root and stip tags from exception message",
"$",
"msg",
"=",
"Str",
"::",
"replace",
"(",
"root",
",",
"'$DOCUMENT_ROOT'",
",",
"$",
"this",
"->",
"getMessage",
"(",
")",
")",
";",
"$",
"msg",
"=",
... | Display exception template
@return string | [
"Display",
"exception",
"template"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Exception/TemplateException.php#L20-L44 |
200,108 | phpffcms/ffcms-core | src/Exception/TemplateException.php | TemplateException.buildFakePage | protected function buildFakePage()
{
try {
$rawResponse = App::$View->render('_core/exceptions/' . $this->tpl, ['msg' => $this->text]);
if (Str::likeEmpty($rawResponse)) {
$rawResponse = $this->text;
}
} catch (\Exception $e) {
$rawResp... | php | protected function buildFakePage()
{
try {
$rawResponse = App::$View->render('_core/exceptions/' . $this->tpl, ['msg' => $this->text]);
if (Str::likeEmpty($rawResponse)) {
$rawResponse = $this->text;
}
} catch (\Exception $e) {
$rawResp... | [
"protected",
"function",
"buildFakePage",
"(",
")",
"{",
"try",
"{",
"$",
"rawResponse",
"=",
"App",
"::",
"$",
"View",
"->",
"render",
"(",
"'_core/exceptions/'",
".",
"$",
"this",
"->",
"tpl",
",",
"[",
"'msg'",
"=>",
"$",
"this",
"->",
"text",
"]",
... | Build fake page with error based on fake controller initiation | [
"Build",
"fake",
"page",
"with",
"error",
"based",
"on",
"fake",
"controller",
"initiation"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Exception/TemplateException.php#L49-L63 |
200,109 | spoom-php/core | src/extension/Event.php | Event.emitter | public static function emitter(): EmitterInterface {
if( !isset( self::$emitter_map[ static::class ] ) ) {
// this should find the first subclass after the `Event`. Get the parent list (it's sorted from the latest parent, so we have to reverse it), and select the one after the `Event` baseclass
$class... | php | public static function emitter(): EmitterInterface {
if( !isset( self::$emitter_map[ static::class ] ) ) {
// this should find the first subclass after the `Event`. Get the parent list (it's sorted from the latest parent, so we have to reverse it), and select the one after the `Event` baseclass
$class... | [
"public",
"static",
"function",
"emitter",
"(",
")",
":",
"EmitterInterface",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"emitter_map",
"[",
"static",
"::",
"class",
"]",
")",
")",
"{",
"// this should find the first subclass after the `Event`. Get the ... | Get the event's emitter, to manipulate callbacks for the event | [
"Get",
"the",
"event",
"s",
"emitter",
"to",
"manipulate",
"callbacks",
"for",
"the",
"event"
] | ea7184213352fa2fad7636927a019e5798734e04 | https://github.com/spoom-php/core/blob/ea7184213352fa2fad7636927a019e5798734e04/src/extension/Event.php#L74-L86 |
200,110 | t3v/t3v_core | Classes/Utility/Page/BodyTagUtility.php | BodyTagUtility.build | public function build(string $bodyCssClass = self::DEFAULT_BODY_CSS_CLASS): string {
$page = $this->pageService->getCurrentPage();
$backendLayout = $this->pageService->getBackendLayoutForPage($page['uid']);
if (!empty($backendLayout)) {
$bodyCssClass = "{$backendLayout} {$bodyCssClass}";
... | php | public function build(string $bodyCssClass = self::DEFAULT_BODY_CSS_CLASS): string {
$page = $this->pageService->getCurrentPage();
$backendLayout = $this->pageService->getBackendLayoutForPage($page['uid']);
if (!empty($backendLayout)) {
$bodyCssClass = "{$backendLayout} {$bodyCssClass}";
... | [
"public",
"function",
"build",
"(",
"string",
"$",
"bodyCssClass",
"=",
"self",
"::",
"DEFAULT_BODY_CSS_CLASS",
")",
":",
"string",
"{",
"$",
"page",
"=",
"$",
"this",
"->",
"pageService",
"->",
"getCurrentPage",
"(",
")",
";",
"$",
"backendLayout",
"=",
"... | Builds a body tag.
@param string $bodyCssClass The CSS class of the body tag, defaults to `BodyTagUtility::DEFAULT_BODY_CSS_CLASS`
@return string The body tag | [
"Builds",
"a",
"body",
"tag",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/Page/BodyTagUtility.php#L40-L49 |
200,111 | freialib/ran.tools | src/Trait/Meta.php | MetaTrait.addmeta | function addmeta($name, $values = null) {
if ($values != null) {
foreach ($values as $value) {
$this->add($name, $value);
}
}
return $this;
} | php | function addmeta($name, $values = null) {
if ($values != null) {
foreach ($values as $value) {
$this->add($name, $value);
}
}
return $this;
} | [
"function",
"addmeta",
"(",
"$",
"name",
",",
"$",
"values",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"values",
"!=",
"null",
")",
"{",
"foreach",
"(",
"$",
"values",
"as",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"name",
",",
... | Convenient way to add multiple meta attributes in a single call.
Roughly equivalent to calling foreach on $values and performing add.
@return static $this | [
"Convenient",
"way",
"to",
"add",
"multiple",
"meta",
"attributes",
"in",
"a",
"single",
"call",
"."
] | f4cbb926ef54da357b102cbfa4b6ce273be6ce63 | https://github.com/freialib/ran.tools/blob/f4cbb926ef54da357b102cbfa4b6ce273be6ce63/src/Trait/Meta.php#L58-L66 |
200,112 | johnkrovitch/SamBundle | src/Watcher/Indexer/FileIndexer.php | FileIndexer.add | public function add(SplFileInfo $splFileInfo)
{
$fileSystem = new Filesystem();
if (!$fileSystem->exists($splFileInfo->getRealPath())) {
throw new Exception('Trying to add '.$splFileInfo->getRealPath().' missing file to the index');
}
// if the file is already present i... | php | public function add(SplFileInfo $splFileInfo)
{
$fileSystem = new Filesystem();
if (!$fileSystem->exists($splFileInfo->getRealPath())) {
throw new Exception('Trying to add '.$splFileInfo->getRealPath().' missing file to the index');
}
// if the file is already present i... | [
"public",
"function",
"add",
"(",
"SplFileInfo",
"$",
"splFileInfo",
")",
"{",
"$",
"fileSystem",
"=",
"new",
"Filesystem",
"(",
")",
";",
"if",
"(",
"!",
"$",
"fileSystem",
"->",
"exists",
"(",
"$",
"splFileInfo",
"->",
"getRealPath",
"(",
")",
")",
"... | Add an entry to the indexer. If a entry already exists, it will also be added to the changes.
@param SplFileInfo $splFileInfo
@throws Exception | [
"Add",
"an",
"entry",
"to",
"the",
"indexer",
".",
"If",
"a",
"entry",
"already",
"exists",
"it",
"will",
"also",
"be",
"added",
"to",
"the",
"changes",
"."
] | 6cc08ef2dd8f7cd5c33ee27818edd4697afa435e | https://github.com/johnkrovitch/SamBundle/blob/6cc08ef2dd8f7cd5c33ee27818edd4697afa435e/src/Watcher/Indexer/FileIndexer.php#L70-L85 |
200,113 | pluf/discount | src/Discount/Views/Discount.php | Discount_Views_Discount.getDiscountByCode | public static function getDiscountByCode($request, $code)
{
$discount = Discount_Shortcuts_GetDiscountByCodeOr404($code);
$discountEngine = $discount->get_engine();
$validationCode = $discountEngine->validate($discount, $request);
$discount->__set('validation_code', $validationCode);... | php | public static function getDiscountByCode($request, $code)
{
$discount = Discount_Shortcuts_GetDiscountByCodeOr404($code);
$discountEngine = $discount->get_engine();
$validationCode = $discountEngine->validate($discount, $request);
$discount->__set('validation_code', $validationCode);... | [
"public",
"static",
"function",
"getDiscountByCode",
"(",
"$",
"request",
",",
"$",
"code",
")",
"{",
"$",
"discount",
"=",
"Discount_Shortcuts_GetDiscountByCodeOr404",
"(",
"$",
"code",
")",
";",
"$",
"discountEngine",
"=",
"$",
"discount",
"->",
"get_engine",
... | Returns tag with given name.
@param Pluf_HTTP_Request $request
@param string $code
@return Discount_Discount | [
"Returns",
"tag",
"with",
"given",
"name",
"."
] | b0006d6b25dd61241f51b5b098d7d546b470de26 | https://github.com/pluf/discount/blob/b0006d6b25dd61241f51b5b098d7d546b470de26/src/Discount/Views/Discount.php#L50-L60 |
200,114 | chalasr/RCHCapistranoBundle | Util/LocalizableTrait.php | LocalizableTrait.getBundleVendorDir | public function getBundleVendorDir()
{
$psr4Path = $this->getRootDir().'/../vendor/rch/capistrano-bundle';
$psr0Path = $psr4Path.'/RCH/CapistranoBundle';
if (is_dir($psr0Path)) {
return $psr0Path;
}
return $psr4Path;
} | php | public function getBundleVendorDir()
{
$psr4Path = $this->getRootDir().'/../vendor/rch/capistrano-bundle';
$psr0Path = $psr4Path.'/RCH/CapistranoBundle';
if (is_dir($psr0Path)) {
return $psr0Path;
}
return $psr4Path;
} | [
"public",
"function",
"getBundleVendorDir",
"(",
")",
"{",
"$",
"psr4Path",
"=",
"$",
"this",
"->",
"getRootDir",
"(",
")",
".",
"'/../vendor/rch/capistrano-bundle'",
";",
"$",
"psr0Path",
"=",
"$",
"psr4Path",
".",
"'/RCH/CapistranoBundle'",
";",
"if",
"(",
"... | Get bundle directory.
@return string | [
"Get",
"bundle",
"directory",
"."
] | c4a4cbaa2bc05f33bf431fd3afe6cac39947640e | https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Util/LocalizableTrait.php#L38-L48 |
200,115 | chalasr/RCHCapistranoBundle | Util/LocalizableTrait.php | LocalizableTrait.getContainer | public function getContainer()
{
if (property_exists(__CLASS__, 'container')) {
return $this->container;
} else {
return parent::getContainer();
}
throw new RuntimeException(sprintf('The service container must be accessible from class %s to use this trait', _... | php | public function getContainer()
{
if (property_exists(__CLASS__, 'container')) {
return $this->container;
} else {
return parent::getContainer();
}
throw new RuntimeException(sprintf('The service container must be accessible from class %s to use this trait', _... | [
"public",
"function",
"getContainer",
"(",
")",
"{",
"if",
"(",
"property_exists",
"(",
"__CLASS__",
",",
"'container'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"container",
";",
"}",
"else",
"{",
"return",
"parent",
"::",
"getContainer",
"(",
")",
"... | Get the Service Container.
@return \Symfony\Component\DependencyInjection\ContainerInterface
@throws RuntimeException If the service container is not accessible | [
"Get",
"the",
"Service",
"Container",
"."
] | c4a4cbaa2bc05f33bf431fd3afe6cac39947640e | https://github.com/chalasr/RCHCapistranoBundle/blob/c4a4cbaa2bc05f33bf431fd3afe6cac39947640e/Util/LocalizableTrait.php#L97-L106 |
200,116 | railken/lem | src/Manager.php | Manager.setAgent | public function setAgent(AgentContract $agent = null)
{
if (!$agent) {
$agent = new Agents\SystemAgent();
}
$this->agent = $agent;
return $this;
} | php | public function setAgent(AgentContract $agent = null)
{
if (!$agent) {
$agent = new Agents\SystemAgent();
}
$this->agent = $agent;
return $this;
} | [
"public",
"function",
"setAgent",
"(",
"AgentContract",
"$",
"agent",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"agent",
")",
"{",
"$",
"agent",
"=",
"new",
"Agents",
"\\",
"SystemAgent",
"(",
")",
";",
"}",
"$",
"this",
"->",
"agent",
"=",
"$",
... | set agent.
@param AgentContract $agent
@return $this | [
"set",
"agent",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Manager.php#L257-L266 |
200,117 | railken/lem | src/Manager.php | Manager.create | public function create($parameters)
{
return $this->update($this->repository->newEntity(), $parameters, Tokens::PERMISSION_CREATE);
} | php | public function create($parameters)
{
return $this->update($this->repository->newEntity(), $parameters, Tokens::PERMISSION_CREATE);
} | [
"public",
"function",
"create",
"(",
"$",
"parameters",
")",
"{",
"return",
"$",
"this",
"->",
"update",
"(",
"$",
"this",
"->",
"repository",
"->",
"newEntity",
"(",
")",
",",
"$",
"parameters",
",",
"Tokens",
"::",
"PERMISSION_CREATE",
")",
";",
"}"
] | Create a new EntityContract given parameters.
@param Bag|array $parameters
@return ResultContract | [
"Create",
"a",
"new",
"EntityContract",
"given",
"parameters",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Manager.php#L297-L300 |
200,118 | railken/lem | src/Manager.php | Manager.update | public function update(EntityContract $entity, $parameters, $permission = Tokens::PERMISSION_UPDATE)
{
$parameters = $this->castParameters($parameters);
$result = new Result();
try {
DB::beginTransaction();
$result->addErrors($this->getAuthorizer()->authorize($perm... | php | public function update(EntityContract $entity, $parameters, $permission = Tokens::PERMISSION_UPDATE)
{
$parameters = $this->castParameters($parameters);
$result = new Result();
try {
DB::beginTransaction();
$result->addErrors($this->getAuthorizer()->authorize($perm... | [
"public",
"function",
"update",
"(",
"EntityContract",
"$",
"entity",
",",
"$",
"parameters",
",",
"$",
"permission",
"=",
"Tokens",
"::",
"PERMISSION_UPDATE",
")",
"{",
"$",
"parameters",
"=",
"$",
"this",
"->",
"castParameters",
"(",
"$",
"parameters",
")"... | Update a EntityContract given parameters.
@param \Railken\Lem\Contracts\EntityContract $entity
@param Bag|array $parameters
@param string $permission
@return ResultContract | [
"Update",
"a",
"EntityContract",
"given",
"parameters",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Manager.php#L311-L350 |
200,119 | railken/lem | src/Manager.php | Manager.fill | public function fill(EntityContract $entity, $parameters)
{
$result = new Result();
foreach ($this->getAttributes() as $attribute) {
$result->addErrors($attribute->update($entity, $parameters));
}
return $result;
} | php | public function fill(EntityContract $entity, $parameters)
{
$result = new Result();
foreach ($this->getAttributes() as $attribute) {
$result->addErrors($attribute->update($entity, $parameters));
}
return $result;
} | [
"public",
"function",
"fill",
"(",
"EntityContract",
"$",
"entity",
",",
"$",
"parameters",
")",
"{",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAttributes",
"(",
")",
"as",
"$",
"attribute",
")",
"{",
... | Fill entity.
@param EntityContract $entity
@param Bag|array $parameters
@return Result | [
"Fill",
"entity",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Manager.php#L360-L369 |
200,120 | railken/lem | src/Manager.php | Manager.save | public function save(EntityContract $entity)
{
$result = new Result();
$saving = $entity->save();
foreach ($this->getAttributes() as $attribute) {
$result->addErrors($attribute->save($entity));
}
return $result;
} | php | public function save(EntityContract $entity)
{
$result = new Result();
$saving = $entity->save();
foreach ($this->getAttributes() as $attribute) {
$result->addErrors($attribute->save($entity));
}
return $result;
} | [
"public",
"function",
"save",
"(",
"EntityContract",
"$",
"entity",
")",
"{",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"$",
"saving",
"=",
"$",
"entity",
"->",
"save",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getAttributes",
"(",... | Save the entity.
@param \Railken\Lem\Contracts\EntityContract $entity
@return Result | [
"Save",
"the",
"entity",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Manager.php#L378-L389 |
200,121 | railken/lem | src/Manager.php | Manager.delete | public function delete(EntityContract $entity)
{
$result = new Result();
$result->addErrors($this->authorizer->authorize(Tokens::PERMISSION_REMOVE, $entity, Bag::factory([])));
if (!$result->ok()) {
return $result;
}
try {
DB::beginTransaction();
... | php | public function delete(EntityContract $entity)
{
$result = new Result();
$result->addErrors($this->authorizer->authorize(Tokens::PERMISSION_REMOVE, $entity, Bag::factory([])));
if (!$result->ok()) {
return $result;
}
try {
DB::beginTransaction();
... | [
"public",
"function",
"delete",
"(",
"EntityContract",
"$",
"entity",
")",
"{",
"$",
"result",
"=",
"new",
"Result",
"(",
")",
";",
"$",
"result",
"->",
"addErrors",
"(",
"$",
"this",
"->",
"authorizer",
"->",
"authorize",
"(",
"Tokens",
"::",
"PERMISSIO... | Delete a EntityContract.
@param \Railken\Lem\Contracts\EntityContract $entity
@return ResultContract | [
"Delete",
"a",
"EntityContract",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Manager.php#L410-L431 |
200,122 | railken/lem | src/Manager.php | Manager.findOrCreate | public function findOrCreate($criteria, $parameters = null)
{
if ($criteria instanceof Bag) {
$criteria = $criteria->toArray();
}
if ($parameters === null) {
$parameters = $criteria;
}
$parameters = $this->castParameters($parameters);
$entity... | php | public function findOrCreate($criteria, $parameters = null)
{
if ($criteria instanceof Bag) {
$criteria = $criteria->toArray();
}
if ($parameters === null) {
$parameters = $criteria;
}
$parameters = $this->castParameters($parameters);
$entity... | [
"public",
"function",
"findOrCreate",
"(",
"$",
"criteria",
",",
"$",
"parameters",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"Bag",
")",
"{",
"$",
"criteria",
"=",
"$",
"criteria",
"->",
"toArray",
"(",
")",
";",
"}",
"if",
"(... | First or create.
@param Bag|array $criteria
@param Bag|array $parameters
@return ResultContract | [
"First",
"or",
"create",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Manager.php#L441-L462 |
200,123 | railken/lem | src/Manager.php | Manager.updateOrCreate | public function updateOrCreate($criteria, $parameters = null)
{
if ($criteria instanceof Bag) {
$criteria = $criteria->toArray();
}
if ($parameters === null) {
$parameters = $criteria;
}
$parameters = $this->castParameters($parameters);
$enti... | php | public function updateOrCreate($criteria, $parameters = null)
{
if ($criteria instanceof Bag) {
$criteria = $criteria->toArray();
}
if ($parameters === null) {
$parameters = $criteria;
}
$parameters = $this->castParameters($parameters);
$enti... | [
"public",
"function",
"updateOrCreate",
"(",
"$",
"criteria",
",",
"$",
"parameters",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"criteria",
"instanceof",
"Bag",
")",
"{",
"$",
"criteria",
"=",
"$",
"criteria",
"->",
"toArray",
"(",
")",
";",
"}",
"if",
... | Update or create.
@param Bag|array $criteria
@param Bag|array $parameters
@return ResultContract | [
"Update",
"or",
"create",
"."
] | cff1efcd090a9504b2faf5594121885786dea67a | https://github.com/railken/lem/blob/cff1efcd090a9504b2faf5594121885786dea67a/src/Manager.php#L472-L486 |
200,124 | joegreen88/zf1-component-validate | src/Zend/Validate/PostCode.php | Zend_Validate_PostCode.setLocale | public function setLocale($locale = null)
{
$this->_locale = Zend_Locale::findLocale($locale);
$locale = new Zend_Locale($this->_locale);
$region = $locale->getRegion();
if (empty($region)) {
throw new Zend_Validate_Exception("Unable to detect a region for... | php | public function setLocale($locale = null)
{
$this->_locale = Zend_Locale::findLocale($locale);
$locale = new Zend_Locale($this->_locale);
$region = $locale->getRegion();
if (empty($region)) {
throw new Zend_Validate_Exception("Unable to detect a region for... | [
"public",
"function",
"setLocale",
"(",
"$",
"locale",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_locale",
"=",
"Zend_Locale",
"::",
"findLocale",
"(",
"$",
"locale",
")",
";",
"$",
"locale",
"=",
"new",
"Zend_Locale",
"(",
"$",
"this",
"->",
"_locale... | Sets the locale to use
@param string|Zend_Locale $locale
@throws Zend_Validate_Exception On unrecognised region
@throws Zend_Validate_Exception On not detected format
@return Zend_Validate_PostCode Provides fluid interface | [
"Sets",
"the",
"locale",
"to",
"use"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/PostCode.php#L124-L148 |
200,125 | joegreen88/zf1-component-validate | src/Zend/Validate/PostCode.php | Zend_Validate_PostCode.setFormat | public function setFormat($format)
{
if (empty($format) || !is_string($format)) {
throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
}
if ($format[0] !== '/') {
$format = '/^' . $format;
}
if ($format[strle... | php | public function setFormat($format)
{
if (empty($format) || !is_string($format)) {
throw new Zend_Validate_Exception("A postcode-format string has to be given for validation");
}
if ($format[0] !== '/') {
$format = '/^' . $format;
}
if ($format[strle... | [
"public",
"function",
"setFormat",
"(",
"$",
"format",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"format",
")",
"||",
"!",
"is_string",
"(",
"$",
"format",
")",
")",
"{",
"throw",
"new",
"Zend_Validate_Exception",
"(",
"\"A postcode-format string has to be given... | Sets a self defined postal format as regex
@param string $format
@throws Zend_Validate_Exception On empty format
@return Zend_Validate_PostCode Provides fluid interface | [
"Sets",
"a",
"self",
"defined",
"postal",
"format",
"as",
"regex"
] | 88d9ea016f73d48ff0ba7d06ecbbf28951fd279e | https://github.com/joegreen88/zf1-component-validate/blob/88d9ea016f73d48ff0ba7d06ecbbf28951fd279e/src/Zend/Validate/PostCode.php#L167-L184 |
200,126 | bytic/orm | src/Traits/Searchable/SearchableRecordsTrait.php | SearchableRecordsTrait.paginate | public function paginate(Paginator $paginator, $params = [])
{
$query = $this->paramsToQuery($params);
$countQuery = $this->getDB()->newSelect();
$countQuery->count(['*', 'count']);
$countQuery->from([$query, 'tbl']);
$results = $countQuery->execute()->fetchResults();
... | php | public function paginate(Paginator $paginator, $params = [])
{
$query = $this->paramsToQuery($params);
$countQuery = $this->getDB()->newSelect();
$countQuery->count(['*', 'count']);
$countQuery->from([$query, 'tbl']);
$results = $countQuery->execute()->fetchResults();
... | [
"public",
"function",
"paginate",
"(",
"Paginator",
"$",
"paginator",
",",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"paramsToQuery",
"(",
"$",
"params",
")",
";",
"$",
"countQuery",
"=",
"$",
"this",
"->",
"getDB"... | Returns paginated results
@param Paginator $paginator
@param array $params
@return mixed | [
"Returns",
"paginated",
"results"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/Searchable/SearchableRecordsTrait.php#L23-L38 |
200,127 | bytic/orm | src/Traits/Searchable/SearchableRecordsTrait.php | SearchableRecordsTrait.findOne | public function findOne($primary)
{
$item = $this->getRegistry()->get($primary);
if (!$item) {
$all = $this->getRegistry()->get("all");
if ($all) {
$item = $all[$primary];
}
if (!$item) {
$params['where'][] = ["`{$this->... | php | public function findOne($primary)
{
$item = $this->getRegistry()->get($primary);
if (!$item) {
$all = $this->getRegistry()->get("all");
if ($all) {
$item = $all[$primary];
}
if (!$item) {
$params['where'][] = ["`{$this->... | [
"public",
"function",
"findOne",
"(",
"$",
"primary",
")",
"{",
"$",
"item",
"=",
"$",
"this",
"->",
"getRegistry",
"(",
")",
"->",
"get",
"(",
"$",
"primary",
")",
";",
"if",
"(",
"!",
"$",
"item",
")",
"{",
"$",
"all",
"=",
"$",
"this",
"->",... | Checks the registry before fetching from the database
@param mixed $primary
@return Record | [
"Checks",
"the",
"registry",
"before",
"fetching",
"from",
"the",
"database"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/Searchable/SearchableRecordsTrait.php#L71-L91 |
200,128 | bytic/orm | src/Traits/Searchable/SearchableRecordsTrait.php | SearchableRecordsTrait.findByPrimary | public function findByPrimary($pk_list = [])
{
$pk = $this->getPrimaryKey();
$return = $this->newCollection();
if ($pk_list) {
$pk_list = array_unique($pk_list);
foreach ($pk_list as $key => $value) {
$item = $this->getRegistry()->get($value);
... | php | public function findByPrimary($pk_list = [])
{
$pk = $this->getPrimaryKey();
$return = $this->newCollection();
if ($pk_list) {
$pk_list = array_unique($pk_list);
foreach ($pk_list as $key => $value) {
$item = $this->getRegistry()->get($value);
... | [
"public",
"function",
"findByPrimary",
"(",
"$",
"pk_list",
"=",
"[",
"]",
")",
"{",
"$",
"pk",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"$",
"return",
"=",
"$",
"this",
"->",
"newCollection",
"(",
")",
";",
"if",
"(",
"$",
"pk_list"... | When searching by primary key, look for items in current registry before
fetching them from the database
@param array $pk_list
@return RecordCollection | [
"When",
"searching",
"by",
"primary",
"key",
"look",
"for",
"items",
"in",
"current",
"registry",
"before",
"fetching",
"them",
"from",
"the",
"database"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/Searchable/SearchableRecordsTrait.php#L100-L129 |
200,129 | bytic/orm | src/Traits/Searchable/SearchableRecordsTrait.php | SearchableRecordsTrait.findOneByParams | public function findOneByParams(array $params = [])
{
$params['limit'] = 1;
$records = $this->findByParams($params);
if (count($records) > 0) {
return $records->rewind();
}
return null;
} | php | public function findOneByParams(array $params = [])
{
$params['limit'] = 1;
$records = $this->findByParams($params);
if (count($records) > 0) {
return $records->rewind();
}
return null;
} | [
"public",
"function",
"findOneByParams",
"(",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"params",
"[",
"'limit'",
"]",
"=",
"1",
";",
"$",
"records",
"=",
"$",
"this",
"->",
"findByParams",
"(",
"$",
"params",
")",
";",
"if",
"(",
"coun... | Finds one Record using params array
@param array $params
@return Record|null | [
"Finds",
"one",
"Record",
"using",
"params",
"array"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/Searchable/SearchableRecordsTrait.php#L138-L147 |
200,130 | bytic/orm | src/Traits/Searchable/SearchableRecordsTrait.php | SearchableRecordsTrait.findByParams | public function findByParams($params = [])
{
$query = $this->paramsToQuery($params);
return $this->findByQuery($query, $params);
} | php | public function findByParams($params = [])
{
$query = $this->paramsToQuery($params);
return $this->findByQuery($query, $params);
} | [
"public",
"function",
"findByParams",
"(",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"paramsToQuery",
"(",
"$",
"params",
")",
";",
"return",
"$",
"this",
"->",
"findByQuery",
"(",
"$",
"query",
",",
"$",
"params",... | Finds Records using params array
@param array $params
@return RecordCollection | [
"Finds",
"Records",
"using",
"params",
"array"
] | 8d9a79b47761af0bfd9b8d1d28c83221dcac0de0 | https://github.com/bytic/orm/blob/8d9a79b47761af0bfd9b8d1d28c83221dcac0de0/src/Traits/Searchable/SearchableRecordsTrait.php#L155-L160 |
200,131 | koolkode/context | src/Locator/InstanceServiceLocator.php | InstanceServiceLocator.registerService | public function registerService($object, $name = NULL)
{
if(!is_object($object))
{
throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object)));
}
$key = ($name === NULL) ? get_class($object) : (string)$name;
if(isset($this->services[$key]))
{
throw new Duplic... | php | public function registerService($object, $name = NULL)
{
if(!is_object($object))
{
throw new \InvalidArgumentException(sprintf('Expecting an object, given %s', gettype($object)));
}
$key = ($name === NULL) ? get_class($object) : (string)$name;
if(isset($this->services[$key]))
{
throw new Duplic... | [
"public",
"function",
"registerService",
"(",
"$",
"object",
",",
"$",
"name",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"is_object",
"(",
"$",
"object",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Expecting an obje... | Register the given object instance under the given name, defaults to the fully-qualified
type name of the object instance when no name is given.
@param object $object The object instance to be registered.
@param string $name An optional name for the service.
@throws \InvalidArgumentException When no object instance h... | [
"Register",
"the",
"given",
"object",
"instance",
"under",
"the",
"given",
"name",
"defaults",
"to",
"the",
"fully",
"-",
"qualified",
"type",
"name",
"of",
"the",
"object",
"instance",
"when",
"no",
"name",
"is",
"given",
"."
] | f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36 | https://github.com/koolkode/context/blob/f4aa614eb4ca1080bd89c7a2a54c9467c5b17a36/src/Locator/InstanceServiceLocator.php#L74-L89 |
200,132 | gianarb/GaGooGl | src/GaGooGl/Http/Request.php | Request.genereteShortLink | public function genereteShortLink($longLink)
{
$this->client->setMethod('POST');
$this->client->setUri('https://www.googleapis.com/urlshortener/v1/url');
$data = array('longUrl' => $longLink);
$this->client->setRawBody(json_encode($data));
$contentJson = $this->client->send()... | php | public function genereteShortLink($longLink)
{
$this->client->setMethod('POST');
$this->client->setUri('https://www.googleapis.com/urlshortener/v1/url');
$data = array('longUrl' => $longLink);
$this->client->setRawBody(json_encode($data));
$contentJson = $this->client->send()... | [
"public",
"function",
"genereteShortLink",
"(",
"$",
"longLink",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"setMethod",
"(",
"'POST'",
")",
";",
"$",
"this",
"->",
"client",
"->",
"setUri",
"(",
"'https://www.googleapis.com/urlshortener/v1/url'",
")",
";",
... | Generate a Short Link by Long link
@param $longLink
@return Response | [
"Generate",
"a",
"Short",
"Link",
"by",
"Long",
"link"
] | d7ebd3a74edb44a65d32b1b19d54eda55f638eaa | https://github.com/gianarb/GaGooGl/blob/d7ebd3a74edb44a65d32b1b19d54eda55f638eaa/src/GaGooGl/Http/Request.php#L30-L48 |
200,133 | gianarb/GaGooGl | src/GaGooGl/Http/Request.php | Request.getLongLinkbyShort | public function getLongLinkbyShort($shortLink)
{
$this->client->setMethod('GET');
$this->client->setUri("https://www.googleapis.com/urlshortener/v1/url?shortUrl={$shortLink}");
$contentJson = $this->client->send()->getContent();
$responseArray = json_decode($contentJson, true);
... | php | public function getLongLinkbyShort($shortLink)
{
$this->client->setMethod('GET');
$this->client->setUri("https://www.googleapis.com/urlshortener/v1/url?shortUrl={$shortLink}");
$contentJson = $this->client->send()->getContent();
$responseArray = json_decode($contentJson, true);
... | [
"public",
"function",
"getLongLinkbyShort",
"(",
"$",
"shortLink",
")",
"{",
"$",
"this",
"->",
"client",
"->",
"setMethod",
"(",
"'GET'",
")",
";",
"$",
"this",
"->",
"client",
"->",
"setUri",
"(",
"\"https://www.googleapis.com/urlshortener/v1/url?shortUrl={$shortL... | Return Long url bu Short url
@param $shortLink
@return Response | [
"Return",
"Long",
"url",
"bu",
"Short",
"url"
] | d7ebd3a74edb44a65d32b1b19d54eda55f638eaa | https://github.com/gianarb/GaGooGl/blob/d7ebd3a74edb44a65d32b1b19d54eda55f638eaa/src/GaGooGl/Http/Request.php#L55-L72 |
200,134 | geoffroy-aubry/Helpers | src/GAubry/Helpers/Counter.php | Counter.start | public function start($iMaxDuration, $iHeartbeat)
{
$fNow = microtime(true);
$this->aData = [
'ts_limit' => $fNow + $iMaxDuration,
'lap_duration' => $iHeartbeat,
'lap_start' => $fNow,
'lap_end' => $fNow + $iHeartbeat,
... | php | public function start($iMaxDuration, $iHeartbeat)
{
$fNow = microtime(true);
$this->aData = [
'ts_limit' => $fNow + $iMaxDuration,
'lap_duration' => $iHeartbeat,
'lap_start' => $fNow,
'lap_end' => $fNow + $iHeartbeat,
... | [
"public",
"function",
"start",
"(",
"$",
"iMaxDuration",
",",
"$",
"iHeartbeat",
")",
"{",
"$",
"fNow",
"=",
"microtime",
"(",
"true",
")",
";",
"$",
"this",
"->",
"aData",
"=",
"[",
"'ts_limit'",
"=>",
"$",
"fNow",
"+",
"$",
"iMaxDuration",
",",
"'l... | Init data structure.
@param int $iMaxDuration Max number of seconds waiting/processing events.
@param int $iHeartbeat Approximate desired delay in seconds between 2 stats diplay.
@return Counter $this
@see $aData | [
"Init",
"data",
"structure",
"."
] | 09e787e554158d7c2233a27107d2949824cd5602 | https://github.com/geoffroy-aubry/Helpers/blob/09e787e554158d7c2233a27107d2949824cd5602/src/GAubry/Helpers/Counter.php#L76-L88 |
200,135 | geoffroy-aubry/Helpers | src/GAubry/Helpers/Counter.php | Counter.doTic | public function doTic()
{
$aData = &$this->aData;
$fNow = microtime(true);
if ($fNow >= $aData['lap_end'] || $this->isTimeLimitExceeded()) {
$iNbEventsPerSec = round($aData['lap_nb_events'] / ($fNow - $aData['lap_start']));
$sMsg = sprintf(
$this->sFo... | php | public function doTic()
{
$aData = &$this->aData;
$fNow = microtime(true);
if ($fNow >= $aData['lap_end'] || $this->isTimeLimitExceeded()) {
$iNbEventsPerSec = round($aData['lap_nb_events'] / ($fNow - $aData['lap_start']));
$sMsg = sprintf(
$this->sFo... | [
"public",
"function",
"doTic",
"(",
")",
"{",
"$",
"aData",
"=",
"&",
"$",
"this",
"->",
"aData",
";",
"$",
"fNow",
"=",
"microtime",
"(",
"true",
")",
";",
"if",
"(",
"$",
"fNow",
">=",
"$",
"aData",
"[",
"'lap_end'",
"]",
"||",
"$",
"this",
"... | Display stats about number of processed events since last display. | [
"Display",
"stats",
"about",
"number",
"of",
"processed",
"events",
"since",
"last",
"display",
"."
] | 09e787e554158d7c2233a27107d2949824cd5602 | https://github.com/geoffroy-aubry/Helpers/blob/09e787e554158d7c2233a27107d2949824cd5602/src/GAubry/Helpers/Counter.php#L112-L133 |
200,136 | WellCommerce/CartBundle | Manager/Front/CartManager.php | CartManager.getCart | protected function getCart(ShopInterface $shop, ClientInterface $client = null, $sessionId, $currency)
{
$cart = $this->repository->findCart($client, $sessionId, $shop);
if (null === $cart) {
$cart = $this->createCart($shop, $client);
} else {
$this->updateCart($cart... | php | protected function getCart(ShopInterface $shop, ClientInterface $client = null, $sessionId, $currency)
{
$cart = $this->repository->findCart($client, $sessionId, $shop);
if (null === $cart) {
$cart = $this->createCart($shop, $client);
} else {
$this->updateCart($cart... | [
"protected",
"function",
"getCart",
"(",
"ShopInterface",
"$",
"shop",
",",
"ClientInterface",
"$",
"client",
"=",
"null",
",",
"$",
"sessionId",
",",
"$",
"currency",
")",
"{",
"$",
"cart",
"=",
"$",
"this",
"->",
"repository",
"->",
"findCart",
"(",
"$... | Returns an existent cart or creates a new one if needed
@param ShopInterface $shop
@param ClientInterface|null $client
@param string $sessionId
@param string $currency
@return CartInterface | [
"Returns",
"an",
"existent",
"cart",
"or",
"creates",
"a",
"new",
"one",
"if",
"needed"
] | 77c1e12b36bde008dca61260481b21135e339396 | https://github.com/WellCommerce/CartBundle/blob/77c1e12b36bde008dca61260481b21135e339396/Manager/Front/CartManager.php#L137-L148 |
200,137 | WellCommerce/CartBundle | Manager/Front/CartManager.php | CartManager.createCart | protected function createCart(ShopInterface $shop, ClientInterface $client = null)
{
$cart = $this->initResource();
$cart->setShop($shop);
$cart->setClient($client);
$this->createResource($cart);
return $cart;
} | php | protected function createCart(ShopInterface $shop, ClientInterface $client = null)
{
$cart = $this->initResource();
$cart->setShop($shop);
$cart->setClient($client);
$this->createResource($cart);
return $cart;
} | [
"protected",
"function",
"createCart",
"(",
"ShopInterface",
"$",
"shop",
",",
"ClientInterface",
"$",
"client",
"=",
"null",
")",
"{",
"$",
"cart",
"=",
"$",
"this",
"->",
"initResource",
"(",
")",
";",
"$",
"cart",
"->",
"setShop",
"(",
"$",
"shop",
... | Creates cart using factory
@param ShopInterface $shop
@param ClientInterface|null $client
@return CartInterface | [
"Creates",
"cart",
"using",
"factory"
] | 77c1e12b36bde008dca61260481b21135e339396 | https://github.com/WellCommerce/CartBundle/blob/77c1e12b36bde008dca61260481b21135e339396/Manager/Front/CartManager.php#L184-L193 |
200,138 | libreworks/caridea-auth | src/Adapter/Pdo.php | Pdo.execute | protected function execute(string $username, ServerRequestInterface $request): \PDOStatement
{
$stmt = $this->pdo->prepare($this->getSql());
$stmt->execute([$username]);
return $stmt;
} | php | protected function execute(string $username, ServerRequestInterface $request): \PDOStatement
{
$stmt = $this->pdo->prepare($this->getSql());
$stmt->execute([$username]);
return $stmt;
} | [
"protected",
"function",
"execute",
"(",
"string",
"$",
"username",
",",
"ServerRequestInterface",
"$",
"request",
")",
":",
"\\",
"PDOStatement",
"{",
"$",
"stmt",
"=",
"$",
"this",
"->",
"pdo",
"->",
"prepare",
"(",
"$",
"this",
"->",
"getSql",
"(",
")... | Queries the database table.
Override this method if you want to bind additonal values to the SQL
query.
@param string $username The username to use for parameter binding
@param ServerRequestInterface $request The Server Request message (to use for additional parameter binding) | [
"Queries",
"the",
"database",
"table",
"."
] | 1bf965c57716942b18ca3204629f6bda99cf876a | https://github.com/libreworks/caridea-auth/blob/1bf965c57716942b18ca3204629f6bda99cf876a/src/Adapter/Pdo.php#L115-L120 |
200,139 | libreworks/caridea-auth | src/Adapter/Pdo.php | Pdo.fetchResult | protected function fetchResult(array $results, string $username): array
{
if (count($results) > 1) {
throw new \Caridea\Auth\Exception\UsernameAmbiguous($username);
} elseif (count($results) == 0) {
throw new \Caridea\Auth\Exception\UsernameNotFound($username);
}
... | php | protected function fetchResult(array $results, string $username): array
{
if (count($results) > 1) {
throw new \Caridea\Auth\Exception\UsernameAmbiguous($username);
} elseif (count($results) == 0) {
throw new \Caridea\Auth\Exception\UsernameNotFound($username);
}
... | [
"protected",
"function",
"fetchResult",
"(",
"array",
"$",
"results",
",",
"string",
"$",
"username",
")",
":",
"array",
"{",
"if",
"(",
"count",
"(",
"$",
"results",
")",
">",
"1",
")",
"{",
"throw",
"new",
"\\",
"Caridea",
"\\",
"Auth",
"\\",
"Exce... | Fetches a single result from the database resultset.
@param array $results The results as returned from `fetchAll`
@param string $username The attempted username (for Exception purposes)
@return array A single database result
@throws \Caridea\Auth\Exception\UsernameAmbiguous If there is more than 1 result
@throws \Car... | [
"Fetches",
"a",
"single",
"result",
"from",
"the",
"database",
"resultset",
"."
] | 1bf965c57716942b18ca3204629f6bda99cf876a | https://github.com/libreworks/caridea-auth/blob/1bf965c57716942b18ca3204629f6bda99cf876a/src/Adapter/Pdo.php#L145-L153 |
200,140 | bkstg/schedule-bundle | Search/EventSubscriber/FilterCollectionSubscriber.php | FilterCollectionSubscriber.addEventFilter | public function addEventFilter(FilterCollectionEvent $event): void
{
$now = new \DateTime();
$qb = $event->getQueryBuilder();
$query = $qb->query()->bool()
->addMust($qb->query()->term(['_index' => 'event']))
->addMust($qb->query()->term(['active' => true]))
... | php | public function addEventFilter(FilterCollectionEvent $event): void
{
$now = new \DateTime();
$qb = $event->getQueryBuilder();
$query = $qb->query()->bool()
->addMust($qb->query()->term(['_index' => 'event']))
->addMust($qb->query()->term(['active' => true]))
... | [
"public",
"function",
"addEventFilter",
"(",
"FilterCollectionEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"now",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"qb",
"=",
"$",
"event",
"->",
"getQueryBuilder",
"(",
")",
";",
"$",
"query",
"=",... | Add the event filter to search.
@param FilterCollectionEvent $event The filter collection event.
@return void | [
"Add",
"the",
"event",
"filter",
"to",
"search",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Search/EventSubscriber/FilterCollectionSubscriber.php#L41-L52 |
200,141 | bkstg/schedule-bundle | Search/EventSubscriber/FilterCollectionSubscriber.php | FilterCollectionSubscriber.addScheduleFilter | public function addScheduleFilter(FilterCollectionEvent $event): void
{
$now = new \DateTime();
$qb = $event->getQueryBuilder();
$query = $qb->query()->bool()
->addMust($qb->query()->term(['_index' => 'schedule']))
->addMust($qb->query()->term(['active' => true]))
... | php | public function addScheduleFilter(FilterCollectionEvent $event): void
{
$now = new \DateTime();
$qb = $event->getQueryBuilder();
$query = $qb->query()->bool()
->addMust($qb->query()->term(['_index' => 'schedule']))
->addMust($qb->query()->term(['active' => true]))
... | [
"public",
"function",
"addScheduleFilter",
"(",
"FilterCollectionEvent",
"$",
"event",
")",
":",
"void",
"{",
"$",
"now",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"$",
"qb",
"=",
"$",
"event",
"->",
"getQueryBuilder",
"(",
")",
";",
"$",
"query",
"... | Add the schedule filter to search.
@param FilterCollectionEvent $event The filter collection event.
@return void | [
"Add",
"the",
"schedule",
"filter",
"to",
"search",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Search/EventSubscriber/FilterCollectionSubscriber.php#L61-L71 |
200,142 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.fetchTree | public function fetchTree($rootId=null, $depth=null)
{
$wrappers = $this->fetchTreeAsArray($rootId, $depth);
return (!is_array($wrappers) || empty($wrappers)) ? null : $wrappers[0];
} | php | public function fetchTree($rootId=null, $depth=null)
{
$wrappers = $this->fetchTreeAsArray($rootId, $depth);
return (!is_array($wrappers) || empty($wrappers)) ? null : $wrappers[0];
} | [
"public",
"function",
"fetchTree",
"(",
"$",
"rootId",
"=",
"null",
",",
"$",
"depth",
"=",
"null",
")",
"{",
"$",
"wrappers",
"=",
"$",
"this",
"->",
"fetchTreeAsArray",
"(",
"$",
"rootId",
",",
"$",
"depth",
")",
";",
"return",
"(",
"!",
"is_array"... | Fetches the complete tree, returning the root node of the tree
@param mixed $rootId the root id of the tree (or null if model doesn't
support multiple trees
@param int $depth the depth to retrieve or null for unlimited
@return NodeWrapper $root | [
"Fetches",
"the",
"complete",
"tree",
"returning",
"the",
"root",
"node",
"of",
"the",
"tree"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L59-L64 |
200,143 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.fetchTreeAsArray | public function fetchTreeAsArray($rootId=null, $depth=null)
{
$config = $this->getConfiguration();
$lftField = $config->getLeftFieldName();
$rgtField = $config->getRightFieldName();
$rootField = $config->getRootFieldName();
$hasManyRoots = $config->hasManyRoots();
if... | php | public function fetchTreeAsArray($rootId=null, $depth=null)
{
$config = $this->getConfiguration();
$lftField = $config->getLeftFieldName();
$rgtField = $config->getRightFieldName();
$rootField = $config->getRootFieldName();
$hasManyRoots = $config->hasManyRoots();
if... | [
"public",
"function",
"fetchTreeAsArray",
"(",
"$",
"rootId",
"=",
"null",
",",
"$",
"depth",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
";",
"$",
"lftField",
"=",
"$",
"config",
"->",
"getLeftFieldName",
... | Fetches the complete tree, returning a flat array of node wrappers with
parent, children, ancestors and descendants pre-populated.
@param mixed $rootId the root id of the tree (or null if model doesn't
support multiple trees
@param int $depth the depth to retrieve or null for unlimited
@return array | [
"Fetches",
"the",
"complete",
"tree",
"returning",
"a",
"flat",
"array",
"of",
"node",
"wrappers",
"with",
"parent",
"children",
"ancestors",
"and",
"descendants",
"pre",
"-",
"populated",
"."
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L77-L134 |
200,144 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.fetchBranch | public function fetchBranch($pk, $depth=null)
{
$wrappers = $this->fetchBranchAsArray($pk, $depth);
return (!is_array($wrappers) || empty($wrappers)) ? null : $wrappers[0];
} | php | public function fetchBranch($pk, $depth=null)
{
$wrappers = $this->fetchBranchAsArray($pk, $depth);
return (!is_array($wrappers) || empty($wrappers)) ? null : $wrappers[0];
} | [
"public",
"function",
"fetchBranch",
"(",
"$",
"pk",
",",
"$",
"depth",
"=",
"null",
")",
"{",
"$",
"wrappers",
"=",
"$",
"this",
"->",
"fetchBranchAsArray",
"(",
"$",
"pk",
",",
"$",
"depth",
")",
";",
"return",
"(",
"!",
"is_array",
"(",
"$",
"wr... | Fetches a branch of a tree, returning the starting node of the branch.
All children and descendants are pre-populated.
@param mixed $pk the primary key used to locate the node to traverse
the tree from
@param int $depth the depth to retrieve or null for unlimited
@return NodeWrapper $branch | [
"Fetches",
"a",
"branch",
"of",
"a",
"tree",
"returning",
"the",
"starting",
"node",
"of",
"the",
"branch",
".",
"All",
"children",
"and",
"descendants",
"are",
"pre",
"-",
"populated",
"."
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L147-L152 |
200,145 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.fetchBranchAsArray | public function fetchBranchAsArray($pk, $depth=null)
{
$config = $this->getConfiguration();
$lftField = $config->getLeftFieldName();
$rgtField = $config->getRightFieldName();
$rootField = $config->getRootFieldName();
$hasManyRoots = $config->hasManyRoots();
if($depth... | php | public function fetchBranchAsArray($pk, $depth=null)
{
$config = $this->getConfiguration();
$lftField = $config->getLeftFieldName();
$rgtField = $config->getRightFieldName();
$rootField = $config->getRootFieldName();
$hasManyRoots = $config->hasManyRoots();
if($depth... | [
"public",
"function",
"fetchBranchAsArray",
"(",
"$",
"pk",
",",
"$",
"depth",
"=",
"null",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
";",
"$",
"lftField",
"=",
"$",
"config",
"->",
"getLeftFieldName",
"(",
")",
";"... | Fetches a branch of a tree, returning a flat array of node wrappers with
parent, children, ancestors and descendants pre-populated.
@param mixed $pk the primary key used to locate the node to traverse
the tree from
@param int $depth the depth to retrieve or null for unlimited
@return array | [
"Fetches",
"a",
"branch",
"of",
"a",
"tree",
"returning",
"a",
"flat",
"array",
"of",
"node",
"wrappers",
"with",
"parent",
"children",
"ancestors",
"and",
"descendants",
"pre",
"-",
"populated",
"."
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L165-L230 |
200,146 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.createRoot | public function createRoot(Node $node)
{
if($node instanceof NodeWrapper)
{
throw new \InvalidArgumentException('Can\'t create a root node from a NodeWrapper node');
}
$node->setLeftValue(1);
$node->setRightValue(2);
if($this->getConfiguration()->hasMany... | php | public function createRoot(Node $node)
{
if($node instanceof NodeWrapper)
{
throw new \InvalidArgumentException('Can\'t create a root node from a NodeWrapper node');
}
$node->setLeftValue(1);
$node->setRightValue(2);
if($this->getConfiguration()->hasMany... | [
"public",
"function",
"createRoot",
"(",
"Node",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"NodeWrapper",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Can\\'t create a root node from a NodeWrapper node'",
")",
";",
"}",
"$"... | Creates a new root node
@param Node
@return NodeWrapper | [
"Creates",
"a",
"new",
"root",
"node"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L240-L277 |
200,147 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.wrapNode | public function wrapNode(Node $node)
{
if($node instanceof NodeWrapper)
{
throw new \InvalidArgumentException('Can\'t wrap a NodeWrapper node');
}
$oid = spl_object_hash($node);
if(!isset($this->wrappers[$oid]) || $this->wrappers[$oid]->getNode() !== $node)
... | php | public function wrapNode(Node $node)
{
if($node instanceof NodeWrapper)
{
throw new \InvalidArgumentException('Can\'t wrap a NodeWrapper node');
}
$oid = spl_object_hash($node);
if(!isset($this->wrappers[$oid]) || $this->wrappers[$oid]->getNode() !== $node)
... | [
"public",
"function",
"wrapNode",
"(",
"Node",
"$",
"node",
")",
"{",
"if",
"(",
"$",
"node",
"instanceof",
"NodeWrapper",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'Can\\'t wrap a NodeWrapper node'",
")",
";",
"}",
"$",
"oid",
"=",
"... | wraps the node using the NodeWrapper class
@param Node $node
@return NodeWrapper | [
"wraps",
"the",
"node",
"using",
"the",
"NodeWrapper",
"class"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L287-L301 |
200,148 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.updateLeftValues | public function updateLeftValues($first, $last, $delta, $rootVal=null)
{
$hasManyRoots = $this->getConfiguration()->hasManyRoots();
foreach($this->wrappers as $wrapper)
{
if(!$hasManyRoots || ($wrapper->getRootValue() == $rootVal))
{
if($wrapper->getL... | php | public function updateLeftValues($first, $last, $delta, $rootVal=null)
{
$hasManyRoots = $this->getConfiguration()->hasManyRoots();
foreach($this->wrappers as $wrapper)
{
if(!$hasManyRoots || ($wrapper->getRootValue() == $rootVal))
{
if($wrapper->getL... | [
"public",
"function",
"updateLeftValues",
"(",
"$",
"first",
",",
"$",
"last",
",",
"$",
"delta",
",",
"$",
"rootVal",
"=",
"null",
")",
"{",
"$",
"hasManyRoots",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
"->",
"hasManyRoots",
"(",
")",
";"... | Internal
Updates the left values of managed nodes
@param int $first first left value to shift
@param int $last last left value to shift, or 0
@param int $delta offset to shift by
@param mixed $rootVal the root value of entities to act upon | [
"Internal",
"Updates",
"the",
"left",
"values",
"of",
"managed",
"nodes"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L352-L367 |
200,149 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.updateRightValues | public function updateRightValues($first, $last, $delta, $rootVal=null)
{
$hasManyRoots = $this->getConfiguration()->hasManyRoots();
foreach($this->wrappers as $wrapper)
{
if(!$hasManyRoots || ($wrapper->getRootValue() == $rootVal))
{
if($wrapper->get... | php | public function updateRightValues($first, $last, $delta, $rootVal=null)
{
$hasManyRoots = $this->getConfiguration()->hasManyRoots();
foreach($this->wrappers as $wrapper)
{
if(!$hasManyRoots || ($wrapper->getRootValue() == $rootVal))
{
if($wrapper->get... | [
"public",
"function",
"updateRightValues",
"(",
"$",
"first",
",",
"$",
"last",
",",
"$",
"delta",
",",
"$",
"rootVal",
"=",
"null",
")",
"{",
"$",
"hasManyRoots",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
"->",
"hasManyRoots",
"(",
")",
";... | Internal
Updates the right values of managed nodes
@param int $first first right value to shift
@param int $last last right value to shift, or 0
@param int $delta offset to shift by
@param mixed $rootVal the root value of entities to act upon | [
"Internal",
"Updates",
"the",
"right",
"values",
"of",
"managed",
"nodes"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L380-L395 |
200,150 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.updateValues | public function updateValues($first, $last, $delta, $oldRoot=null, $newRoot=null)
{
if(!$this->wrappers)
{
return;
}
$hasManyRoots = $this->getConfiguration()->hasManyRoots();
foreach($this->wrappers as $wrapper)
{
if(!$hasManyRoots || ($wrap... | php | public function updateValues($first, $last, $delta, $oldRoot=null, $newRoot=null)
{
if(!$this->wrappers)
{
return;
}
$hasManyRoots = $this->getConfiguration()->hasManyRoots();
foreach($this->wrappers as $wrapper)
{
if(!$hasManyRoots || ($wrap... | [
"public",
"function",
"updateValues",
"(",
"$",
"first",
",",
"$",
"last",
",",
"$",
"delta",
",",
"$",
"oldRoot",
"=",
"null",
",",
"$",
"newRoot",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"wrappers",
")",
"{",
"return",
";",
"}... | Internal
Updates the left, right and root values of managed nodes
@param int $first lowerbound (lft/rgt) of nodes to update
@param int $last upperbound (lft/rgt) of nodes to update, or 0
@param int $delta delta to add to lft/rgt values (can be negative)
@param mixed $oldRoot the old root value of entities to act upon
... | [
"Internal",
"Updates",
"the",
"left",
"right",
"and",
"root",
"values",
"of",
"managed",
"nodes"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L408-L435 |
200,151 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.removeNodes | public function removeNodes($left, $right, $root=null)
{
$hasManyRoots = $this->getConfiguration()->hasManyRoots();
$removed = array();
foreach($this->wrappers as $oid => $wrapper)
{
if(!$hasManyRoots || ($wrapper->getRootValue() == $root))
{
... | php | public function removeNodes($left, $right, $root=null)
{
$hasManyRoots = $this->getConfiguration()->hasManyRoots();
$removed = array();
foreach($this->wrappers as $oid => $wrapper)
{
if(!$hasManyRoots || ($wrapper->getRootValue() == $root))
{
... | [
"public",
"function",
"removeNodes",
"(",
"$",
"left",
",",
"$",
"right",
",",
"$",
"root",
"=",
"null",
")",
"{",
"$",
"hasManyRoots",
"=",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
"->",
"hasManyRoots",
"(",
")",
";",
"$",
"removed",
"=",
"a... | Internal
Removes managed nodes
@param int $left
@param int $right
@param mixed $root | [
"Internal",
"Removes",
"managed",
"nodes"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L446-L473 |
200,152 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.filterNodeDepth | public function filterNodeDepth($nodes, $depth)
{
if(empty($nodes) || $depth === 0)
{
return array();
}
$newNodes = array();
$stack = array();
$level = 0;
foreach($nodes as $node)
{
$parent = end($stack);
while($pa... | php | public function filterNodeDepth($nodes, $depth)
{
if(empty($nodes) || $depth === 0)
{
return array();
}
$newNodes = array();
$stack = array();
$level = 0;
foreach($nodes as $node)
{
$parent = end($stack);
while($pa... | [
"public",
"function",
"filterNodeDepth",
"(",
"$",
"nodes",
",",
"$",
"depth",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"nodes",
")",
"||",
"$",
"depth",
"===",
"0",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"newNodes",
"=",
"array",
"... | Internal
Filters an array of nodes by depth
@param array array of Node instances
@param int $depth the depth to filter to
@return array array of Node instances | [
"Internal",
"Filters",
"an",
"array",
"of",
"nodes",
"by",
"depth"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L485-L519 |
200,153 | devlabmtl/haven-core | Lib/NestedSet/Manager.php | Manager.addHintToQuery | public function addHintToQuery(\Doctrine\ORM\Query $query)
{
return $query->setHint($this->getConfiguration()->GetQueryHintName(), $this->getConfiguration()->GetQueryHintValue());
} | php | public function addHintToQuery(\Doctrine\ORM\Query $query)
{
return $query->setHint($this->getConfiguration()->GetQueryHintName(), $this->getConfiguration()->GetQueryHintValue());
} | [
"public",
"function",
"addHintToQuery",
"(",
"\\",
"Doctrine",
"\\",
"ORM",
"\\",
"Query",
"$",
"query",
")",
"{",
"return",
"$",
"query",
"->",
"setHint",
"(",
"$",
"this",
"->",
"getConfiguration",
"(",
")",
"->",
"GetQueryHintName",
"(",
")",
",",
"$"... | Adds a Query hint to a Query Object
@param \Doctrine\ORM\Query $query
@return \Doctrine\ORM\Query | [
"Adds",
"a",
"Query",
"hint",
"to",
"a",
"Query",
"Object"
] | f13410f996fd4002efafe482b927adadb211dec8 | https://github.com/devlabmtl/haven-core/blob/f13410f996fd4002efafe482b927adadb211dec8/Lib/NestedSet/Manager.php#L604-L607 |
200,154 | GetOlympus/olympus-map-field | src/Map/Map.php | Map.getMapsOptions | protected function getMapsOptions()
{
return [
'dragndrop' => Translate::t('map.options.dragndrop', [], 'mapfield'),
'streetview' => Translate::t('map.options.streetview', [], 'mapfield'),
'zoomcontrol' => Translate::t('map.options.zoomcontrol', [], 'mapfield'),
... | php | protected function getMapsOptions()
{
return [
'dragndrop' => Translate::t('map.options.dragndrop', [], 'mapfield'),
'streetview' => Translate::t('map.options.streetview', [], 'mapfield'),
'zoomcontrol' => Translate::t('map.options.zoomcontrol', [], 'mapfield'),
... | [
"protected",
"function",
"getMapsOptions",
"(",
")",
"{",
"return",
"[",
"'dragndrop'",
"=>",
"Translate",
"::",
"t",
"(",
"'map.options.dragndrop'",
",",
"[",
"]",
",",
"'mapfield'",
")",
",",
"'streetview'",
"=>",
"Translate",
"::",
"t",
"(",
"'map.options.s... | Return all available maps options.
@return array $options | [
"Return",
"all",
"available",
"maps",
"options",
"."
] | 8b8d860d3916a9bf033aa11811ee96417704a446 | https://github.com/GetOlympus/olympus-map-field/blob/8b8d860d3916a9bf033aa11811ee96417704a446/src/Map/Map.php#L137-L155 |
200,155 | PenoaksDev/Milky-Framework | src/Milky/Annotations/CachedReader.php | CachedReader.saveToCache | private function saveToCache( $rawCacheKey, $value )
{
$cacheKey = $rawCacheKey . self::$CACHE_SALT;
$this->cache->save( $cacheKey, $value );
if ( $this->debug )
$this->cache->save( '[C]' . $cacheKey, time() );
} | php | private function saveToCache( $rawCacheKey, $value )
{
$cacheKey = $rawCacheKey . self::$CACHE_SALT;
$this->cache->save( $cacheKey, $value );
if ( $this->debug )
$this->cache->save( '[C]' . $cacheKey, time() );
} | [
"private",
"function",
"saveToCache",
"(",
"$",
"rawCacheKey",
",",
"$",
"value",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"rawCacheKey",
".",
"self",
"::",
"$",
"CACHE_SALT",
";",
"$",
"this",
"->",
"cache",
"->",
"save",
"(",
"$",
"cacheKey",
",",
"$",
... | Saves a value to the cache.
@param string $rawCacheKey The cache key.
@param mixed $value The value.
@return void | [
"Saves",
"a",
"value",
"to",
"the",
"cache",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/CachedReader.php#L181-L187 |
200,156 | PenoaksDev/Milky-Framework | src/Milky/Annotations/CachedReader.php | CachedReader.isCacheFresh | private function isCacheFresh( $cacheKey, \ReflectionClass $class )
{
if ( false === $filename = $class->getFileName() )
return true;
return $this->cache->fetch( '[C]' . $cacheKey ) >= filemtime( $filename );
} | php | private function isCacheFresh( $cacheKey, \ReflectionClass $class )
{
if ( false === $filename = $class->getFileName() )
return true;
return $this->cache->fetch( '[C]' . $cacheKey ) >= filemtime( $filename );
} | [
"private",
"function",
"isCacheFresh",
"(",
"$",
"cacheKey",
",",
"\\",
"ReflectionClass",
"$",
"class",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"filename",
"=",
"$",
"class",
"->",
"getFileName",
"(",
")",
")",
"return",
"true",
";",
"return",
"$",
... | Checks if the cache is fresh.
@param string $cacheKey
@param \ReflectionClass $class
@return boolean | [
"Checks",
"if",
"the",
"cache",
"is",
"fresh",
"."
] | 8afd7156610a70371aa5b1df50b8a212bf7b142c | https://github.com/PenoaksDev/Milky-Framework/blob/8afd7156610a70371aa5b1df50b8a212bf7b142c/src/Milky/Annotations/CachedReader.php#L197-L203 |
200,157 | koolkode/config | src/ConfigurationLoader.php | ConfigurationLoader.findLoader | public function findLoader(\SplFileInfo $source)
{
foreach($this->loaders as $loader)
{
if($loader->isSupported($source))
{
return $loader;
}
}
throw new \OutOfBoundsException(sprintf('No configuration loader found for "%s"', $source->getPathname()));
} | php | public function findLoader(\SplFileInfo $source)
{
foreach($this->loaders as $loader)
{
if($loader->isSupported($source))
{
return $loader;
}
}
throw new \OutOfBoundsException(sprintf('No configuration loader found for "%s"', $source->getPathname()));
} | [
"public",
"function",
"findLoader",
"(",
"\\",
"SplFileInfo",
"$",
"source",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"loaders",
"as",
"$",
"loader",
")",
"{",
"if",
"(",
"$",
"loader",
"->",
"isSupported",
"(",
"$",
"source",
")",
")",
"{",
"ret... | Picks a config loader for the given file and returns it.
@param \SplFileInfo $source
@return ConfigurationLoaderInterface
@throws \OutOfBoundsException When no loader is able to load the given file. | [
"Picks",
"a",
"config",
"loader",
"for",
"the",
"given",
"file",
"and",
"returns",
"it",
"."
] | ad97d80f6e4ae5f8925839488abf2d9bfcb6d7f6 | https://github.com/koolkode/config/blob/ad97d80f6e4ae5f8925839488abf2d9bfcb6d7f6/src/ConfigurationLoader.php#L52-L63 |
200,158 | bkstg/schedule-bundle | Validator/Constraints/UniqueCollectionPropertyValidator.php | UniqueCollectionPropertyValidator.validate | public function validate($value, Constraint $constraint): void
{
// Build a list of values.
$item_values = [];
foreach ($value as $item) {
$item_value = $this->property_accessor->getValue($item, $constraint->property);
// If any value is repeated build a violation.
... | php | public function validate($value, Constraint $constraint): void
{
// Build a list of values.
$item_values = [];
foreach ($value as $item) {
$item_value = $this->property_accessor->getValue($item, $constraint->property);
// If any value is repeated build a violation.
... | [
"public",
"function",
"validate",
"(",
"$",
"value",
",",
"Constraint",
"$",
"constraint",
")",
":",
"void",
"{",
"// Build a list of values.",
"$",
"item_values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"value",
"as",
"$",
"item",
")",
"{",
"$",
"item_... | Validate a constraint.
@param mixed $value The value being passed in.
@param Constraint $constraint The constraint to be checked.
@return void | [
"Validate",
"a",
"constraint",
"."
] | e64ac897aa7b28bc48319470d65de13cd4788afe | https://github.com/bkstg/schedule-bundle/blob/e64ac897aa7b28bc48319470d65de13cd4788afe/Validator/Constraints/UniqueCollectionPropertyValidator.php#L40-L55 |
200,159 | theopera/framework | src/Component/Http/Request.php | Request.getPathInfo | public function getPathInfo()
{
if ($this->pathInfo === null) {
$end = strpos($this->uri, '?');
if ($end === false) {
$this->pathInfo = $this->uri;
}else{
$this->pathInfo = substr($this->uri, 0, $end);
}
if (empty(... | php | public function getPathInfo()
{
if ($this->pathInfo === null) {
$end = strpos($this->uri, '?');
if ($end === false) {
$this->pathInfo = $this->uri;
}else{
$this->pathInfo = substr($this->uri, 0, $end);
}
if (empty(... | [
"public",
"function",
"getPathInfo",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"pathInfo",
"===",
"null",
")",
"{",
"$",
"end",
"=",
"strpos",
"(",
"$",
"this",
"->",
"uri",
",",
"'?'",
")",
";",
"if",
"(",
"$",
"end",
"===",
"false",
")",
"... | Get the path info
which is the uri without the query parameters
@return string | [
"Get",
"the",
"path",
"info",
"which",
"is",
"the",
"uri",
"without",
"the",
"query",
"parameters"
] | fa6165d3891a310faa580c81dee49a63c150c711 | https://github.com/theopera/framework/blob/fa6165d3891a310faa580c81dee49a63c150c711/src/Component/Http/Request.php#L226-L243 |
200,160 | fridge-project/dbal | src/Fridge/DBAL/Driver/Connection/MysqliConnection.php | MysqliConnection.getMaxAllowedPacket | public function getMaxAllowedPacket()
{
if ($this->maxAllowedPacket === null) {
$statement = $this->prepare('SELECT @@global.max_allowed_packet');
$statement->execute();
$this->maxAllowedPacket = (int) $statement->fetchColumn();
}
return $this->maxAllowe... | php | public function getMaxAllowedPacket()
{
if ($this->maxAllowedPacket === null) {
$statement = $this->prepare('SELECT @@global.max_allowed_packet');
$statement->execute();
$this->maxAllowedPacket = (int) $statement->fetchColumn();
}
return $this->maxAllowe... | [
"public",
"function",
"getMaxAllowedPacket",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"maxAllowedPacket",
"===",
"null",
")",
"{",
"$",
"statement",
"=",
"$",
"this",
"->",
"prepare",
"(",
"'SELECT @@global.max_allowed_packet'",
")",
";",
"$",
"statement",... | Gets the MySQL max allowed packet constant.
@link http://dev.mysql.com/doc/refman/5.0/en/program-variables.html
@return integer The max allowed packet. | [
"Gets",
"the",
"MySQL",
"max",
"allowed",
"packet",
"constant",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Driver/Connection/MysqliConnection.php#L188-L198 |
200,161 | agentmedia/phine-core | src/Core/Modules/Backend/AreaList.php | AreaList.Init | protected function Init()
{
$this->layout = new Layout(Request::GetData('layout'));
if (!$this->layout->Exists())
{
Response::Redirect(BackendRouter::ModuleUrl(new LayoutList()));
return true;
}
$this->listProvider = new AreaListProvider($this->layout)... | php | protected function Init()
{
$this->layout = new Layout(Request::GetData('layout'));
if (!$this->layout->Exists())
{
Response::Redirect(BackendRouter::ModuleUrl(new LayoutList()));
return true;
}
$this->listProvider = new AreaListProvider($this->layout)... | [
"protected",
"function",
"Init",
"(",
")",
"{",
"$",
"this",
"->",
"layout",
"=",
"new",
"Layout",
"(",
"Request",
"::",
"GetData",
"(",
"'layout'",
")",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"layout",
"->",
"Exists",
"(",
")",
")",
"{",
"... | Initializes the list
@return boolean | [
"Initializes",
"the",
"list"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AreaList.php#L49-L62 |
200,162 | agentmedia/phine-core | src/Core/Modules/Backend/AreaList.php | AreaList.CreateAfterUrl | protected function CreateAfterUrl(Area $area)
{
$args = array('layout'=>$this->layout->GetID());
$args['previous'] = $area->GetID();
return BackendRouter::ModuleUrl(new AreaForm(), $args);
} | php | protected function CreateAfterUrl(Area $area)
{
$args = array('layout'=>$this->layout->GetID());
$args['previous'] = $area->GetID();
return BackendRouter::ModuleUrl(new AreaForm(), $args);
} | [
"protected",
"function",
"CreateAfterUrl",
"(",
"Area",
"$",
"area",
")",
"{",
"$",
"args",
"=",
"array",
"(",
"'layout'",
"=>",
"$",
"this",
"->",
"layout",
"->",
"GetID",
"(",
")",
")",
";",
"$",
"args",
"[",
"'previous'",
"]",
"=",
"$",
"area",
... | The create url for an area after another
@param Area $area
@return string | [
"The",
"create",
"url",
"for",
"an",
"area",
"after",
"another"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AreaList.php#L78-L83 |
200,163 | agentmedia/phine-core | src/Core/Modules/Backend/AreaList.php | AreaList.NextArea | protected function NextArea()
{
$area = $this->area;
$this->area = $this->listProvider->NextOf($this->area);
return $area;
} | php | protected function NextArea()
{
$area = $this->area;
$this->area = $this->listProvider->NextOf($this->area);
return $area;
} | [
"protected",
"function",
"NextArea",
"(",
")",
"{",
"$",
"area",
"=",
"$",
"this",
"->",
"area",
";",
"$",
"this",
"->",
"area",
"=",
"$",
"this",
"->",
"listProvider",
"->",
"NextOf",
"(",
"$",
"this",
"->",
"area",
")",
";",
"return",
"$",
"area"... | Gets the next area
@return Area | [
"Gets",
"the",
"next",
"area"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AreaList.php#L110-L115 |
200,164 | agentmedia/phine-core | src/Core/Modules/Backend/AreaList.php | AreaList.CanEdit | protected function CanEdit(Area $area)
{
return self::Guard()->Allow(BackendAction::Edit(), $area) &&
self::Guard()->Allow(BackendAction::UseIt(), new AreaForm());
} | php | protected function CanEdit(Area $area)
{
return self::Guard()->Allow(BackendAction::Edit(), $area) &&
self::Guard()->Allow(BackendAction::UseIt(), new AreaForm());
} | [
"protected",
"function",
"CanEdit",
"(",
"Area",
"$",
"area",
")",
"{",
"return",
"self",
"::",
"Guard",
"(",
")",
"->",
"Allow",
"(",
"BackendAction",
"::",
"Edit",
"(",
")",
",",
"$",
"area",
")",
"&&",
"self",
"::",
"Guard",
"(",
")",
"->",
"All... | True if area can be edited
@param Area $area
@return bool Returns true if the area can be edited | [
"True",
"if",
"area",
"can",
"be",
"edited"
] | 38c1be8d03ebffae950d00a96da3c612aff67832 | https://github.com/agentmedia/phine-core/blob/38c1be8d03ebffae950d00a96da3c612aff67832/src/Core/Modules/Backend/AreaList.php#L141-L145 |
200,165 | devlabmtl/haven-cms | Entity/BasePage.php | BasePage.addBlogContent | public function addBlogContent(\Haven\CmsBundle\Entity\PageContent $pageContents) {
$this->addPageContent($pageContents);
return $this;
} | php | public function addBlogContent(\Haven\CmsBundle\Entity\PageContent $pageContents) {
$this->addPageContent($pageContents);
return $this;
} | [
"public",
"function",
"addBlogContent",
"(",
"\\",
"Haven",
"\\",
"CmsBundle",
"\\",
"Entity",
"\\",
"PageContent",
"$",
"pageContents",
")",
"{",
"$",
"this",
"->",
"addPageContent",
"(",
"$",
"pageContents",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Add page_contents for blogcontent type
@param \Haven\CmsBundle\Entity\PageContent $pageContents
@return Page | [
"Add",
"page_contents",
"for",
"blogcontent",
"type"
] | c20761a07c201a966dbda1f3eae33617f80e1ece | https://github.com/devlabmtl/haven-cms/blob/c20761a07c201a966dbda1f3eae33617f80e1ece/Entity/BasePage.php#L190-L195 |
200,166 | devlabmtl/haven-cms | Entity/BasePage.php | BasePage.addBusCardContent | public function addBusCardContent(\Haven\CmsBundle\Entity\PageContent $pageContents) {
$this->addPageContent($pageContents);
return $this;
} | php | public function addBusCardContent(\Haven\CmsBundle\Entity\PageContent $pageContents) {
$this->addPageContent($pageContents);
return $this;
} | [
"public",
"function",
"addBusCardContent",
"(",
"\\",
"Haven",
"\\",
"CmsBundle",
"\\",
"Entity",
"\\",
"PageContent",
"$",
"pageContents",
")",
"{",
"$",
"this",
"->",
"addPageContent",
"(",
"$",
"pageContents",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Add page_contents for buscardcontent type
@param \Haven\CmsBundle\Entity\PageContent $pageContents
@return Page | [
"Add",
"page_contents",
"for",
"buscardcontent",
"type"
] | c20761a07c201a966dbda1f3eae33617f80e1ece | https://github.com/devlabmtl/haven-cms/blob/c20761a07c201a966dbda1f3eae33617f80e1ece/Entity/BasePage.php#L225-L230 |
200,167 | devlabmtl/haven-cms | Entity/BasePage.php | BasePage.addEnterpriseContent | public function addEnterpriseContent(\Haven\CmsBundle\Entity\PageContent $pageContents) {
$this->addPageContent($pageContents);
return $this;
} | php | public function addEnterpriseContent(\Haven\CmsBundle\Entity\PageContent $pageContents) {
$this->addPageContent($pageContents);
return $this;
} | [
"public",
"function",
"addEnterpriseContent",
"(",
"\\",
"Haven",
"\\",
"CmsBundle",
"\\",
"Entity",
"\\",
"PageContent",
"$",
"pageContents",
")",
"{",
"$",
"this",
"->",
"addPageContent",
"(",
"$",
"pageContents",
")",
";",
"return",
"$",
"this",
";",
"}"
... | Add page_contents for enterprisecontent type
@param \Haven\CmsBundle\Entity\PageContent $pageContents
@return Page | [
"Add",
"page_contents",
"for",
"enterprisecontent",
"type"
] | c20761a07c201a966dbda1f3eae33617f80e1ece | https://github.com/devlabmtl/haven-cms/blob/c20761a07c201a966dbda1f3eae33617f80e1ece/Entity/BasePage.php#L260-L265 |
200,168 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.setSchema | public function setSchema(Schema $schema)
{
$this->schema = $schema;
if (!$this->getSchema()->hasTable($this->getName())) {
$this->getSchema()->addTable($this);
}
} | php | public function setSchema(Schema $schema)
{
$this->schema = $schema;
if (!$this->getSchema()->hasTable($this->getName())) {
$this->getSchema()->addTable($this);
}
} | [
"public",
"function",
"setSchema",
"(",
"Schema",
"$",
"schema",
")",
"{",
"$",
"this",
"->",
"schema",
"=",
"$",
"schema",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"getSchema",
"(",
")",
"->",
"hasTable",
"(",
"$",
"this",
"->",
"getName",
"(",
")"... | Sets the table schema.
@param \Fridge\DBAL\Schema\Schema $schema The table schema. | [
"Sets",
"the",
"table",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L98-L105 |
200,169 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.createColumn | public function createColumn($name, $type, array $properties = array())
{
if (is_string($type)) {
$type = Type::getType($type);
}
$column = new Column($name, $type, $properties);
$this->addColumn($column);
return $column;
} | php | public function createColumn($name, $type, array $properties = array())
{
if (is_string($type)) {
$type = Type::getType($type);
}
$column = new Column($name, $type, $properties);
$this->addColumn($column);
return $column;
} | [
"public",
"function",
"createColumn",
"(",
"$",
"name",
",",
"$",
"type",
",",
"array",
"$",
"properties",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"type",
")",
")",
"{",
"$",
"type",
"=",
"Type",
"::",
"getType",
"(",
... | Creates and adds a new column.
@param string $name The column name.
@param string|\Fridge\DBAL\Type\TypeInterface $type The column type.
@param array $properties The column properties.
@return \Fridge\DBAL\Schema\Column The new column. | [
"Creates",
"and",
"adds",
"a",
"new",
"column",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L116-L126 |
200,170 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.getColumn | public function getColumn($name)
{
if (!$this->hasColumn($name)) {
throw SchemaException::tableColumnDoesNotExist($this->getName(), $name);
}
return $this->columns[$name];
} | php | public function getColumn($name)
{
if (!$this->hasColumn($name)) {
throw SchemaException::tableColumnDoesNotExist($this->getName(), $name);
}
return $this->columns[$name];
} | [
"public",
"function",
"getColumn",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasColumn",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableColumnDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",... | Gets a table column.
@param string $name The table column name.
@throws \Fridge\DBAL\Exception\SchemaException If the column does not exist.
@return \Fridge\DBAL\Schema\Column The table column. | [
"Gets",
"a",
"table",
"column",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L183-L190 |
200,171 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.dropColumn | public function dropColumn($name)
{
if (!$this->hasColumn($name)) {
throw SchemaException::tableColumnDoesNotExist($this->getName(), $name);
}
unset($this->columns[$name]);
} | php | public function dropColumn($name)
{
if (!$this->hasColumn($name)) {
throw SchemaException::tableColumnDoesNotExist($this->getName(), $name);
}
unset($this->columns[$name]);
} | [
"public",
"function",
"dropColumn",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasColumn",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableColumnDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
"... | Drops a column.
@param string $name The column name.
@throws \Fridge\DBAL\Exception\SchemaException If the column does not exist. | [
"Drops",
"a",
"column",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L239-L246 |
200,172 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.createPrimaryKey | public function createPrimaryKey(array $columnNames, $name = null)
{
if ($this->hasPrimaryKey()) {
throw SchemaException::tablePrimaryKeyAlreadyExists($this->getName());
}
$primaryKey = new PrimaryKey($name, $columnNames);
$this->setPrimaryKey($primaryKey);
$thi... | php | public function createPrimaryKey(array $columnNames, $name = null)
{
if ($this->hasPrimaryKey()) {
throw SchemaException::tablePrimaryKeyAlreadyExists($this->getName());
}
$primaryKey = new PrimaryKey($name, $columnNames);
$this->setPrimaryKey($primaryKey);
$thi... | [
"public",
"function",
"createPrimaryKey",
"(",
"array",
"$",
"columnNames",
",",
"$",
"name",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasPrimaryKey",
"(",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tablePrimaryKeyAlreadyExists",
"(",
"$"... | Creates and adds a new primary key.
@param array $columnNames The primary key column names.
@param string $name The primary key name.
@throws \Fridge\DBAL\Exception\SchemaException If a primary key already exists.
@return \Fridge\DBAL\Schema\PrimaryKey The new primary key. | [
"Creates",
"and",
"adds",
"a",
"new",
"primary",
"key",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L258-L270 |
200,173 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.setPrimaryKey | public function setPrimaryKey(PrimaryKey $primaryKey)
{
foreach ($primaryKey->getColumnNames() as $columnName) {
$this->getColumn($columnName)->setNotNull(true);
}
$this->primaryKey = $primaryKey;
} | php | public function setPrimaryKey(PrimaryKey $primaryKey)
{
foreach ($primaryKey->getColumnNames() as $columnName) {
$this->getColumn($columnName)->setNotNull(true);
}
$this->primaryKey = $primaryKey;
} | [
"public",
"function",
"setPrimaryKey",
"(",
"PrimaryKey",
"$",
"primaryKey",
")",
"{",
"foreach",
"(",
"$",
"primaryKey",
"->",
"getColumnNames",
"(",
")",
"as",
"$",
"columnName",
")",
"{",
"$",
"this",
"->",
"getColumn",
"(",
"$",
"columnName",
")",
"->"... | Sets the table primery key.
@param \Fridge\DBAL\Schema\PrimaryKey $primaryKey The table primary key. | [
"Sets",
"the",
"table",
"primery",
"key",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L297-L304 |
200,174 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.dropPrimaryKey | public function dropPrimaryKey()
{
if (!$this->hasPrimaryKey()) {
throw SchemaException::tablePrimaryKeyDoesNotExist($this->getName());
}
foreach ($this->getIndexes() as $index) {
if ($index->hasSameColumnNames($this->getPrimaryKey()->getColumnNames())) {
... | php | public function dropPrimaryKey()
{
if (!$this->hasPrimaryKey()) {
throw SchemaException::tablePrimaryKeyDoesNotExist($this->getName());
}
foreach ($this->getIndexes() as $index) {
if ($index->hasSameColumnNames($this->getPrimaryKey()->getColumnNames())) {
... | [
"public",
"function",
"dropPrimaryKey",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPrimaryKey",
"(",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tablePrimaryKeyDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
")",
";",
"}",
"f... | Drops the table primary key.
@throws \Fridge\DBAL\Exception\SchemaException If there is no primary key. | [
"Drops",
"the",
"table",
"primary",
"key",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L311-L324 |
200,175 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.createForeignKey | public function createForeignKey(
array $localColumnNames,
$foreignTable,
array $foreignColumnNames,
$onDelete = ForeignKey::RESTRICT,
$onUpdate = ForeignKey::RESTRICT,
$name = null
) {
if ($foreignTable instanceof Table) {
$foreignTable = $foreign... | php | public function createForeignKey(
array $localColumnNames,
$foreignTable,
array $foreignColumnNames,
$onDelete = ForeignKey::RESTRICT,
$onUpdate = ForeignKey::RESTRICT,
$name = null
) {
if ($foreignTable instanceof Table) {
$foreignTable = $foreign... | [
"public",
"function",
"createForeignKey",
"(",
"array",
"$",
"localColumnNames",
",",
"$",
"foreignTable",
",",
"array",
"$",
"foreignColumnNames",
",",
"$",
"onDelete",
"=",
"ForeignKey",
"::",
"RESTRICT",
",",
"$",
"onUpdate",
"=",
"ForeignKey",
"::",
"RESTRIC... | Creates and adds a new foreign key.
@param array $localColumnNames The foreign key local column names.
@param string|\Fridge\DBAL\Schema\Table $foreignTable The foreign key foreign table.
@param array $foreignColumnNames The foreign key foreign column names... | [
"Creates",
"and",
"adds",
"a",
"new",
"foreign",
"key",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L338-L364 |
200,176 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.setForeignKeys | public function setForeignKeys(array $foreignKeys)
{
$this->foreignKeys = array();
foreach ($foreignKeys as $foreignKey) {
$this->addForeignKey($foreignKey);
}
} | php | public function setForeignKeys(array $foreignKeys)
{
$this->foreignKeys = array();
foreach ($foreignKeys as $foreignKey) {
$this->addForeignKey($foreignKey);
}
} | [
"public",
"function",
"setForeignKeys",
"(",
"array",
"$",
"foreignKeys",
")",
"{",
"$",
"this",
"->",
"foreignKeys",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"foreignKeys",
"as",
"$",
"foreignKey",
")",
"{",
"$",
"this",
"->",
"addForeignKey",
... | Sets the table foreign keys.
@param array $foreignKeys The table foreign keys. | [
"Sets",
"the",
"table",
"foreign",
"keys",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L391-L398 |
200,177 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.getForeignKey | public function getForeignKey($name)
{
if (!$this->hasForeignKey($name)) {
throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $name);
}
return $this->foreignKeys[$name];
} | php | public function getForeignKey($name)
{
if (!$this->hasForeignKey($name)) {
throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $name);
}
return $this->foreignKeys[$name];
} | [
"public",
"function",
"getForeignKey",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasForeignKey",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableForeignKeyDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",... | Gets a foreign key
@param string $name The foreign key name.
@throws \Fridge\DBAL\Exception\SchemaException If the foreign key does not exist.
@return \Fridge\DBAL\Schema\ForeignKey The foreign key. | [
"Gets",
"a",
"foreign",
"key"
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L421-L428 |
200,178 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.addForeignKey | public function addForeignKey(ForeignKey $foreignKey)
{
if ($this->hasForeignKey($foreignKey->getName())) {
throw SchemaException::tableForeignKeyAlreadyExists($this->getName(), $foreignKey->getName());
}
foreach ($foreignKey->getLocalColumnNames() as $columnName) {
... | php | public function addForeignKey(ForeignKey $foreignKey)
{
if ($this->hasForeignKey($foreignKey->getName())) {
throw SchemaException::tableForeignKeyAlreadyExists($this->getName(), $foreignKey->getName());
}
foreach ($foreignKey->getLocalColumnNames() as $columnName) {
... | [
"public",
"function",
"addForeignKey",
"(",
"ForeignKey",
"$",
"foreignKey",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasForeignKey",
"(",
"$",
"foreignKey",
"->",
"getName",
"(",
")",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableForeignKeyAlreadyExi... | Adds a foreign key to the table.
@param \Fridge\DBAL\Schema\ForeignKey $foreignKey The foreign key to add.
@throws \Fridge\DBAL\Exception\SchemaException If the foreign key already exist, if a local column does not
exist or if a foreign column does not exist. | [
"Adds",
"a",
"foreign",
"key",
"to",
"the",
"table",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L438-L459 |
200,179 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.renameForeignKey | public function renameForeignKey($oldName, $newName)
{
if (!$this->hasForeignKey($oldName)) {
throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $oldName);
}
if ($this->hasForeignKey($newName)) {
throw SchemaException::tableForeignKeyAlreadyExists($... | php | public function renameForeignKey($oldName, $newName)
{
if (!$this->hasForeignKey($oldName)) {
throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $oldName);
}
if ($this->hasForeignKey($newName)) {
throw SchemaException::tableForeignKeyAlreadyExists($... | [
"public",
"function",
"renameForeignKey",
"(",
"$",
"oldName",
",",
"$",
"newName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasForeignKey",
"(",
"$",
"oldName",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableForeignKeyDoesNotExist",
"(",
"$",
... | Renames a foreign key.
@param string $oldName The old foreign key name.
@param string $newName The new foreign key name.
@throws \Fridge\DBAL\Exception\SchemaException If the old foreign key does not exist or if the new foreign key
already exists. | [
"Renames",
"a",
"foreign",
"key",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L470-L483 |
200,180 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.dropForeignKey | public function dropForeignKey($name)
{
if (!$this->hasForeignKey($name)) {
throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $name);
}
unset($this->foreignKeys[$name]);
} | php | public function dropForeignKey($name)
{
if (!$this->hasForeignKey($name)) {
throw SchemaException::tableForeignKeyDoesNotExist($this->getName(), $name);
}
unset($this->foreignKeys[$name]);
} | [
"public",
"function",
"dropForeignKey",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasForeignKey",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableForeignKeyDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"("... | Drops a foreign key.
@param string $name The foreign key name.
@throws \Fridge\DBAL\Exception\SchemaException If the foreign key does not exist. | [
"Drops",
"a",
"foreign",
"key",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L492-L499 |
200,181 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.createIndex | public function createIndex(array $columnNames, $unique = false, $name = null)
{
$index = new Index($name, $columnNames, $unique);
$this->addIndex($index);
return $index;
} | php | public function createIndex(array $columnNames, $unique = false, $name = null)
{
$index = new Index($name, $columnNames, $unique);
$this->addIndex($index);
return $index;
} | [
"public",
"function",
"createIndex",
"(",
"array",
"$",
"columnNames",
",",
"$",
"unique",
"=",
"false",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"index",
"=",
"new",
"Index",
"(",
"$",
"name",
",",
"$",
"columnNames",
",",
"$",
"unique",
")",
... | Creates and adds a new index.
@param array $columnNames The index column names.
@param boolean $unique TRUE if the index is unique else FALSE.
@param string $name The index name.
@return \Fridge\DBAL\Schema\Index The new index. | [
"Creates",
"and",
"adds",
"a",
"new",
"index",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L510-L516 |
200,182 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.setIndexes | public function setIndexes(array $indexes)
{
$this->indexes = array();
foreach ($indexes as $index) {
$this->addIndex($index);
}
} | php | public function setIndexes(array $indexes)
{
$this->indexes = array();
foreach ($indexes as $index) {
$this->addIndex($index);
}
} | [
"public",
"function",
"setIndexes",
"(",
"array",
"$",
"indexes",
")",
"{",
"$",
"this",
"->",
"indexes",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"indexes",
"as",
"$",
"index",
")",
"{",
"$",
"this",
"->",
"addIndex",
"(",
"$",
"index",
"... | Sets the table indexes.
@param array $indexes The table indexes. | [
"Sets",
"the",
"table",
"indexes",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L543-L550 |
200,183 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.getIndex | public function getIndex($name)
{
if (!$this->hasIndex($name)) {
throw SchemaException::tableIndexDoesNotExist($this->getName(), $name);
}
return $this->indexes[$name];
} | php | public function getIndex($name)
{
if (!$this->hasIndex($name)) {
throw SchemaException::tableIndexDoesNotExist($this->getName(), $name);
}
return $this->indexes[$name];
} | [
"public",
"function",
"getIndex",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasIndex",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableIndexDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",
... | Gets a table index.
@param string $name The table index name.
@throws \Fridge\DBAL\Exception\SchemaException If the index does not exist.
@return \Fridge\DBAL\Schema\Index The table index. | [
"Gets",
"a",
"table",
"index",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L595-L602 |
200,184 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.dropIndex | public function dropIndex($name)
{
if (!$this->hasIndex($name)) {
throw SchemaException::tableIndexDoesNotExist($this->getName(), $name);
}
unset($this->indexes[$name]);
} | php | public function dropIndex($name)
{
if (!$this->hasIndex($name)) {
throw SchemaException::tableIndexDoesNotExist($this->getName(), $name);
}
unset($this->indexes[$name]);
} | [
"public",
"function",
"dropIndex",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasIndex",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableIndexDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",... | Drops an index.
@param string $name The index name.
@throws \Fridge\DBAL\Exception\SchemaException If the index does not exist. | [
"Drops",
"an",
"index",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L669-L676 |
200,185 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.createCheck | public function createCheck($constraint, $name = null)
{
$check = new Check($name, $constraint);
$this->addCheck($check);
return $check;
} | php | public function createCheck($constraint, $name = null)
{
$check = new Check($name, $constraint);
$this->addCheck($check);
return $check;
} | [
"public",
"function",
"createCheck",
"(",
"$",
"constraint",
",",
"$",
"name",
"=",
"null",
")",
"{",
"$",
"check",
"=",
"new",
"Check",
"(",
"$",
"name",
",",
"$",
"constraint",
")",
";",
"$",
"this",
"->",
"addCheck",
"(",
"$",
"check",
")",
";",... | Creates and adds a new check.
@param string $constraint The check constraint.
@param string $name The check name.
@return \Fridge\DBAL\Schema\Check The new index. | [
"Creates",
"and",
"adds",
"a",
"new",
"check",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L686-L692 |
200,186 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.setChecks | public function setChecks(array $checks)
{
$this->checks = array();
foreach ($checks as $check) {
$this->addCheck($check);
}
} | php | public function setChecks(array $checks)
{
$this->checks = array();
foreach ($checks as $check) {
$this->addCheck($check);
}
} | [
"public",
"function",
"setChecks",
"(",
"array",
"$",
"checks",
")",
"{",
"$",
"this",
"->",
"checks",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"checks",
"as",
"$",
"check",
")",
"{",
"$",
"this",
"->",
"addCheck",
"(",
"$",
"check",
")",
... | Sets the table chekcs.
@param array $checks The table checks. | [
"Sets",
"the",
"table",
"chekcs",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L719-L726 |
200,187 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.getCheck | public function getCheck($name)
{
if (!$this->hasCheck($name)) {
throw SchemaException::tableCheckDoesNotExist($this->getName(), $name);
}
return $this->checks[$name];
} | php | public function getCheck($name)
{
if (!$this->hasCheck($name)) {
throw SchemaException::tableCheckDoesNotExist($this->getName(), $name);
}
return $this->checks[$name];
} | [
"public",
"function",
"getCheck",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasCheck",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableCheckDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",
... | Gets a table check.
@param string $name The table check name.
@throws \Fridge\DBAL\Exception\SchemaException If the check does not exist.
@return \Fridge\DBAL\Schema\Check The table check. | [
"Gets",
"a",
"table",
"check",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L749-L756 |
200,188 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.addCheck | public function addCheck(Check $check)
{
if ($this->hasCheck($check->getName())) {
throw SchemaException::tableCheckAlreadyExists($this->getName(), $check->getName());
}
$this->checks[$check->getName()] = $check;
} | php | public function addCheck(Check $check)
{
if ($this->hasCheck($check->getName())) {
throw SchemaException::tableCheckAlreadyExists($this->getName(), $check->getName());
}
$this->checks[$check->getName()] = $check;
} | [
"public",
"function",
"addCheck",
"(",
"Check",
"$",
"check",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasCheck",
"(",
"$",
"check",
"->",
"getName",
"(",
")",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableCheckAlreadyExists",
"(",
"$",
"this",
... | Adds a check to the table.
@param \Fridge\DBAL\Schema\Check $check The check to add.
@throws \Fridge\DBAL\Exception\SchemaException If the check already exists. | [
"Adds",
"a",
"check",
"to",
"the",
"table",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L765-L772 |
200,189 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.renameCheck | public function renameCheck($oldName, $newName)
{
if (!$this->hasCheck($oldName)) {
throw SchemaException::tableCheckDoesNotExist($this->getName(), $oldName);
}
if ($this->hasCheck($newName)) {
throw SchemaException::tableCheckAlreadyExists($this->getName(), $newName... | php | public function renameCheck($oldName, $newName)
{
if (!$this->hasCheck($oldName)) {
throw SchemaException::tableCheckDoesNotExist($this->getName(), $oldName);
}
if ($this->hasCheck($newName)) {
throw SchemaException::tableCheckAlreadyExists($this->getName(), $newName... | [
"public",
"function",
"renameCheck",
"(",
"$",
"oldName",
",",
"$",
"newName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasCheck",
"(",
"$",
"oldName",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableCheckDoesNotExist",
"(",
"$",
"this",
"->"... | Renames a check.
@param string $oldName The old check name.
@param string $newName The new check name.
@throws \Fridge\DBAL\Exception\SchemaException If the old check does not exist or if the new check already
exists. | [
"Renames",
"a",
"check",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L783-L796 |
200,190 | fridge-project/dbal | src/Fridge/DBAL/Schema/Table.php | Table.dropCheck | public function dropCheck($name)
{
if (!$this->hasCheck($name)) {
throw SchemaException::tableCheckDoesNotExist($this->getName(), $name);
}
unset($this->checks[$name]);
} | php | public function dropCheck($name)
{
if (!$this->hasCheck($name)) {
throw SchemaException::tableCheckDoesNotExist($this->getName(), $name);
}
unset($this->checks[$name]);
} | [
"public",
"function",
"dropCheck",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasCheck",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"tableCheckDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",... | Drops a check.
@param string $name The check name.
@throws \Fridge\DBAL\Exception\SchemaException If the check does not exist. | [
"Drops",
"a",
"check",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Table.php#L805-L812 |
200,191 | Subscribo/klarna-invoice-sdk-wrapped | src/CheckoutServiceRequest.php | CheckoutServiceRequest.getHeaders | public function getHeaders()
{
$digest = Klarna::digest(
Klarna::colon(
$this->config['eid'],
$this->params['currency'],
$this->config['secret']
)
);
return array(
"Accept: {$this->accept}",
"Aut... | php | public function getHeaders()
{
$digest = Klarna::digest(
Klarna::colon(
$this->config['eid'],
$this->params['currency'],
$this->config['secret']
)
);
return array(
"Accept: {$this->accept}",
"Aut... | [
"public",
"function",
"getHeaders",
"(",
")",
"{",
"$",
"digest",
"=",
"Klarna",
"::",
"digest",
"(",
"Klarna",
"::",
"colon",
"(",
"$",
"this",
"->",
"config",
"[",
"'eid'",
"]",
",",
"$",
"this",
"->",
"params",
"[",
"'currency'",
"]",
",",
"$",
... | Get the headers associated to this request
@return array Array of headers strings | [
"Get",
"the",
"headers",
"associated",
"to",
"this",
"request"
] | 4a45ddd9ec444f5a6d02628ad65e635a3e12611c | https://github.com/Subscribo/klarna-invoice-sdk-wrapped/blob/4a45ddd9ec444f5a6d02628ad65e635a3e12611c/src/CheckoutServiceRequest.php#L91-L105 |
200,192 | NigelGreenway/Demander | src/ViewModel/AbstractViewModel.php | AbstractViewModel.toArray | private function toArray()
{
$data = [];
$reflection = new ReflectionClass($this);
foreach ($reflection->getProperties() as $property) {
$property->setAccessible(true);
$data[$property->getName()] = $property->getValue($this);
}
return $data;
} | php | private function toArray()
{
$data = [];
$reflection = new ReflectionClass($this);
foreach ($reflection->getProperties() as $property) {
$property->setAccessible(true);
$data[$property->getName()] = $property->getValue($this);
}
return $data;
} | [
"private",
"function",
"toArray",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"reflection",
"=",
"new",
"ReflectionClass",
"(",
"$",
"this",
")",
";",
"foreach",
"(",
"$",
"reflection",
"->",
"getProperties",
"(",
")",
"as",
"$",
"property",
... | Convert the ViewModel object to an array
@return array | [
"Convert",
"the",
"ViewModel",
"object",
"to",
"an",
"array"
] | 2481c2deb28c6d8da37b0155fa41dcd4627a979f | https://github.com/NigelGreenway/Demander/blob/2481c2deb28c6d8da37b0155fa41dcd4627a979f/src/ViewModel/AbstractViewModel.php#L38-L50 |
200,193 | mtils/cmsable | src/Cmsable/Model/TreeModelManager.php | TreeModelManager.makeModel | protected function makeModel(TreeScope $scope){
$model = clone $this->treeModelPrototype;
$model->setRootId($scope->getModelRootId());
$model->setPathPrefix($scope->getPathPrefix());
return $model;
} | php | protected function makeModel(TreeScope $scope){
$model = clone $this->treeModelPrototype;
$model->setRootId($scope->getModelRootId());
$model->setPathPrefix($scope->getPathPrefix());
return $model;
} | [
"protected",
"function",
"makeModel",
"(",
"TreeScope",
"$",
"scope",
")",
"{",
"$",
"model",
"=",
"clone",
"$",
"this",
"->",
"treeModelPrototype",
";",
"$",
"model",
"->",
"setRootId",
"(",
"$",
"scope",
"->",
"getModelRootId",
"(",
")",
")",
";",
"$",... | Make a sitetree model
@param \Cmsable\Routing\TreeScope\TreeScope $scope
@return \Cmsable\Model\SiteTreeModelInterface | [
"Make",
"a",
"sitetree",
"model"
] | 03ae84ee3c7d46146f2a1cf687e5c29d6de4286d | https://github.com/mtils/cmsable/blob/03ae84ee3c7d46146f2a1cf687e5c29d6de4286d/src/Cmsable/Model/TreeModelManager.php#L77-L85 |
200,194 | eureka-framework/component-config | src/Config/EmptyParser.php | EmptyParser.dump | public function dump($file, $content)
{
$fileWrited = file_put_contents($file, '<?php return ' . var_export($content, true) . ';');
if ($fileWrited === false) {
throw new \Exception('Unable to dump data into php file !');
}
} | php | public function dump($file, $content)
{
$fileWrited = file_put_contents($file, '<?php return ' . var_export($content, true) . ';');
if ($fileWrited === false) {
throw new \Exception('Unable to dump data into php file !');
}
} | [
"public",
"function",
"dump",
"(",
"$",
"file",
",",
"$",
"content",
")",
"{",
"$",
"fileWrited",
"=",
"file_put_contents",
"(",
"$",
"file",
",",
"'<?php return '",
".",
"var_export",
"(",
"$",
"content",
",",
"true",
")",
".",
"';'",
")",
";",
"if",
... | Dump data into php file.
@param string $file
@param mixed $content
@throws \Exception | [
"Dump",
"data",
"into",
"php",
"file",
"."
] | ae3f17683fb3e96641b65375c6cca6a3139ae85e | https://github.com/eureka-framework/component-config/blob/ae3f17683fb3e96641b65375c6cca6a3139ae85e/src/Config/EmptyParser.php#L44-L51 |
200,195 | OxfordInfoLabs/kinikit-core | src/Object/AssociativeArray.php | AssociativeArray.toArray | public function toArray($deep = true) {
// Get each property
$array = array();
foreach ($this->__getSerialisablePropertyMap() as $key => $value) {
if ($value instanceof AssociativeArray) {
$array[$key] = $deep ? $value->toArray() : $value;
} else {
... | php | public function toArray($deep = true) {
// Get each property
$array = array();
foreach ($this->__getSerialisablePropertyMap() as $key => $value) {
if ($value instanceof AssociativeArray) {
$array[$key] = $deep ? $value->toArray() : $value;
} else {
... | [
"public",
"function",
"toArray",
"(",
"$",
"deep",
"=",
"true",
")",
"{",
"// Get each property",
"$",
"array",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"__getSerialisablePropertyMap",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value"... | Convert this into a regular php array. | [
"Convert",
"this",
"into",
"a",
"regular",
"php",
"array",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Object/AssociativeArray.php#L21-L34 |
200,196 | OxfordInfoLabs/kinikit-core | src/Object/AssociativeArray.php | AssociativeArray.toAssociative | public static function toAssociative($array, $recursive = false) {
$associative = new AssociativeArray();
foreach($array as $key => $value) {
if ($recursive && is_array($value)) {
$associative[$key] = self::toAssociative($value, true);
} else {
$a... | php | public static function toAssociative($array, $recursive = false) {
$associative = new AssociativeArray();
foreach($array as $key => $value) {
if ($recursive && is_array($value)) {
$associative[$key] = self::toAssociative($value, true);
} else {
$a... | [
"public",
"static",
"function",
"toAssociative",
"(",
"$",
"array",
",",
"$",
"recursive",
"=",
"false",
")",
"{",
"$",
"associative",
"=",
"new",
"AssociativeArray",
"(",
")",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"key",
"=>",
"$",
"value",
")... | Convert a regular array to an associative array. optionally recursive is required.
@param $array
@param bool $recursive | [
"Convert",
"a",
"regular",
"array",
"to",
"an",
"associative",
"array",
".",
"optionally",
"recursive",
"is",
"required",
"."
] | edc1b2e6ffabd595c4c7d322279b3dd1e59ef359 | https://github.com/OxfordInfoLabs/kinikit-core/blob/edc1b2e6ffabd595c4c7d322279b3dd1e59ef359/src/Object/AssociativeArray.php#L42-L55 |
200,197 | fuelphp-storage/session | src/Driver/File.php | File.writeFile | protected function writeFile($payload)
{
// construct the session file name
$file = $this->config['file']['path'].$this->config['file']['cookie_name'].'_'.$this->sessionId;
// open the file
if ( ! $handle = fopen($file,'c'))
{
throw new \Exception('Could not open the session file in "'.$this->config['fil... | php | protected function writeFile($payload)
{
// construct the session file name
$file = $this->config['file']['path'].$this->config['file']['cookie_name'].'_'.$this->sessionId;
// open the file
if ( ! $handle = fopen($file,'c'))
{
throw new \Exception('Could not open the session file in "'.$this->config['fil... | [
"protected",
"function",
"writeFile",
"(",
"$",
"payload",
")",
"{",
"// construct the session file name",
"$",
"file",
"=",
"$",
"this",
"->",
"config",
"[",
"'file'",
"]",
"[",
"'path'",
"]",
".",
"$",
"this",
"->",
"config",
"[",
"'file'",
"]",
"[",
"... | Writes the session file
@return boolean | [
"Writes",
"the",
"session",
"file"
] | 948fd2b45286e65e7fababf65de89ca6aaca3c4a | https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Driver/File.php#L232-L259 |
200,198 | fuelphp-storage/session | src/Driver/File.php | File.readFile | protected function readFile()
{
// construct the session file name
$file = $this->config['file']['path'].$this->config['file']['cookie_name'].'_'.$this->sessionId;
if (is_file($file) and $handle = fopen($file,'r'))
{
// wait for a lock
while ( ! flock($handle, LOCK_SH));
if ($size = filesize($file))... | php | protected function readFile()
{
// construct the session file name
$file = $this->config['file']['path'].$this->config['file']['cookie_name'].'_'.$this->sessionId;
if (is_file($file) and $handle = fopen($file,'r'))
{
// wait for a lock
while ( ! flock($handle, LOCK_SH));
if ($size = filesize($file))... | [
"protected",
"function",
"readFile",
"(",
")",
"{",
"// construct the session file name",
"$",
"file",
"=",
"$",
"this",
"->",
"config",
"[",
"'file'",
"]",
"[",
"'path'",
"]",
".",
"$",
"this",
"->",
"config",
"[",
"'file'",
"]",
"[",
"'cookie_name'",
"]"... | Reads the session file
@return string|boolean | [
"Reads",
"the",
"session",
"file"
] | 948fd2b45286e65e7fababf65de89ca6aaca3c4a | https://github.com/fuelphp-storage/session/blob/948fd2b45286e65e7fababf65de89ca6aaca3c4a/src/Driver/File.php#L268-L301 |
200,199 | wb-crowdfusion/crowdfusion | system/core/classes/libraries/xml/SimpleXMLExtended.php | SimpleXMLExtended.attribute | public function attribute($name)
{
$v = $this->attributes()->$name;
if(!empty($v))
return (string)$v;
} | php | public function attribute($name)
{
$v = $this->attributes()->$name;
if(!empty($v))
return (string)$v;
} | [
"public",
"function",
"attribute",
"(",
"$",
"name",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"attributes",
"(",
")",
"->",
"$",
"name",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"v",
")",
")",
"return",
"(",
"string",
")",
"$",
"v",
";",
"}... | Retrieves and attribute by name
@param string $name The name of the attribute to get
@return mixed Returns nothing if not found, or a string for the value of the found attribute | [
"Retrieves",
"and",
"attribute",
"by",
"name"
] | 8cad7988f046a6fefbed07d026cb4ae6706c1217 | https://github.com/wb-crowdfusion/crowdfusion/blob/8cad7988f046a6fefbed07d026cb4ae6706c1217/system/core/classes/libraries/xml/SimpleXMLExtended.php#L35-L40 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.