repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
huasituo/hstcms | src/Libraries/HstcmsRsaSign.php | HstcmsRsaSign.createSign | public function createSign($data = '')
{
if (!is_string($data)) {
return null;
}
return openssl_sign(
$data,
$sign,
self::getPrivateKey(),
OPENSSL_ALGO_SHA256
) ? base64_encode($sign... | php | public function createSign($data = '')
{
if (!is_string($data)) {
return null;
}
return openssl_sign(
$data,
$sign,
self::getPrivateKey(),
OPENSSL_ALGO_SHA256
) ? base64_encode($sign... | [
"public",
"function",
"createSign",
"(",
"$",
"data",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"data",
")",
")",
"{",
"return",
"null",
";",
"}",
"return",
"openssl_sign",
"(",
"$",
"data",
",",
"$",
"sign",
",",
"self",
"::",
... | 创建签名
@param string $data 数据
@return null|string | [
"创建签名"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/HstcmsRsaSign.php#L52-L63 |
huasituo/hstcms | src/Libraries/HstcmsRsaSign.php | HstcmsRsaSign.verifySign | public function verifySign($data = '', $sign = '')
{
if (!is_string($sign) || !is_string($sign)) {
return false;
}
return (bool)openssl_verify(
$data,
base64_decode($sign),
self::getPublicKey(),
... | php | public function verifySign($data = '', $sign = '')
{
if (!is_string($sign) || !is_string($sign)) {
return false;
}
return (bool)openssl_verify(
$data,
base64_decode($sign),
self::getPublicKey(),
... | [
"public",
"function",
"verifySign",
"(",
"$",
"data",
"=",
"''",
",",
"$",
"sign",
"=",
"''",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"sign",
")",
"||",
"!",
"is_string",
"(",
"$",
"sign",
")",
")",
"{",
"return",
"false",
";",
"}",
"r... | 验证签名
@param string $data 数据
@param string $sign 签名
@return bool | [
"验证签名"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/HstcmsRsaSign.php#L71-L82 |
sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php | OrderController.fieldsAction | public function fieldsAction(Request $request)
{
$locale = $this->getLocale($request);
// default contacts list
return $this->handleView($this->view(array_values($this->getManager()->getFieldDescriptors($locale)), 200));
} | php | public function fieldsAction(Request $request)
{
$locale = $this->getLocale($request);
// default contacts list
return $this->handleView($this->view(array_values($this->getManager()->getFieldDescriptors($locale)), 200));
} | [
"public",
"function",
"fieldsAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"getLocale",
"(",
"$",
"request",
")",
";",
"// default contacts list",
"return",
"$",
"this",
"->",
"handleView",
"(",
"$",
"this",
"->"... | returns all fields that can be used by list
@param Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"returns",
"all",
"fields",
"that",
"can",
"be",
"used",
"by",
"list"
] | train | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php#L72-L78 |
sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php | OrderController.getAction | public function getAction(Request $request, $id)
{
$locale = $this->getLocale($request);
$view = $this->responseGetById(
$id,
function ($id) use ($locale) {
/** @var Order $order */
$order = $this->getManager()->findByIdAndLocale($id, $locale);... | php | public function getAction(Request $request, $id)
{
$locale = $this->getLocale($request);
$view = $this->responseGetById(
$id,
function ($id) use ($locale) {
/** @var Order $order */
$order = $this->getManager()->findByIdAndLocale($id, $locale);... | [
"public",
"function",
"getAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"$",
"locale",
"=",
"$",
"this",
"->",
"getLocale",
"(",
"$",
"request",
")",
";",
"$",
"view",
"=",
"$",
"this",
"->",
"responseGetById",
"(",
"$",
"id",
... | Retrieves and shows an order with the given ID
@param \Symfony\Component\HttpFoundation\Request $request
@param integer $id order ID
@return \Symfony\Component\HttpFoundation\Response | [
"Retrieves",
"and",
"shows",
"an",
"order",
"with",
"the",
"given",
"ID"
] | train | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php#L144-L170 |
sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php | OrderController.postAction | public function postAction(Request $request)
{
try {
$data = $request->request->all();
$data['type'] = OrderType::MANUAL;
$order = $this->getManager()->save(
$data,
$this->getLocale($request),
$this->getUser()->getId()
... | php | public function postAction(Request $request)
{
try {
$data = $request->request->all();
$data['type'] = OrderType::MANUAL;
$order = $this->getManager()->save(
$data,
$this->getLocale($request),
$this->getUser()->getId()
... | [
"public",
"function",
"postAction",
"(",
"Request",
"$",
"request",
")",
"{",
"try",
"{",
"$",
"data",
"=",
"$",
"request",
"->",
"request",
"->",
"all",
"(",
")",
";",
"$",
"data",
"[",
"'type'",
"]",
"=",
"OrderType",
"::",
"MANUAL",
";",
"$",
"o... | Creates and stores a new order.
@param \Symfony\Component\HttpFoundation\Request $request
@return \Symfony\Component\HttpFoundation\Response | [
"Creates",
"and",
"stores",
"a",
"new",
"order",
"."
] | train | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php#L178-L200 |
sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php | OrderController.putAction | public function putAction(Request $request, $id)
{
try {
$order = $this->getManager()->save(
$request->request->all(),
$this->getLocale($request),
$this->getUser()->getId(),
$id
);
$view = $this->view($order... | php | public function putAction(Request $request, $id)
{
try {
$order = $this->getManager()->save(
$request->request->all(),
$this->getLocale($request),
$this->getUser()->getId(),
$id
);
$view = $this->view($order... | [
"public",
"function",
"putAction",
"(",
"Request",
"$",
"request",
",",
"$",
"id",
")",
"{",
"try",
"{",
"$",
"order",
"=",
"$",
"this",
"->",
"getManager",
"(",
")",
"->",
"save",
"(",
"$",
"request",
"->",
"request",
"->",
"all",
"(",
")",
",",
... | Change a order.
@param \Symfony\Component\HttpFoundation\Request $request
@param $id order ID
@return \Symfony\Component\HttpFoundation\Response | [
"Change",
"a",
"order",
"."
] | train | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php#L209-L235 |
sulu/SuluSalesShippingBundle | src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php | OrderController.getStatusFieldDescriptor | private function getStatusFieldDescriptor()
{
return new DoctrineFieldDescriptor(
'id',
'status_id',
self::$orderStatusEntityName,
'salesorder.orders.status',
array(
self::$orderStatusEntityName => new DoctrineJoinDescriptor(
... | php | private function getStatusFieldDescriptor()
{
return new DoctrineFieldDescriptor(
'id',
'status_id',
self::$orderStatusEntityName,
'salesorder.orders.status',
array(
self::$orderStatusEntityName => new DoctrineJoinDescriptor(
... | [
"private",
"function",
"getStatusFieldDescriptor",
"(",
")",
"{",
"return",
"new",
"DoctrineFieldDescriptor",
"(",
"'id'",
",",
"'status_id'",
",",
"self",
"::",
"$",
"orderStatusEntityName",
",",
"'salesorder.orders.status'",
",",
"array",
"(",
"self",
"::",
"$",
... | holds status field descriptor (which is not needed in list)
@return DoctrineFieldDescriptor | [
"holds",
"status",
"field",
"descriptor",
"(",
"which",
"is",
"not",
"needed",
"in",
"list",
")"
] | train | https://github.com/sulu/SuluSalesShippingBundle/blob/0d39de262d58579e5679db99a77dbf717d600b5e/src/Sulu/Bundle/Sales/OrderBundle/Controller/OrderController.php#L295-L309 |
contao-bootstrap/buttons | src/Netzmacht/Bootstrap/Buttons/ChildAware.php | ChildAware.eachChild | public function eachChild($callback)
{
foreach ($this->children as $child) {
call_user_func($callback, $child);
}
return $this;
} | php | public function eachChild($callback)
{
foreach ($this->children as $child) {
call_user_func($callback, $child);
}
return $this;
} | [
"public",
"function",
"eachChild",
"(",
"$",
"callback",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"child",
")",
"{",
"call_user_func",
"(",
"$",
"callback",
",",
"$",
"child",
")",
";",
"}",
"return",
"$",
"this",
";",
"}"
... | Run a callback for each child.
@param \Callable $callback Callback which accepts the child as argument.
@return $this | [
"Run",
"a",
"callback",
"for",
"each",
"child",
"."
] | train | https://github.com/contao-bootstrap/buttons/blob/f573a24c19ec059aae528a12ba46dfc993844201/src/Netzmacht/Bootstrap/Buttons/ChildAware.php#L66-L73 |
contao-bootstrap/buttons | src/Netzmacht/Bootstrap/Buttons/ChildAware.php | ChildAware.generateChildren | protected function generateChildren()
{
$buffer = '';
foreach ($this->children as $child) {
$buffer .= $child->generate();
}
return $buffer;
} | php | protected function generateChildren()
{
$buffer = '';
foreach ($this->children as $child) {
$buffer .= $child->generate();
}
return $buffer;
} | [
"protected",
"function",
"generateChildren",
"(",
")",
"{",
"$",
"buffer",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"children",
"as",
"$",
"child",
")",
"{",
"$",
"buffer",
".=",
"$",
"child",
"->",
"generate",
"(",
")",
";",
"}",
"return",... | Generate children.
@return string | [
"Generate",
"children",
"."
] | train | https://github.com/contao-bootstrap/buttons/blob/f573a24c19ec059aae528a12ba46dfc993844201/src/Netzmacht/Bootstrap/Buttons/ChildAware.php#L107-L116 |
fuelphp/display | src/Parser/TwigLoader.php | TwigLoader.findView | public function findView($name)
{
if (substr($name, -5) !== '.twig')
{
$name .= '.twig';
}
if ( ! $file = parent::findView($name))
{
throw new Twig_Error_Loader('Could not locate: '.$name);
}
return $file;
} | php | public function findView($name)
{
if (substr($name, -5) !== '.twig')
{
$name .= '.twig';
}
if ( ! $file = parent::findView($name))
{
throw new Twig_Error_Loader('Could not locate: '.$name);
}
return $file;
} | [
"public",
"function",
"findView",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"name",
",",
"-",
"5",
")",
"!==",
"'.twig'",
")",
"{",
"$",
"name",
".=",
"'.twig'",
";",
"}",
"if",
"(",
"!",
"$",
"file",
"=",
"parent",
"::",
"find... | {@inheritdoc}
@throws Twig_Error_Loader If the view is not found | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/Parser/TwigLoader.php#L27-L40 |
fuelphp/display | src/Parser/TwigLoader.php | TwigLoader.isFresh | public function isFresh($name, $time)
{
$file = $this->findView($name);
return filemtime($file) >= $time;
} | php | public function isFresh($name, $time)
{
$file = $this->findView($name);
return filemtime($file) >= $time;
} | [
"public",
"function",
"isFresh",
"(",
"$",
"name",
",",
"$",
"time",
")",
"{",
"$",
"file",
"=",
"$",
"this",
"->",
"findView",
"(",
"$",
"name",
")",
";",
"return",
"filemtime",
"(",
"$",
"file",
")",
">=",
"$",
"time",
";",
"}"
] | {@inheritdoc} | [
"{"
] | train | https://github.com/fuelphp/display/blob/d9a3eddbf80f0fd81beb40d9f4507600ac6611a4/src/Parser/TwigLoader.php#L63-L68 |
drupol/valuewrapper | src/Object/DateTimeObject.php | DateTimeObject.hash | public function hash(): string
{
return $this->doHash($this->type() . $this->class() . $this->value()->getTimestamp());
} | php | public function hash(): string
{
return $this->doHash($this->type() . $this->class() . $this->value()->getTimestamp());
} | [
"public",
"function",
"hash",
"(",
")",
":",
"string",
"{",
"return",
"$",
"this",
"->",
"doHash",
"(",
"$",
"this",
"->",
"type",
"(",
")",
".",
"$",
"this",
"->",
"class",
"(",
")",
".",
"$",
"this",
"->",
"value",
"(",
")",
"->",
"getTimestamp... | {@inheritdoc} | [
"{"
] | train | https://github.com/drupol/valuewrapper/blob/49cc07e4d0284718c24ba6e9cf524c1f4226694e/src/Object/DateTimeObject.php#L25-L28 |
drupol/valuewrapper | src/Object/DateTimeObject.php | DateTimeObject.unserialize | public function unserialize($serialized)
{
$unserialize = \unserialize($serialized);
$this->set(
(new \DateTime())->setTimestamp($unserialize['value'])
);
} | php | public function unserialize($serialized)
{
$unserialize = \unserialize($serialized);
$this->set(
(new \DateTime())->setTimestamp($unserialize['value'])
);
} | [
"public",
"function",
"unserialize",
"(",
"$",
"serialized",
")",
"{",
"$",
"unserialize",
"=",
"\\",
"unserialize",
"(",
"$",
"serialized",
")",
";",
"$",
"this",
"->",
"set",
"(",
"(",
"new",
"\\",
"DateTime",
"(",
")",
")",
"->",
"setTimestamp",
"("... | {@inheritdoc} | [
"{"
] | train | https://github.com/drupol/valuewrapper/blob/49cc07e4d0284718c24ba6e9cf524c1f4226694e/src/Object/DateTimeObject.php#L43-L50 |
czim/laravel-pxlcms | src/Generator/Writer/Repository/Steps/StubReplaceImportsAndTraits.php | StubReplaceImportsAndTraits.getImportsReplace | protected function getImportsReplace()
{
// build up import lines
$importLines = [
config('pxlcms.generator.repositories.extend_class')
];
// model classname
$importLines[] = $this->context->makeFqnForModelName( studly_case($this->data->name) );;
// s... | php | protected function getImportsReplace()
{
// build up import lines
$importLines = [
config('pxlcms.generator.repositories.extend_class')
];
// model classname
$importLines[] = $this->context->makeFqnForModelName( studly_case($this->data->name) );;
// s... | [
"protected",
"function",
"getImportsReplace",
"(",
")",
"{",
"// build up import lines",
"$",
"importLines",
"=",
"[",
"config",
"(",
"'pxlcms.generator.repositories.extend_class'",
")",
"]",
";",
"// model classname",
"$",
"importLines",
"[",
"]",
"=",
"$",
"this",
... | Returns the replacement for the use use-imports placeholder
@return string | [
"Returns",
"the",
"replacement",
"for",
"the",
"use",
"use",
"-",
"imports",
"placeholder"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Generator/Writer/Repository/Steps/StubReplaceImportsAndTraits.php#L25-L61 |
ray-di/Ray.WebFormModule | src/FormFactory.php | FormFactory.newInstance | public function newInstance($class)
{
/** @var $form AbstractForm */
$form = new $class;
$form->setBaseDependencies(new Builder, new FilterFactory, new HelperLocatorFactory);
$form->postConstruct();
return $form;
} | php | public function newInstance($class)
{
/** @var $form AbstractForm */
$form = new $class;
$form->setBaseDependencies(new Builder, new FilterFactory, new HelperLocatorFactory);
$form->postConstruct();
return $form;
} | [
"public",
"function",
"newInstance",
"(",
"$",
"class",
")",
"{",
"/** @var $form AbstractForm */",
"$",
"form",
"=",
"new",
"$",
"class",
";",
"$",
"form",
"->",
"setBaseDependencies",
"(",
"new",
"Builder",
",",
"new",
"FilterFactory",
",",
"new",
"HelperLoc... | @param string $class
@return AbstractForm | [
"@param",
"string",
"$class"
] | train | https://github.com/ray-di/Ray.WebFormModule/blob/4b6d33adb4a5c285278a068f3e7a5afdc4e680d9/src/FormFactory.php#L20-L28 |
o2system/filesystem | src/Handlers/Downloader.php | Downloader.getMime | private function getMime($filePath)
{
$file = new File($filePath);
$mime = $file->getMime();
if (is_array($mime)) {
$mime = reset($mime);
}
return $mime;
} | php | private function getMime($filePath)
{
$file = new File($filePath);
$mime = $file->getMime();
if (is_array($mime)) {
$mime = reset($mime);
}
return $mime;
} | [
"private",
"function",
"getMime",
"(",
"$",
"filePath",
")",
"{",
"$",
"file",
"=",
"new",
"File",
"(",
"$",
"filePath",
")",
";",
"$",
"mime",
"=",
"$",
"file",
"->",
"getMime",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"mime",
")",
")",
... | Downloader::getMime
@param string $filePath
@return string | [
"Downloader",
"::",
"getMime"
] | train | https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/Handlers/Downloader.php#L235-L245 |
o2system/filesystem | src/Handlers/Downloader.php | Downloader.forceDownload | public function forceDownload($filename = null, $filemime = 'application/octet-stream')
{
// Force mime
$this->filemime = $filemime;
$this->download($filename);
} | php | public function forceDownload($filename = null, $filemime = 'application/octet-stream')
{
// Force mime
$this->filemime = $filemime;
$this->download($filename);
} | [
"public",
"function",
"forceDownload",
"(",
"$",
"filename",
"=",
"null",
",",
"$",
"filemime",
"=",
"'application/octet-stream'",
")",
"{",
"// Force mime",
"$",
"this",
"->",
"filemime",
"=",
"$",
"filemime",
";",
"$",
"this",
"->",
"download",
"(",
"$",
... | Downloader::forceDownload
@param string|null $filename
@param string $filemime | [
"Downloader",
"::",
"forceDownload"
] | train | https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/Handlers/Downloader.php#L255-L260 |
o2system/filesystem | src/Handlers/Downloader.php | Downloader.download | public function download($filename = null)
{
$filename = isset($filename) ? $filename : $this->fileinfo[ 'basename' ];
if ($this->partialRequest) {
if ($this->resumeable) {
// Turn on resume capability
output()
->sendHeaderStatus(206, ... | php | public function download($filename = null)
{
$filename = isset($filename) ? $filename : $this->fileinfo[ 'basename' ];
if ($this->partialRequest) {
if ($this->resumeable) {
// Turn on resume capability
output()
->sendHeaderStatus(206, ... | [
"public",
"function",
"download",
"(",
"$",
"filename",
"=",
"null",
")",
"{",
"$",
"filename",
"=",
"isset",
"(",
"$",
"filename",
")",
"?",
"$",
"filename",
":",
"$",
"this",
"->",
"fileinfo",
"[",
"'basename'",
"]",
";",
"if",
"(",
"$",
"this",
... | Downloader::download
@param string|null $filename | [
"Downloader",
"::",
"download"
] | train | https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/Handlers/Downloader.php#L269-L393 |
o2system/filesystem | src/Handlers/Downloader.php | Downloader.resumeable | public function resumeable($status = true)
{
$this->partialRequest = $this->resumeable = ( bool )$status;
return $this;
} | php | public function resumeable($status = true)
{
$this->partialRequest = $this->resumeable = ( bool )$status;
return $this;
} | [
"public",
"function",
"resumeable",
"(",
"$",
"status",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"partialRequest",
"=",
"$",
"this",
"->",
"resumeable",
"=",
"(",
"bool",
")",
"$",
"status",
";",
"return",
"$",
"this",
";",
"}"
] | Downloader::resumeable
@param bool $status
@return static | [
"Downloader",
"::",
"resumeable"
] | train | https://github.com/o2system/filesystem/blob/58f6515f56bcc92408dc155add570c99a0abb6e8/src/Handlers/Downloader.php#L404-L409 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bind | protected function bind($vars, ServerRequestInterface $request, array $parts)
{
$type = is_array($vars) && array_keys($vars) === array_keys(array_keys($vars)) ? 'numeric' : 'assoc';
$values = $this->bindParts($vars, $type, $request, $parts);
if ($vars instanceof Route) {
$class... | php | protected function bind($vars, ServerRequestInterface $request, array $parts)
{
$type = is_array($vars) && array_keys($vars) === array_keys(array_keys($vars)) ? 'numeric' : 'assoc';
$values = $this->bindParts($vars, $type, $request, $parts);
if ($vars instanceof Route) {
$class... | [
"protected",
"function",
"bind",
"(",
"$",
"vars",
",",
"ServerRequestInterface",
"$",
"request",
",",
"array",
"$",
"parts",
")",
"{",
"$",
"type",
"=",
"is_array",
"(",
"$",
"vars",
")",
"&&",
"array_keys",
"(",
"$",
"vars",
")",
"===",
"array_keys",
... | Fill out the routes variables based on the url parts.
@param array|\stdClass $vars Route variables
@param ServerRequestInterface $request
@param array $parts URL parts
@return array | [
"Fill",
"out",
"the",
"routes",
"variables",
"based",
"on",
"the",
"url",
"parts",
"."
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L21-L35 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindParts | protected function bindParts($vars, $type, ServerRequestInterface $request, array $parts)
{
$values = [];
foreach ($vars as $key => $var) {
$part = null;
$bound =
$this->bindPartObject($var, $part) ||
$this->bindPartArray(... | php | protected function bindParts($vars, $type, ServerRequestInterface $request, array $parts)
{
$values = [];
foreach ($vars as $key => $var) {
$part = null;
$bound =
$this->bindPartObject($var, $part) ||
$this->bindPartArray(... | [
"protected",
"function",
"bindParts",
"(",
"$",
"vars",
",",
"$",
"type",
",",
"ServerRequestInterface",
"$",
"request",
",",
"array",
"$",
"parts",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"vars",
"as",
"$",
"key",
"=>",
"$"... | Fill out the values based on the url parts.
@param array|\stdClass $vars Route variables
@param string $type
@param ServerRequestInterface $request
@param array $parts URL parts
@return array | [
"Fill",
"out",
"the",
"values",
"based",
"on",
"the",
"url",
"parts",
"."
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L47-L71 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindPartArray | protected function bindPartArray($var, ServerRequestInterface $request, array $parts, &$part)
{
if (!is_array($var) && !$var instanceof \stdClass) {
return false;
}
$part = [$this->bind($var, $request, $parts)];
return true;
} | php | protected function bindPartArray($var, ServerRequestInterface $request, array $parts, &$part)
{
if (!is_array($var) && !$var instanceof \stdClass) {
return false;
}
$part = [$this->bind($var, $request, $parts)];
return true;
} | [
"protected",
"function",
"bindPartArray",
"(",
"$",
"var",
",",
"ServerRequestInterface",
"$",
"request",
",",
"array",
"$",
"parts",
",",
"&",
"$",
"part",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"var",
")",
"&&",
"!",
"$",
"var",
"instanceof"... | Bind part if it's an array
@param mixed $var
@param ServerRequestInterface $request
@param array $parts
@param array $part OUTPUT
@return boolean | [
"Bind",
"part",
"if",
"it",
"s",
"an",
"array"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L99-L107 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindPartVar | protected function bindPartVar($var, $type, ServerRequestInterface $request, array $parts, &$part)
{
if (!is_string($var) || $var[0] !== '$') {
return false;
}
$options = array_map('trim', explode('|', $var));
$part = $this->bindVar($type, $request, $parts, $opti... | php | protected function bindPartVar($var, $type, ServerRequestInterface $request, array $parts, &$part)
{
if (!is_string($var) || $var[0] !== '$') {
return false;
}
$options = array_map('trim', explode('|', $var));
$part = $this->bindVar($type, $request, $parts, $opti... | [
"protected",
"function",
"bindPartVar",
"(",
"$",
"var",
",",
"$",
"type",
",",
"ServerRequestInterface",
"$",
"request",
",",
"array",
"$",
"parts",
",",
"&",
"$",
"part",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"var",
")",
"||",
"$",
"var"... | Bind part if it's an variable
@param mixed $var
@param string $type
@param ServerRequestInterface $request
@param array $parts
@param array $part OUTPUT
@return boolean | [
"Bind",
"part",
"if",
"it",
"s",
"an",
"variable"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L119-L128 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindPartConcat | protected function bindPartConcat($var, ServerRequestInterface $request, array $parts, &$part)
{
if (!is_string($var) || $var[0] !== '~' || substr($var, -1) !== '~') {
return false;
}
$pieces = array_map('trim', explode('~', substr($var, 1, -1)));
$bound = array_... | php | protected function bindPartConcat($var, ServerRequestInterface $request, array $parts, &$part)
{
if (!is_string($var) || $var[0] !== '~' || substr($var, -1) !== '~') {
return false;
}
$pieces = array_map('trim', explode('~', substr($var, 1, -1)));
$bound = array_... | [
"protected",
"function",
"bindPartConcat",
"(",
"$",
"var",
",",
"ServerRequestInterface",
"$",
"request",
",",
"array",
"$",
"parts",
",",
"&",
"$",
"part",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"var",
")",
"||",
"$",
"var",
"[",
"0",
"]"... | Bind part if it's an concatenation
@param mixed $var
@param ServerRequestInterface $request
@param array $parts
@param array $part OUTPUT
@return boolean | [
"Bind",
"part",
"if",
"it",
"s",
"an",
"concatenation"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L139-L150 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindVar | protected function bindVar($type, ServerRequestInterface $request, array $parts, array $options)
{
foreach ($options as $option) {
$value = null;
$bound =
$this->bindVarString($option, $value) ||
$this->bindVarSuperGlobal($option, $reques... | php | protected function bindVar($type, ServerRequestInterface $request, array $parts, array $options)
{
foreach ($options as $option) {
$value = null;
$bound =
$this->bindVarString($option, $value) ||
$this->bindVarSuperGlobal($option, $reques... | [
"protected",
"function",
"bindVar",
"(",
"$",
"type",
",",
"ServerRequestInterface",
"$",
"request",
",",
"array",
"$",
"parts",
",",
"array",
"$",
"options",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"option",
")",
"{",
"$",
"value",
"=",
"... | Bind variable
@param string $type 'assoc' or 'numeric'
@param ServerRequestInterface $request
@param array $parts
@param array $options
@return array | [
"Bind",
"variable"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L178-L196 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindVarSuperGlobal | protected function bindVarSuperGlobal($option, ServerRequestInterface $request, &$value)
{
if (preg_match('/^\$_(GET|POST|COOKIE)\[([^\[]*)\]$/i', $option, $matches)) {
list(, $var, $key) = $matches;
$var = strtolower($var);
$data = null;
if ($var === 'get')... | php | protected function bindVarSuperGlobal($option, ServerRequestInterface $request, &$value)
{
if (preg_match('/^\$_(GET|POST|COOKIE)\[([^\[]*)\]$/i', $option, $matches)) {
list(, $var, $key) = $matches;
$var = strtolower($var);
$data = null;
if ($var === 'get')... | [
"protected",
"function",
"bindVarSuperGlobal",
"(",
"$",
"option",
",",
"ServerRequestInterface",
"$",
"request",
",",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^\\$_(GET|POST|COOKIE)\\[([^\\[]*)\\]$/i'",
",",
"$",
"option",
",",
"$",
"matches"... | Bind variable when option is a super global
@param string $option
@param mixed $value OUTPUT
@return boolean | [
"Bind",
"variable",
"when",
"option",
"is",
"a",
"super",
"global"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L222-L243 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindVarRequestHeader | protected function bindVarRequestHeader($option, ServerRequestInterface $request, &$value)
{
if (preg_match('/^\$(?:HTTP_)?([A-Z_]+)$/', $option, $matches)) {
$sentence = preg_replace('/[\W_]+/', ' ', $matches[1]);
$name = str_replace(' ', '-', ucwords($sentence));
... | php | protected function bindVarRequestHeader($option, ServerRequestInterface $request, &$value)
{
if (preg_match('/^\$(?:HTTP_)?([A-Z_]+)$/', $option, $matches)) {
$sentence = preg_replace('/[\W_]+/', ' ', $matches[1]);
$name = str_replace(' ', '-', ucwords($sentence));
... | [
"protected",
"function",
"bindVarRequestHeader",
"(",
"$",
"option",
",",
"ServerRequestInterface",
"$",
"request",
",",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"preg_match",
"(",
"'/^\\$(?:HTTP_)?([A-Z_]+)$/'",
",",
"$",
"option",
",",
"$",
"matches",
")",
")... | Bind variable when option is a request header
@param string $option
@param ServerRequestInterface $request
@param mixed $value OUTPUT
@return boolean | [
"Bind",
"variable",
"when",
"option",
"is",
"a",
"request",
"header"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L253-L264 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindVarMultipleUrlParts | protected function bindVarMultipleUrlParts($option, $type, array $parts, &$value)
{
if (substr($option, -3) === '...' && ctype_digit(substr($option, 1, -3))) {
$i = (int)substr($option, 1, -3);
if ($type === 'assoc') {
throw new \InvalidArgumentException("Binding mul... | php | protected function bindVarMultipleUrlParts($option, $type, array $parts, &$value)
{
if (substr($option, -3) === '...' && ctype_digit(substr($option, 1, -3))) {
$i = (int)substr($option, 1, -3);
if ($type === 'assoc') {
throw new \InvalidArgumentException("Binding mul... | [
"protected",
"function",
"bindVarMultipleUrlParts",
"(",
"$",
"option",
",",
"$",
"type",
",",
"array",
"$",
"parts",
",",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"option",
",",
"-",
"3",
")",
"===",
"'...'",
"&&",
"ctype_digit",
... | Bind variable when option contains multiple URL parts
@param string $option
@param string $type 'assoc' or 'numeric'
@param array $parts Url parts
@param mixed $value OUTPUT
@return boolean | [
"Bind",
"variable",
"when",
"option",
"contains",
"multiple",
"URL",
"parts"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L275-L290 |
jasny/router | src/Router/Routes/RouteBinding.php | RouteBinding.bindVarSingleUrlPart | protected function bindVarSingleUrlPart($option, array $parts, &$value)
{
if (ctype_digit(substr($option, 1))) {
$i = (int)substr($option, 1);
$part = array_slice($parts, $i - 1, 1);
if (!empty($part)) {
$value = $part;
return true;
... | php | protected function bindVarSingleUrlPart($option, array $parts, &$value)
{
if (ctype_digit(substr($option, 1))) {
$i = (int)substr($option, 1);
$part = array_slice($parts, $i - 1, 1);
if (!empty($part)) {
$value = $part;
return true;
... | [
"protected",
"function",
"bindVarSingleUrlPart",
"(",
"$",
"option",
",",
"array",
"$",
"parts",
",",
"&",
"$",
"value",
")",
"{",
"if",
"(",
"ctype_digit",
"(",
"substr",
"(",
"$",
"option",
",",
"1",
")",
")",
")",
"{",
"$",
"i",
"=",
"(",
"int",... | Bind variable when option contains a single URL part
@param string $option
@param array $parts Url parts
@param mixed $value OUTPUT
@return boolean | [
"Bind",
"variable",
"when",
"option",
"contains",
"a",
"single",
"URL",
"part"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/Routes/RouteBinding.php#L300-L313 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/AtSupports/SupportsRule.php | SupportsRule.addCondition | public function addCondition(ConditionAbstract $condition)
{
if ($condition instanceof SupportsCondition) {
$this->conditions[] = $condition;
} else {
throw new \InvalidArgumentException(
"Invalid condition instance. Instance of 'SupportsCondition' expected."
... | php | public function addCondition(ConditionAbstract $condition)
{
if ($condition instanceof SupportsCondition) {
$this->conditions[] = $condition;
} else {
throw new \InvalidArgumentException(
"Invalid condition instance. Instance of 'SupportsCondition' expected."
... | [
"public",
"function",
"addCondition",
"(",
"ConditionAbstract",
"$",
"condition",
")",
"{",
"if",
"(",
"$",
"condition",
"instanceof",
"SupportsCondition",
")",
"{",
"$",
"this",
"->",
"conditions",
"[",
"]",
"=",
"$",
"condition",
";",
"}",
"else",
"{",
"... | Adds a supports condition.
@param SupportsCondition $condition
@return $this | [
"Adds",
"a",
"supports",
"condition",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/AtSupports/SupportsRule.php#L38-L49 |
crossjoin/Css | src/Crossjoin/Css/Format/Rule/AtSupports/SupportsRule.php | SupportsRule.parseRuleString | protected function parseRuleString($ruleString)
{
// Remove at-rule name and unnecessary white-spaces
$ruleString = preg_replace('/^[ \r\n\t\f]*@supports[ \r\n\t\f]*/i', '', $ruleString);
$ruleString = trim($ruleString, " \r\n\t\f");
$charset = $this->getCharset();
$conditi... | php | protected function parseRuleString($ruleString)
{
// Remove at-rule name and unnecessary white-spaces
$ruleString = preg_replace('/^[ \r\n\t\f]*@supports[ \r\n\t\f]*/i', '', $ruleString);
$ruleString = trim($ruleString, " \r\n\t\f");
$charset = $this->getCharset();
$conditi... | [
"protected",
"function",
"parseRuleString",
"(",
"$",
"ruleString",
")",
"{",
"// Remove at-rule name and unnecessary white-spaces",
"$",
"ruleString",
"=",
"preg_replace",
"(",
"'/^[ \\r\\n\\t\\f]*@supports[ \\r\\n\\t\\f]*/i'",
",",
"''",
",",
"$",
"ruleString",
")",
";",
... | Parses the supports rule.
@param $ruleString | [
"Parses",
"the",
"supports",
"rule",
"."
] | train | https://github.com/crossjoin/Css/blob/7b50ca94c4bdad60d01cfa327f00b7a600d6f9f3/src/Crossjoin/Css/Format/Rule/AtSupports/SupportsRule.php#L56-L110 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.getCreateDate | public function getCreateDate($format = NULL)
{
if ($format === null) {
return $this->create_date;
} else {
return $this->create_date instanceof \DateTime ? $this->create_date->format($format) : null;
}
} | php | public function getCreateDate($format = NULL)
{
if ($format === null) {
return $this->create_date;
} else {
return $this->create_date instanceof \DateTime ? $this->create_date->format($format) : null;
}
} | [
"public",
"function",
"getCreateDate",
"(",
"$",
"format",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"format",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"create_date",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"create_date",
"instanc... | Get the [optionally formatted] temporal [create_date] column value.
@param string $format The date/time format string (either date()-style or strftime()-style).
If format is NULL, then the raw \DateTime object will be returned.
@return string|\DateTime Formatted date/time value as string or \DateTime object (if... | [
"Get",
"the",
"[",
"optionally",
"formatted",
"]",
"temporal",
"[",
"create_date",
"]",
"column",
"value",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L439-L446 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.getUpdateDate | public function getUpdateDate($format = NULL)
{
if ($format === null) {
return $this->update_date;
} else {
return $this->update_date instanceof \DateTime ? $this->update_date->format($format) : null;
}
} | php | public function getUpdateDate($format = NULL)
{
if ($format === null) {
return $this->update_date;
} else {
return $this->update_date instanceof \DateTime ? $this->update_date->format($format) : null;
}
} | [
"public",
"function",
"getUpdateDate",
"(",
"$",
"format",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"format",
"===",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"update_date",
";",
"}",
"else",
"{",
"return",
"$",
"this",
"->",
"update_date",
"instanc... | Get the [optionally formatted] temporal [update_date] column value.
@param string $format The date/time format string (either date()-style or strftime()-style).
If format is NULL, then the raw \DateTime object will be returned.
@return string|\DateTime Formatted date/time value as string or \DateTime object (if... | [
"Get",
"the",
"[",
"optionally",
"formatted",
"]",
"temporal",
"[",
"update_date",
"]",
"column",
"value",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L459-L466 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.hydrate | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : UserTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $... | php | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : UserTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (int) $... | [
"public",
"function",
"hydrate",
"(",
"$",
"row",
",",
"$",
"startcol",
"=",
"0",
",",
"$",
"rehydrate",
"=",
"false",
",",
"$",
"indexType",
"=",
"TableMap",
"::",
"TYPE_NUM",
")",
"{",
"try",
"{",
"$",
"col",
"=",
"$",
"row",
"[",
"TableMap",
"::... | Hydrates (populates) the object variables with values from the database resultset.
An offset (0-based "start column") is specified so that objects can be hydrated
with a subset of the columns in the resultset rows. This is needed, for example,
for results of JOIN queries where the resultset row includes columns from ... | [
"Hydrates",
"(",
"populates",
")",
"the",
"object",
"variables",
"with",
"values",
"from",
"the",
"database",
"resultset",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L514-L560 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.setId | public function setId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[UserTableMap::COL_ID] = true;
}
return $this;
} | php | public function setId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->id !== $v) {
$this->id = $v;
$this->modifiedColumns[UserTableMap::COL_ID] = true;
}
return $this;
} | [
"public",
"function",
"setId",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"int",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"id",
"!==",
"$",
"v",
")",
"{",
"$",
"this",
"->",
... | Set the value of [id] column.
@param int $v new value
@return $this|\Alchemy\Component\Cerberus\Model\User The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"id",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L585-L597 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.setUsername | public function setUsername($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->username !== $v) {
$this->username = $v;
$this->modifiedColumns[UserTableMap::COL_USERNAME] = true;
}
return $this;
} | php | public function setUsername($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->username !== $v) {
$this->username = $v;
$this->modifiedColumns[UserTableMap::COL_USERNAME] = true;
}
return $this;
} | [
"public",
"function",
"setUsername",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"username",
"!==",
"$",
"v",
")",
"{",
"$",
"th... | Set the value of [username] column.
@param string $v new value
@return $this|\Alchemy\Component\Cerberus\Model\User The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"username",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L605-L617 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.setPassword | public function setPassword($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->password !== $v) {
$this->password = $v;
$this->modifiedColumns[UserTableMap::COL_PASSWORD] = true;
}
return $this;
} | php | public function setPassword($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->password !== $v) {
$this->password = $v;
$this->modifiedColumns[UserTableMap::COL_PASSWORD] = true;
}
return $this;
} | [
"public",
"function",
"setPassword",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"password",
"!==",
"$",
"v",
")",
"{",
"$",
"th... | Set the value of [password] column.
@param string $v new value
@return $this|\Alchemy\Component\Cerberus\Model\User The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"password",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L625-L637 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.setFirstName | public function setFirstName($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->first_name !== $v) {
$this->first_name = $v;
$this->modifiedColumns[UserTableMap::COL_FIRST_NAME] = true;
}
return $this;
} | php | public function setFirstName($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->first_name !== $v) {
$this->first_name = $v;
$this->modifiedColumns[UserTableMap::COL_FIRST_NAME] = true;
}
return $this;
} | [
"public",
"function",
"setFirstName",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"first_name",
"!==",
"$",
"v",
")",
"{",
"$",
... | Set the value of [first_name] column.
@param string $v new value
@return $this|\Alchemy\Component\Cerberus\Model\User The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"first_name",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L645-L657 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.setLastName | public function setLastName($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->last_name !== $v) {
$this->last_name = $v;
$this->modifiedColumns[UserTableMap::COL_LAST_NAME] = true;
}
return $this;
} | php | public function setLastName($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->last_name !== $v) {
$this->last_name = $v;
$this->modifiedColumns[UserTableMap::COL_LAST_NAME] = true;
}
return $this;
} | [
"public",
"function",
"setLastName",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"last_name",
"!==",
"$",
"v",
")",
"{",
"$",
"t... | Set the value of [last_name] column.
@param string $v new value
@return $this|\Alchemy\Component\Cerberus\Model\User The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"last_name",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L665-L677 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.doSave | protected function doSave(ConnectionInterface $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isNew() || $this->isModified()) {
// persist changes
... | php | protected function doSave(ConnectionInterface $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
if ($this->isNew() || $this->isModified()) {
// persist changes
... | [
"protected",
"function",
"doSave",
"(",
"ConnectionInterface",
"$",
"con",
")",
"{",
"$",
"affectedRows",
"=",
"0",
";",
"// initialize var to track total num of affected rows",
"if",
"(",
"!",
"$",
"this",
"->",
"alreadyInSave",
")",
"{",
"$",
"this",
"->",
"al... | Performs the work of inserting or updating the row in the database.
If the object is new, it inserts it; otherwise an update is performed.
All related objects are also updated in this method.
@param ConnectionInterface $con
@return int The number of rows affected by this insert/update and any referri... | [
"Performs",
"the",
"work",
"of",
"inserting",
"or",
"updating",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L872-L940 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.doInsert | protected function doInsert(ConnectionInterface $con)
{
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[UserTableMap::COL_ID] = true;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . UserTableMa... | php | protected function doInsert(ConnectionInterface $con)
{
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[UserTableMap::COL_ID] = true;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . UserTableMa... | [
"protected",
"function",
"doInsert",
"(",
"ConnectionInterface",
"$",
"con",
")",
"{",
"$",
"modifiedColumns",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"$",
"this",
"->",
"modifiedColumns",
"[",
"UserTableMap",
"::",
"COL_ID",
"]",
"=",
... | Insert the row in the database.
@param ConnectionInterface $con
@throws PropelException
@see doSave() | [
"Insert",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L950-L1036 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.getByPosition | public function getByPosition($pos)
{
switch ($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getUsername();
break;
case 2:
return $this->getPassword();
bre... | php | public function getByPosition($pos)
{
switch ($pos) {
case 0:
return $this->getId();
break;
case 1:
return $this->getUsername();
break;
case 2:
return $this->getPassword();
bre... | [
"public",
"function",
"getByPosition",
"(",
"$",
"pos",
")",
"{",
"switch",
"(",
"$",
"pos",
")",
"{",
"case",
"0",
":",
"return",
"$",
"this",
"->",
"getId",
"(",
")",
";",
"break",
";",
"case",
"1",
":",
"return",
"$",
"this",
"->",
"getUsername"... | Retrieves a field from the object by Position as specified in the xml schema.
Zero-based.
@param int $pos position in xml schema
@return mixed Value of field at $pos | [
"Retrieves",
"a",
"field",
"from",
"the",
"object",
"by",
"Position",
"as",
"specified",
"in",
"the",
"xml",
"schema",
".",
"Zero",
"-",
"based",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1079-L1110 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.toArray | public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['User'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['User'][... | php | public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['User'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['User'][... | [
"public",
"function",
"toArray",
"(",
"$",
"keyType",
"=",
"TableMap",
"::",
"TYPE_PHPNAME",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
",",
"$",
"alreadyDumpedObjects",
"=",
"array",
"(",
")",
",",
"$",
"includeForeignObjects",
"=",
"false",
")",
"{",
... | Exports the object as an array.
You can specify the key type of the array by passing one of the class
type constants.
@param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
Defau... | [
"Exports",
"the",
"object",
"as",
"an",
"array",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1127-L1156 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.setByPosition | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setUsername($value);
break;
case 2:
$this->setPassword($value);
... | php | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setUsername($value);
break;
case 2:
$this->setPassword($value);
... | [
"public",
"function",
"setByPosition",
"(",
"$",
"pos",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"pos",
")",
"{",
"case",
"0",
":",
"$",
"this",
"->",
"setId",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"1",
":",
"$",
"this",
"-... | Sets a field from the object by Position as specified in the xml schema.
Zero-based.
@param int $pos position in xml schema
@param mixed $value field value
@return $this|\Alchemy\Component\Cerberus\Model\User | [
"Sets",
"a",
"field",
"from",
"the",
"object",
"by",
"Position",
"as",
"specified",
"in",
"the",
"xml",
"schema",
".",
"Zero",
"-",
"based",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1184-L1214 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.fromArray | public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = UserTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setId($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
$this->setUsername($arr[$keys[1... | php | public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = UserTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setId($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
$this->setUsername($arr[$keys[1... | [
"public",
"function",
"fromArray",
"(",
"$",
"arr",
",",
"$",
"keyType",
"=",
"TableMap",
"::",
"TYPE_PHPNAME",
")",
"{",
"$",
"keys",
"=",
"UserTableMap",
"::",
"getFieldNames",
"(",
"$",
"keyType",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",
"ke... | Populates the object using an array.
This is particularly useful when populating an object from one of the
request arrays (e.g. $_POST). This method goes through the column
names, checking to see whether a matching key exists in populated
array. If so the setByName() method is called for that column.
You can specify... | [
"Populates",
"the",
"object",
"using",
"an",
"array",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1233-L1261 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.buildCriteria | public function buildCriteria()
{
$criteria = new Criteria(UserTableMap::DATABASE_NAME);
if ($this->isColumnModified(UserTableMap::COL_ID)) {
$criteria->add(UserTableMap::COL_ID, $this->id);
}
if ($this->isColumnModified(UserTableMap::COL_USERNAME)) {
$criter... | php | public function buildCriteria()
{
$criteria = new Criteria(UserTableMap::DATABASE_NAME);
if ($this->isColumnModified(UserTableMap::COL_ID)) {
$criteria->add(UserTableMap::COL_ID, $this->id);
}
if ($this->isColumnModified(UserTableMap::COL_USERNAME)) {
$criter... | [
"public",
"function",
"buildCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"UserTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isColumnModified",
"(",
"UserTableMap",
"::",
"COL_ID",
")",
")",
"{",
"$",
... | Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"Build",
"a",
"Criteria",
"object",
"containing",
"the",
"values",
"of",
"all",
"modified",
"columns",
"in",
"this",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1292-L1322 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.copyInto | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setUsername($this->getUsername());
$copyObj->setPassword($this->getPassword());
$copyObj->setFirstName($this->getFirstName());
$copyObj->setLastName($this->getLastName());
$copyObj->setCreateDa... | php | public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
{
$copyObj->setUsername($this->getUsername());
$copyObj->setPassword($this->getPassword());
$copyObj->setFirstName($this->getFirstName());
$copyObj->setLastName($this->getLastName());
$copyObj->setCreateDa... | [
"public",
"function",
"copyInto",
"(",
"$",
"copyObj",
",",
"$",
"deepCopy",
"=",
"false",
",",
"$",
"makeNew",
"=",
"true",
")",
"{",
"$",
"copyObj",
"->",
"setUsername",
"(",
"$",
"this",
"->",
"getUsername",
"(",
")",
")",
";",
"$",
"copyObj",
"->... | Sets contents of passed object to values from current object.
If desired, this method can also make copies of all associated (fkey referrers)
objects.
@param object $copyObj An object of \Alchemy\Component\Cerberus\Model\User (or compatible) type.
@param boolean $deepCopy Whether to also copy all rows that ... | [
"Sets",
"contents",
"of",
"passed",
"object",
"to",
"values",
"from",
"current",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1404-L1431 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.initUserRoles | public function initUserRoles($overrideExisting = true)
{
if (null !== $this->collUserRoles && !$overrideExisting) {
return;
}
$this->collUserRoles = new ObjectCollection();
$this->collUserRoles->setModel('\Alchemy\Component\Cerberus\Model\UserRole');
} | php | public function initUserRoles($overrideExisting = true)
{
if (null !== $this->collUserRoles && !$overrideExisting) {
return;
}
$this->collUserRoles = new ObjectCollection();
$this->collUserRoles->setModel('\Alchemy\Component\Cerberus\Model\UserRole');
} | [
"public",
"function",
"initUserRoles",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collUserRoles",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"collUserRoles",
... | Initializes the collUserRoles collection.
By default this just sets the collUserRoles collection to an empty array (like clearcollUserRoles());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the values sto... | [
"Initializes",
"the",
"collUserRoles",
"collection",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1505-L1512 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.getUserRoles | public function getUserRoles(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collUserRolesPartial && !$this->isNew();
if (null === $this->collUserRoles || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collUserRoles) {
... | php | public function getUserRoles(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collUserRolesPartial && !$this->isNew();
if (null === $this->collUserRoles || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collUserRoles) {
... | [
"public",
"function",
"getUserRoles",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collUserRolesPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"(",
... | Gets an array of ChildUserRole objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $criteria,... | [
"Gets",
"an",
"array",
"of",
"ChildUserRole",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1528-L1570 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.addUserRole | public function addUserRole(ChildUserRole $l)
{
if ($this->collUserRoles === null) {
$this->initUserRoles();
$this->collUserRolesPartial = true;
}
if (!$this->collUserRoles->contains($l)) {
$this->doAddUserRole($l);
}
return $this;
} | php | public function addUserRole(ChildUserRole $l)
{
if ($this->collUserRoles === null) {
$this->initUserRoles();
$this->collUserRolesPartial = true;
}
if (!$this->collUserRoles->contains($l)) {
$this->doAddUserRole($l);
}
return $this;
} | [
"public",
"function",
"addUserRole",
"(",
"ChildUserRole",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collUserRoles",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initUserRoles",
"(",
")",
";",
"$",
"this",
"->",
"collUserRolesPartial",
"=",
"tru... | Method called to associate a ChildUserRole object to this object
through the ChildUserRole foreign key attribute.
@param ChildUserRole $l ChildUserRole
@return $this|\Alchemy\Component\Cerberus\Model\User The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ChildUserRole",
"object",
"to",
"this",
"object",
"through",
"the",
"ChildUserRole",
"foreign",
"key",
"attribute",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1649-L1661 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.getUserRolesJoinRole | public function getUserRolesJoinRole(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildUserRoleQuery::create(null, $criteria);
$query->joinWith('Role', $joinBehavior);
return $this->getUserRoles($query, $con);
} | php | public function getUserRolesJoinRole(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildUserRoleQuery::create(null, $criteria);
$query->joinWith('Role', $joinBehavior);
return $this->getUserRoles($query, $con);
} | [
"public",
"function",
"getUserRolesJoinRole",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
",",
"$",
"joinBehavior",
"=",
"Criteria",
"::",
"LEFT_JOIN",
")",
"{",
"$",
"query",
"=",
"ChildUserRoleQuery",
"... | If this collection has already been initialized with
an identical criteria, it returns the collection.
Otherwise if this User is new, it will return
an empty collection; or if this User has previously
been saved, it will retrieve related UserRoles from storage.
This method is protected by default in order to keep the ... | [
"If",
"this",
"collection",
"has",
"already",
"been",
"initialized",
"with",
"an",
"identical",
"criteria",
"it",
"returns",
"the",
"collection",
".",
"Otherwise",
"if",
"this",
"User",
"is",
"new",
"it",
"will",
"return",
"an",
"empty",
"collection",
";",
"... | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1709-L1715 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.initRoles | public function initRoles()
{
$this->collRoles = new ObjectCollection();
$this->collRolesPartial = true;
$this->collRoles->setModel('\Alchemy\Component\Cerberus\Model\Role');
} | php | public function initRoles()
{
$this->collRoles = new ObjectCollection();
$this->collRolesPartial = true;
$this->collRoles->setModel('\Alchemy\Component\Cerberus\Model\Role');
} | [
"public",
"function",
"initRoles",
"(",
")",
"{",
"$",
"this",
"->",
"collRoles",
"=",
"new",
"ObjectCollection",
"(",
")",
";",
"$",
"this",
"->",
"collRolesPartial",
"=",
"true",
";",
"$",
"this",
"->",
"collRoles",
"->",
"setModel",
"(",
"'\\Alchemy\\Co... | Initializes the collRoles collection.
By default this just sets the collRoles collection to an empty collection (like clearRoles());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the values stored in data... | [
"Initializes",
"the",
"collRoles",
"collection",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1740-L1746 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.setRoles | public function setRoles(Collection $roles, ConnectionInterface $con = null)
{
$this->clearRoles();
$currentRoles = $this->getRoles();
$rolesScheduledForDeletion = $currentRoles->diff($roles);
foreach ($rolesScheduledForDeletion as $toDelete) {
$this->removeRole($toDele... | php | public function setRoles(Collection $roles, ConnectionInterface $con = null)
{
$this->clearRoles();
$currentRoles = $this->getRoles();
$rolesScheduledForDeletion = $currentRoles->diff($roles);
foreach ($rolesScheduledForDeletion as $toDelete) {
$this->removeRole($toDele... | [
"public",
"function",
"setRoles",
"(",
"Collection",
"$",
"roles",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"clearRoles",
"(",
")",
";",
"$",
"currentRoles",
"=",
"$",
"this",
"->",
"getRoles",
"(",
")",
";",
"$... | Sets a collection of Role objects related by a many-to-many relationship
to the current object by way of the user_role cross-reference table.
It will also schedule objects for deletion based on a diff between old objects (aka persisted)
and new objects from the given Propel collection.
@param Collection $roles A Prop... | [
"Sets",
"a",
"collection",
"of",
"Role",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"user_role",
"cross",
"-",
"reference",
"table",
".",
"It",
"will",
"als... | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1818-L1839 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.addRole | public function addRole(ChildRole $role)
{
if ($this->collRoles === null) {
$this->initRoles();
}
if (!$this->getRoles()->contains($role)) {
// only add it if the **same** object is not already associated
$this->collRoles->push($role);
$this->... | php | public function addRole(ChildRole $role)
{
if ($this->collRoles === null) {
$this->initRoles();
}
if (!$this->getRoles()->contains($role)) {
// only add it if the **same** object is not already associated
$this->collRoles->push($role);
$this->... | [
"public",
"function",
"addRole",
"(",
"ChildRole",
"$",
"role",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collRoles",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initRoles",
"(",
")",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"getRoles",
"(",
... | Associate a ChildRole to this object
through the user_role cross reference table.
@param ChildRole $role
@return ChildUser The current object (for fluent API support) | [
"Associate",
"a",
"ChildRole",
"to",
"this",
"object",
"through",
"the",
"user_role",
"cross",
"reference",
"table",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1884-L1897 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.removeRole | public function removeRole(ChildRole $role)
{
if ($this->getRoles()->contains($role)) { $userRole = new ChildUserRole();
$userRole->setRole($role);
if ($role->isUsersLoaded()) {
//remove the back reference if available
$role->getUsers()->removeObject(... | php | public function removeRole(ChildRole $role)
{
if ($this->getRoles()->contains($role)) { $userRole = new ChildUserRole();
$userRole->setRole($role);
if ($role->isUsersLoaded()) {
//remove the back reference if available
$role->getUsers()->removeObject(... | [
"public",
"function",
"removeRole",
"(",
"ChildRole",
"$",
"role",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRoles",
"(",
")",
"->",
"contains",
"(",
"$",
"role",
")",
")",
"{",
"$",
"userRole",
"=",
"new",
"ChildUserRole",
"(",
")",
";",
"$",
"u... | Remove role of this object
through the user_role cross reference table.
@param ChildRole $role
@return ChildUser The current object (for fluent API support) | [
"Remove",
"role",
"of",
"this",
"object",
"through",
"the",
"user_role",
"cross",
"reference",
"table",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1931-L1957 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.clear | public function clear()
{
$this->id = null;
$this->username = null;
$this->password = null;
$this->first_name = null;
$this->last_name = null;
$this->create_date = null;
$this->update_date = null;
$this->status = null;
$this->alreadyInSave = fa... | php | public function clear()
{
$this->id = null;
$this->username = null;
$this->password = null;
$this->first_name = null;
$this->last_name = null;
$this->create_date = null;
$this->update_date = null;
$this->status = null;
$this->alreadyInSave = fa... | [
"public",
"function",
"clear",
"(",
")",
"{",
"$",
"this",
"->",
"id",
"=",
"null",
";",
"$",
"this",
"->",
"username",
"=",
"null",
";",
"$",
"this",
"->",
"password",
"=",
"null",
";",
"$",
"this",
"->",
"first_name",
"=",
"null",
";",
"$",
"th... | Clears the current object, sets all attributes to their default values and removes
outgoing references as well as back-references (from other objects to this one. Results probably in a database
change of those foreign objects when you call `save` there). | [
"Clears",
"the",
"current",
"object",
"sets",
"all",
"attributes",
"to",
"their",
"default",
"values",
"and",
"removes",
"outgoing",
"references",
"as",
"well",
"as",
"back",
"-",
"references",
"(",
"from",
"other",
"objects",
"to",
"this",
"one",
".",
"Resu... | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1964-L1980 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/User.php | User.clearAllReferences | public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collUserRoles) {
foreach ($this->collUserRoles as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collRoles) {
foreach ($thi... | php | public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collUserRoles) {
foreach ($this->collUserRoles as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collRoles) {
foreach ($thi... | [
"public",
"function",
"clearAllReferences",
"(",
"$",
"deep",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"deep",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collUserRoles",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"collUserRoles",
"as",
"$",
"o",
")",
... | Resets all references and back-references to other model objects or collections of model objects.
This method is used to reset all php object references (not the actual reference in the database).
Necessary for object serialisation.
@param boolean $deep Whether to also clear the references on all referrer object... | [
"Resets",
"all",
"references",
"and",
"back",
"-",
"references",
"to",
"other",
"model",
"objects",
"or",
"collections",
"of",
"model",
"objects",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/User.php#L1990-L2007 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.throwException | private function throwException($method)
{
if (isset($this->exceptions[$method]) && ! empty($this->exceptions[$method])) {
$exception = array_shift($this->exceptions[$method]);
if ($exception != null) {
throw $exception;
}
}
} | php | private function throwException($method)
{
if (isset($this->exceptions[$method]) && ! empty($this->exceptions[$method])) {
$exception = array_shift($this->exceptions[$method]);
if ($exception != null) {
throw $exception;
}
}
} | [
"private",
"function",
"throwException",
"(",
"$",
"method",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"exceptions",
"[",
"$",
"method",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"this",
"->",
"exceptions",
"[",
"$",
"method",
"]",
")",
"... | Dequeue an exception for a specific method invocation
@param string $method
@param mixed $default
@return mixed | [
"Dequeue",
"an",
"exception",
"for",
"a",
"specific",
"method",
"invocation"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L45-L54 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.setLock | public function setLock(CacheKey $key, Lock $lock)
{
$this->locks[$key->hash] = $lock;
} | php | public function setLock(CacheKey $key, Lock $lock)
{
$this->locks[$key->hash] = $lock;
} | [
"public",
"function",
"setLock",
"(",
"CacheKey",
"$",
"key",
",",
"Lock",
"$",
"lock",
")",
"{",
"$",
"this",
"->",
"locks",
"[",
"$",
"key",
"->",
"hash",
"]",
"=",
"$",
"lock",
";",
"}"
] | Locks a specific cache entry
@param \Doctrine\ORM\Cache\CacheKey $key
@param \Doctrine\ORM\Cache\Lock $lock | [
"Locks",
"a",
"specific",
"cache",
"entry"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L73-L76 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.contains | public function contains(CacheKey $key)
{
$this->calls[__FUNCTION__][] = ['key' => $key];
if (isset($this->locks[$key->hash])) {
return false;
}
$this->throwException(__FUNCTION__);
return $this->region->contains($key);
} | php | public function contains(CacheKey $key)
{
$this->calls[__FUNCTION__][] = ['key' => $key];
if (isset($this->locks[$key->hash])) {
return false;
}
$this->throwException(__FUNCTION__);
return $this->region->contains($key);
} | [
"public",
"function",
"contains",
"(",
"CacheKey",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"'key'",
"=>",
"$",
"key",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"locks",
"[",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L81-L92 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.evict | public function evict(CacheKey $key)
{
$this->calls[__FUNCTION__][] = ['key' => $key];
$this->throwException(__FUNCTION__);
return $this->region->evict($key);
} | php | public function evict(CacheKey $key)
{
$this->calls[__FUNCTION__][] = ['key' => $key];
$this->throwException(__FUNCTION__);
return $this->region->evict($key);
} | [
"public",
"function",
"evict",
"(",
"CacheKey",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"'key'",
"=>",
"$",
"key",
"]",
";",
"$",
"this",
"->",
"throwException",
"(",
"__FUNCTION__",
")",
";",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L97-L104 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.evictAll | public function evictAll()
{
$this->calls[__FUNCTION__][] = [];
$this->throwException(__FUNCTION__);
return $this->region->evictAll();
} | php | public function evictAll()
{
$this->calls[__FUNCTION__][] = [];
$this->throwException(__FUNCTION__);
return $this->region->evictAll();
} | [
"public",
"function",
"evictAll",
"(",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"throwException",
"(",
"__FUNCTION__",
")",
";",
"return",
"$",
"this",
"->",
"region",
"->",
"evi... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L109-L116 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.get | public function get(CacheKey $key)
{
$this->calls[__FUNCTION__][] = ['key' => $key];
$this->throwException(__FUNCTION__);
if (isset($this->locks[$key->hash])) {
return null;
}
return $this->region->get($key);
} | php | public function get(CacheKey $key)
{
$this->calls[__FUNCTION__][] = ['key' => $key];
$this->throwException(__FUNCTION__);
if (isset($this->locks[$key->hash])) {
return null;
}
return $this->region->get($key);
} | [
"public",
"function",
"get",
"(",
"CacheKey",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"'key'",
"=>",
"$",
"key",
"]",
";",
"$",
"this",
"->",
"throwException",
"(",
"__FUNCTION__",
")",
";",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L121-L132 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.getMultiple | public function getMultiple(CollectionCacheEntry $collection)
{
$this->calls[__FUNCTION__][] = ['collection' => $collection];
$this->throwException(__FUNCTION__);
return $this->region->getMultiple($collection);
} | php | public function getMultiple(CollectionCacheEntry $collection)
{
$this->calls[__FUNCTION__][] = ['collection' => $collection];
$this->throwException(__FUNCTION__);
return $this->region->getMultiple($collection);
} | [
"public",
"function",
"getMultiple",
"(",
"CollectionCacheEntry",
"$",
"collection",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"'collection'",
"=>",
"$",
"collection",
"]",
";",
"$",
"this",
"->",
"throwException",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L137-L144 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.getName | public function getName()
{
$this->calls[__FUNCTION__][] = [];
$this->throwException(__FUNCTION__);
return $this->region->getName();
} | php | public function getName()
{
$this->calls[__FUNCTION__][] = [];
$this->throwException(__FUNCTION__);
return $this->region->getName();
} | [
"public",
"function",
"getName",
"(",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"throwException",
"(",
"__FUNCTION__",
")",
";",
"return",
"$",
"this",
"->",
"region",
"->",
"getN... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L149-L156 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.put | public function put(CacheKey $key, CacheEntry $entry, Lock $lock = null)
{
$this->calls[__FUNCTION__][] = ['key' => $key, 'entry' => $entry];
$this->throwException(__FUNCTION__);
if (isset($this->locks[$key->hash])) {
if ($lock !== null && $this->locks[$key->hash]->value === $... | php | public function put(CacheKey $key, CacheEntry $entry, Lock $lock = null)
{
$this->calls[__FUNCTION__][] = ['key' => $key, 'entry' => $entry];
$this->throwException(__FUNCTION__);
if (isset($this->locks[$key->hash])) {
if ($lock !== null && $this->locks[$key->hash]->value === $... | [
"public",
"function",
"put",
"(",
"CacheKey",
"$",
"key",
",",
"CacheEntry",
"$",
"entry",
",",
"Lock",
"$",
"lock",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"'key'",
"=>",
"$",
"key",
",",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L161-L177 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.lock | public function lock(CacheKey $key)
{
$this->calls[__FUNCTION__][] = ['key' => $key];
$this->throwException(__FUNCTION__);
if (isset($this->locks[$key->hash])) {
return null;
}
return $this->locks[$key->hash] = Lock::createLockRead();
} | php | public function lock(CacheKey $key)
{
$this->calls[__FUNCTION__][] = ['key' => $key];
$this->throwException(__FUNCTION__);
if (isset($this->locks[$key->hash])) {
return null;
}
return $this->locks[$key->hash] = Lock::createLockRead();
} | [
"public",
"function",
"lock",
"(",
"CacheKey",
"$",
"key",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"'key'",
"=>",
"$",
"key",
"]",
";",
"$",
"this",
"->",
"throwException",
"(",
"__FUNCTION__",
")",
";",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L182-L193 |
darkwebdesign/doctrine-unit-testing | src/Mocks/ConcurrentRegionMock.php | ConcurrentRegionMock.unlock | public function unlock(CacheKey $key, Lock $lock)
{
$this->calls[__FUNCTION__][] = ['key' => $key, 'lock' => $lock];
$this->throwException(__FUNCTION__);
if ( ! isset($this->locks[$key->hash])) {
return;
}
if ($this->locks[$key->hash]->value !== $lock->value) {... | php | public function unlock(CacheKey $key, Lock $lock)
{
$this->calls[__FUNCTION__][] = ['key' => $key, 'lock' => $lock];
$this->throwException(__FUNCTION__);
if ( ! isset($this->locks[$key->hash])) {
return;
}
if ($this->locks[$key->hash]->value !== $lock->value) {... | [
"public",
"function",
"unlock",
"(",
"CacheKey",
"$",
"key",
",",
"Lock",
"$",
"lock",
")",
"{",
"$",
"this",
"->",
"calls",
"[",
"__FUNCTION__",
"]",
"[",
"]",
"=",
"[",
"'key'",
"=>",
"$",
"key",
",",
"'lock'",
"=>",
"$",
"lock",
"]",
";",
"$",... | {@inheritdoc} | [
"{"
] | train | https://github.com/darkwebdesign/doctrine-unit-testing/blob/0daf50359563bc0679925e573a7105d6cd57168a/src/Mocks/ConcurrentRegionMock.php#L198-L213 |
WellCommerce/CoreBundle | Validator/UniqueRouteValidator.php | UniqueRouteValidator.validate | public function validate($entity, Constraint $constraint)
{
if (!$entity instanceof RoutableSubjectInterface) {
throw new \InvalidArgumentException(sprintf('Expected instance of %s', RoutableSubjectInterface::class));
}
$route = $entity->getRoute();
$slug = $e... | php | public function validate($entity, Constraint $constraint)
{
if (!$entity instanceof RoutableSubjectInterface) {
throw new \InvalidArgumentException(sprintf('Expected instance of %s', RoutableSubjectInterface::class));
}
$route = $entity->getRoute();
$slug = $e... | [
"public",
"function",
"validate",
"(",
"$",
"entity",
",",
"Constraint",
"$",
"constraint",
")",
"{",
"if",
"(",
"!",
"$",
"entity",
"instanceof",
"RoutableSubjectInterface",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Ex... | Validate the route entity
@param mixed $entity
@param Constraint $constraint | [
"Validate",
"the",
"route",
"entity"
] | train | https://github.com/WellCommerce/CoreBundle/blob/984fbd544d4b10cf11e54e0f3c304d100deb6842/Validator/UniqueRouteValidator.php#L51-L81 |
withfatpanda/illuminate-wordpress | src/Support/Exceptions/RegistersExceptionHandlers.php | RegistersExceptionHandlers.registerErrorHandling | protected function registerErrorHandling()
{
error_reporting(-1);
set_error_handler(function ($level, $message, $file = '', $line = 0) {
if (error_reporting() & $level) {
// ignore ACF non-numeric issue on PHP 7.1.x until it is fixed
if (stripos($file, 'a... | php | protected function registerErrorHandling()
{
error_reporting(-1);
set_error_handler(function ($level, $message, $file = '', $line = 0) {
if (error_reporting() & $level) {
// ignore ACF non-numeric issue on PHP 7.1.x until it is fixed
if (stripos($file, 'a... | [
"protected",
"function",
"registerErrorHandling",
"(",
")",
"{",
"error_reporting",
"(",
"-",
"1",
")",
";",
"set_error_handler",
"(",
"function",
"(",
"$",
"level",
",",
"$",
"message",
",",
"$",
"file",
"=",
"''",
",",
"$",
"line",
"=",
"0",
")",
"{"... | Set the error handling for the application.
@return void | [
"Set",
"the",
"error",
"handling",
"for",
"the",
"application",
"."
] | train | https://github.com/withfatpanda/illuminate-wordpress/blob/b426ca81a55367459430c974932ee5a941d759d8/src/Support/Exceptions/RegistersExceptionHandlers.php#L39-L65 |
mythteam/yii2-schedule | src/Event.php | Event.emailOutput | public function emailOutput($address)
{
if (is_null($this->_output)
|| $this->_output == $this->getDefaultOutput()
) {
throw new InvalidCallException('Must direct output to file in order to email results.');
}
$address = is_array($address) ? $address : func_ge... | php | public function emailOutput($address)
{
if (is_null($this->_output)
|| $this->_output == $this->getDefaultOutput()
) {
throw new InvalidCallException('Must direct output to file in order to email results.');
}
$address = is_array($address) ? $address : func_ge... | [
"public",
"function",
"emailOutput",
"(",
"$",
"address",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"_output",
")",
"||",
"$",
"this",
"->",
"_output",
"==",
"$",
"this",
"->",
"getDefaultOutput",
"(",
")",
")",
"{",
"throw",
"new",
"In... | Register the send email logic.
@param array $address
@return $this | [
"Register",
"the",
"send",
"email",
"logic",
"."
] | train | https://github.com/mythteam/yii2-schedule/blob/259db00e4f2a02619545166774081c60957c5faf/src/Event.php#L228-L240 |
mythteam/yii2-schedule | src/Event.php | Event.buildCommand | public function buildCommand()
{
$command = $this->command . ' >> ' . $this->_output . ' 2>&1 &';
return $this->_user ? 'sudo -u ' . $this->_user . ' ' . $command : $command;
} | php | public function buildCommand()
{
$command = $this->command . ' >> ' . $this->_output . ' 2>&1 &';
return $this->_user ? 'sudo -u ' . $this->_user . ' ' . $command : $command;
} | [
"public",
"function",
"buildCommand",
"(",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"command",
".",
"' >> '",
".",
"$",
"this",
"->",
"_output",
".",
"' 2>&1 &'",
";",
"return",
"$",
"this",
"->",
"_user",
"?",
"'sudo -u '",
".",
"$",
"this",
... | Build the execute command.
@return string | [
"Build",
"the",
"execute",
"command",
"."
] | train | https://github.com/mythteam/yii2-schedule/blob/259db00e4f2a02619545166774081c60957c5faf/src/Event.php#L620-L625 |
mythteam/yii2-schedule | src/Event.php | Event.sendEmail | protected function sendEmail(MailerInterface $mailer, $address)
{
$message = $mailer->compose();
$message->setTextBody(file_get_contents($this->_output))
->setSubject($this->getEmailSubject())
->setTo($address);
$message->send();
} | php | protected function sendEmail(MailerInterface $mailer, $address)
{
$message = $mailer->compose();
$message->setTextBody(file_get_contents($this->_output))
->setSubject($this->getEmailSubject())
->setTo($address);
$message->send();
} | [
"protected",
"function",
"sendEmail",
"(",
"MailerInterface",
"$",
"mailer",
",",
"$",
"address",
")",
"{",
"$",
"message",
"=",
"$",
"mailer",
"->",
"compose",
"(",
")",
";",
"$",
"message",
"->",
"setTextBody",
"(",
"file_get_contents",
"(",
"$",
"this",... | Send email logic.
@param MailerInterface $mailer
@param array $address | [
"Send",
"email",
"logic",
"."
] | train | https://github.com/mythteam/yii2-schedule/blob/259db00e4f2a02619545166774081c60957c5faf/src/Event.php#L633-L641 |
gbprod/elastica-provider-bundle | src/ElasticaProviderBundle/DependencyInjection/Compiler/ProviderCompilerPass.php | ProviderCompilerPass.process | public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('gbprod.elastica_provider.registry')) {
return;
}
$registry = $container->getDefinition('gbprod.elastica_provider.registry');
$providers = $container->findTaggedServiceIds('elastica.pro... | php | public function process(ContainerBuilder $container)
{
if (!$container->hasDefinition('gbprod.elastica_provider.registry')) {
return;
}
$registry = $container->getDefinition('gbprod.elastica_provider.registry');
$providers = $container->findTaggedServiceIds('elastica.pro... | [
"public",
"function",
"process",
"(",
"ContainerBuilder",
"$",
"container",
")",
"{",
"if",
"(",
"!",
"$",
"container",
"->",
"hasDefinition",
"(",
"'gbprod.elastica_provider.registry'",
")",
")",
"{",
"return",
";",
"}",
"$",
"registry",
"=",
"$",
"container"... | {@inheritdoc} | [
"{"
] | train | https://github.com/gbprod/elastica-provider-bundle/blob/ee1e2ca78651d570b7400049bf81d8405fc744fc/src/ElasticaProviderBundle/DependencyInjection/Compiler/ProviderCompilerPass.php#L22-L34 |
blast-project/CoreBundle | src/Admin/Traits/ManyToManyManager.php | ManyToManyManager.addManyToManyCollections | public function addManyToManyCollections($collections)
{
if (!is_array($collections)) {
$collections = [$collections];
}
$this->manyToManyCollections = array_merge($this->manyToManyCollections, $collections);
return $this;
} | php | public function addManyToManyCollections($collections)
{
if (!is_array($collections)) {
$collections = [$collections];
}
$this->manyToManyCollections = array_merge($this->manyToManyCollections, $collections);
return $this;
} | [
"public",
"function",
"addManyToManyCollections",
"(",
"$",
"collections",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"collections",
")",
")",
"{",
"$",
"collections",
"=",
"[",
"$",
"collections",
"]",
";",
"}",
"$",
"this",
"->",
"manyToManyCollecti... | @param string|array $collections
@return self | [
"@param",
"string|array",
"$collections"
] | train | https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/Traits/ManyToManyManager.php#L36-L44 |
blast-project/CoreBundle | src/Admin/Traits/ManyToManyManager.php | ManyToManyManager.preUpdateManyToManyManager | protected function preUpdateManyToManyManager($object)
{
$this->configureManyToManyManager();
$rc = new \ReflectionClass($this->getClass());
$remove_method = 'remove' . ucfirst($rc->getShortName());
foreach ($this->manyToManyCollections as $fieldname) {
$get_method = 'g... | php | protected function preUpdateManyToManyManager($object)
{
$this->configureManyToManyManager();
$rc = new \ReflectionClass($this->getClass());
$remove_method = 'remove' . ucfirst($rc->getShortName());
foreach ($this->manyToManyCollections as $fieldname) {
$get_method = 'g... | [
"protected",
"function",
"preUpdateManyToManyManager",
"(",
"$",
"object",
")",
"{",
"$",
"this",
"->",
"configureManyToManyManager",
"(",
")",
";",
"$",
"rc",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"this",
"->",
"getClass",
"(",
")",
")",
";",
"$"... | Delete many-to-many associated entities when the current entity is not on the owning side
This is called by the PreEvents::prePersistOrUpdate() method.
@param object $object | [
"Delete",
"many",
"-",
"to",
"-",
"many",
"associated",
"entities",
"when",
"the",
"current",
"entity",
"is",
"not",
"on",
"the",
"owning",
"side",
"This",
"is",
"called",
"by",
"the",
"PreEvents",
"::",
"prePersistOrUpdate",
"()",
"method",
"."
] | train | https://github.com/blast-project/CoreBundle/blob/7a0832758ca14e5bc5d65515532c1220df3930ae/src/Admin/Traits/ManyToManyManager.php#L52-L70 |
dreamcommerce/common-bundle | src/DreamCommerce/Bundle/CommonBundle/DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder
->root('dream_commerce')
->addDefaultsIfNotSet()
->children();
;
$this->addJmsSection($rootNode);
return $treeBuilder;
} | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder
->root('dream_commerce')
->addDefaultsIfNotSet()
->children();
;
$this->addJmsSection($rootNode);
return $treeBuilder;
} | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'dream_commerce'",
")",
"->",
"addDefaultsIfNotSet",
"(",
")",
"->",
"chi... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamcommerce/common-bundle/blob/adb0850e90e63c3997f10d1ce110bf13a84b63ab/src/DreamCommerce/Bundle/CommonBundle/DependencyInjection/Configuration.php#L28-L41 |
activecollab/databasemigrations | src/Migrations.php | Migrations.getMigrations | public function getMigrations()
{
if (!$this->migrations_are_found) {
$migration_class_file_path_map = $this->finder->getMigrationClassFilePathMap();
$migrations_by_class = $this->getMigrationInstances($migration_class_file_path_map);
foreach ($migrations_by_class as $m... | php | public function getMigrations()
{
if (!$this->migrations_are_found) {
$migration_class_file_path_map = $this->finder->getMigrationClassFilePathMap();
$migrations_by_class = $this->getMigrationInstances($migration_class_file_path_map);
foreach ($migrations_by_class as $m... | [
"public",
"function",
"getMigrations",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"migrations_are_found",
")",
"{",
"$",
"migration_class_file_path_map",
"=",
"$",
"this",
"->",
"finder",
"->",
"getMigrationClassFilePathMap",
"(",
")",
";",
"$",
"migrat... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/databasemigrations/blob/ef91d5b5f74d79b4a75695393eb25c7c47dad093/src/Migrations.php#L85-L115 |
activecollab/databasemigrations | src/Migrations.php | Migrations.getMigrationInstances | private function getMigrationInstances(array $migration_class_file_path_map)
{
$result = [];
foreach ($migration_class_file_path_map as $migration_class => $migration_file_path) {
if (is_file($migration_file_path)) {
require_once $migration_file_path;
if... | php | private function getMigrationInstances(array $migration_class_file_path_map)
{
$result = [];
foreach ($migration_class_file_path_map as $migration_class => $migration_file_path) {
if (is_file($migration_file_path)) {
require_once $migration_file_path;
if... | [
"private",
"function",
"getMigrationInstances",
"(",
"array",
"$",
"migration_class_file_path_map",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"migration_class_file_path_map",
"as",
"$",
"migration_class",
"=>",
"$",
"migration_file_path",
")"... | Return an array of MigrationInterface instances indexed by class name.
@param array $migration_class_file_path_map
@return MigrationInterface[] | [
"Return",
"an",
"array",
"of",
"MigrationInterface",
"instances",
"indexed",
"by",
"class",
"name",
"."
] | train | https://github.com/activecollab/databasemigrations/blob/ef91d5b5f74d79b4a75695393eb25c7c47dad093/src/Migrations.php#L123-L146 |
activecollab/databasemigrations | src/Migrations.php | Migrations.up | public function up(callable $output = null)
{
foreach ($this->getMigrations() as $migration) {
$migration_class = get_class($migration);
if ($this->isExecuted($migration)) {
$this->log->debug('Migration {migration} already executed', ['migration' => $migration_class]... | php | public function up(callable $output = null)
{
foreach ($this->getMigrations() as $migration) {
$migration_class = get_class($migration);
if ($this->isExecuted($migration)) {
$this->log->debug('Migration {migration} already executed', ['migration' => $migration_class]... | [
"public",
"function",
"up",
"(",
"callable",
"$",
"output",
"=",
"null",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getMigrations",
"(",
")",
"as",
"$",
"migration",
")",
"{",
"$",
"migration_class",
"=",
"get_class",
"(",
"$",
"migration",
")",
";"... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/databasemigrations/blob/ef91d5b5f74d79b4a75695393eb25c7c47dad093/src/Migrations.php#L167-L196 |
activecollab/databasemigrations | src/Migrations.php | Migrations.getTableName | public function getTableName()
{
if ($this->table_exists === null && !in_array($this->table_name, $this->connection->getTableNames())) {
$this->connection->execute('CREATE TABLE ' . $this->connection->escapeTableName($this->table_name) . ' (
`id` int(10) unsigned NOT NULL AUTO_IN... | php | public function getTableName()
{
if ($this->table_exists === null && !in_array($this->table_name, $this->connection->getTableNames())) {
$this->connection->execute('CREATE TABLE ' . $this->connection->escapeTableName($this->table_name) . ' (
`id` int(10) unsigned NOT NULL AUTO_IN... | [
"public",
"function",
"getTableName",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"table_exists",
"===",
"null",
"&&",
"!",
"in_array",
"(",
"$",
"this",
"->",
"table_name",
",",
"$",
"this",
"->",
"connection",
"->",
"getTableNames",
"(",
")",
")",
"... | Return name of the table where we store info about executed migrations.
@return string | [
"Return",
"name",
"of",
"the",
"table",
"where",
"we",
"store",
"info",
"about",
"executed",
"migrations",
"."
] | train | https://github.com/activecollab/databasemigrations/blob/ef91d5b5f74d79b4a75695393eb25c7c47dad093/src/Migrations.php#L208-L224 |
activecollab/databasemigrations | src/Migrations.php | Migrations.execute | public function execute(MigrationInterface $migration)
{
if ($this->isExecuted($migration)) {
throw new LogicException('Migration ' . get_class($migration) . ' is already executed');
}
$this->connection->transact(function () use ($migration) {
$migration->up();
... | php | public function execute(MigrationInterface $migration)
{
if ($this->isExecuted($migration)) {
throw new LogicException('Migration ' . get_class($migration) . ' is already executed');
}
$this->connection->transact(function () use ($migration) {
$migration->up();
... | [
"public",
"function",
"execute",
"(",
"MigrationInterface",
"$",
"migration",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isExecuted",
"(",
"$",
"migration",
")",
")",
"{",
"throw",
"new",
"LogicException",
"(",
"'Migration '",
".",
"get_class",
"(",
"$",
"mi... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/databasemigrations/blob/ef91d5b5f74d79b4a75695393eb25c7c47dad093/src/Migrations.php#L229-L243 |
activecollab/databasemigrations | src/Migrations.php | Migrations.isExecuted | public function isExecuted(MigrationInterface $migration)
{
return (bool) $this->connection->count($this->getTableName(), ['`migration` = ?', get_class($migration)]);
} | php | public function isExecuted(MigrationInterface $migration)
{
return (bool) $this->connection->count($this->getTableName(), ['`migration` = ?', get_class($migration)]);
} | [
"public",
"function",
"isExecuted",
"(",
"MigrationInterface",
"$",
"migration",
")",
"{",
"return",
"(",
"bool",
")",
"$",
"this",
"->",
"connection",
"->",
"count",
"(",
"$",
"this",
"->",
"getTableName",
"(",
")",
",",
"[",
"'`migration` = ?'",
",",
"ge... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/databasemigrations/blob/ef91d5b5f74d79b4a75695393eb25c7c47dad093/src/Migrations.php#L248-L251 |
activecollab/databasemigrations | src/Migrations.php | Migrations.setAllAsExecuted | public function setAllAsExecuted()
{
$this->connection->transact(function () {
$timestamp = new DateTimeValue();
$batch = $this->connection->batchInsert($this->getTableName(), ['migration', 'executed_at'], 50, ConnectionInterface::REPLACE);
foreach ($this->getMigrations... | php | public function setAllAsExecuted()
{
$this->connection->transact(function () {
$timestamp = new DateTimeValue();
$batch = $this->connection->batchInsert($this->getTableName(), ['migration', 'executed_at'], 50, ConnectionInterface::REPLACE);
foreach ($this->getMigrations... | [
"public",
"function",
"setAllAsExecuted",
"(",
")",
"{",
"$",
"this",
"->",
"connection",
"->",
"transact",
"(",
"function",
"(",
")",
"{",
"$",
"timestamp",
"=",
"new",
"DateTimeValue",
"(",
")",
";",
"$",
"batch",
"=",
"$",
"this",
"->",
"connection",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/activecollab/databasemigrations/blob/ef91d5b5f74d79b4a75695393eb25c7c47dad093/src/Migrations.php#L256-L269 |
bfitech/zapcore | src/Logger.php | Logger.format | protected function format(
string $timestamp, string $levelstr, string $msg
) {
$fmt = "[%s] %s: %s\n";
return sprintf($fmt, $timestamp, $levelstr, $msg);
} | php | protected function format(
string $timestamp, string $levelstr, string $msg
) {
$fmt = "[%s] %s: %s\n";
return sprintf($fmt, $timestamp, $levelstr, $msg);
} | [
"protected",
"function",
"format",
"(",
"string",
"$",
"timestamp",
",",
"string",
"$",
"levelstr",
",",
"string",
"$",
"msg",
")",
"{",
"$",
"fmt",
"=",
"\"[%s] %s: %s\\n\"",
";",
"return",
"sprintf",
"(",
"$",
"fmt",
",",
"$",
"timestamp",
",",
"$",
... | Log line formatter.
Patch this to customize line format or add additional
information.
@param string $timestamp Timestamp, always in UTC ISO-8601.
@param string $levelstr String representation of current log
level, e.g. `DEB` for debug.
@param string $msg Error message.
@return string Formatted line. | [
"Log",
"line",
"formatter",
"."
] | train | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/src/Logger.php#L64-L69 |
bfitech/zapcore | src/Logger.php | Logger.one_line | private function one_line(string $msg) {
$msg = trim($msg);
$msg = str_replace([
"\t", "\n", "\r",
], [
'\t', '\n', '\r',
], $msg);
return preg_replace('! +!', ' ', $msg);
} | php | private function one_line(string $msg) {
$msg = trim($msg);
$msg = str_replace([
"\t", "\n", "\r",
], [
'\t', '\n', '\r',
], $msg);
return preg_replace('! +!', ' ', $msg);
} | [
"private",
"function",
"one_line",
"(",
"string",
"$",
"msg",
")",
"{",
"$",
"msg",
"=",
"trim",
"(",
"$",
"msg",
")",
";",
"$",
"msg",
"=",
"str_replace",
"(",
"[",
"\"\\t\"",
",",
"\"\\n\"",
",",
"\"\\r\"",
",",
"]",
",",
"[",
"'\\t'",
",",
"'\... | Write lines as single line, with tab, CR and LF written
symbolically. | [
"Write",
"lines",
"as",
"single",
"line",
"with",
"tab",
"CR",
"and",
"LF",
"written",
"symbolically",
"."
] | train | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/src/Logger.php#L75-L83 |
bfitech/zapcore | src/Logger.php | Logger.write | private function write(string $levelstr, string $msg) {
$timestamp = gmdate(\DateTime::ATOM);
// @codeCoverageIgnoreStart
try {
// @codeCoverageIgnoreEnd
$msg = $this->one_line($msg);
$line = $this->format($timestamp, $levelstr, $msg);
fwrite($this->handle, $line);
// @codeCoverageIgnoreStart
} ... | php | private function write(string $levelstr, string $msg) {
$timestamp = gmdate(\DateTime::ATOM);
// @codeCoverageIgnoreStart
try {
// @codeCoverageIgnoreEnd
$msg = $this->one_line($msg);
$line = $this->format($timestamp, $levelstr, $msg);
fwrite($this->handle, $line);
// @codeCoverageIgnoreStart
} ... | [
"private",
"function",
"write",
"(",
"string",
"$",
"levelstr",
",",
"string",
"$",
"msg",
")",
"{",
"$",
"timestamp",
"=",
"gmdate",
"(",
"\\",
"DateTime",
"::",
"ATOM",
")",
";",
"// @codeCoverageIgnoreStart",
"try",
"{",
"// @codeCoverageIgnoreEnd",
"$",
... | Write to handle. | [
"Write",
"to",
"handle",
"."
] | train | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/src/Logger.php#L88-L100 |
bfitech/zapcore | src/Logger.php | Logger.debug | public function debug(string $msg) {
if ($this->level > self::DEBUG)
return;
$this->write('DEB', $msg);
} | php | public function debug(string $msg) {
if ($this->level > self::DEBUG)
return;
$this->write('DEB', $msg);
} | [
"public",
"function",
"debug",
"(",
"string",
"$",
"msg",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"level",
">",
"self",
"::",
"DEBUG",
")",
"return",
";",
"$",
"this",
"->",
"write",
"(",
"'DEB'",
",",
"$",
"msg",
")",
";",
"}"
] | Debug.
@param string $msg Error message. | [
"Debug",
"."
] | train | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/src/Logger.php#L107-L111 |
bfitech/zapcore | src/Logger.php | Logger.info | public function info(string $msg) {
if ($this->level > self::INFO)
return;
$this->write('INF', $msg);
} | php | public function info(string $msg) {
if ($this->level > self::INFO)
return;
$this->write('INF', $msg);
} | [
"public",
"function",
"info",
"(",
"string",
"$",
"msg",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"level",
">",
"self",
"::",
"INFO",
")",
"return",
";",
"$",
"this",
"->",
"write",
"(",
"'INF'",
",",
"$",
"msg",
")",
";",
"}"
] | Info.
@param string $msg Error message. | [
"Info",
"."
] | train | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/src/Logger.php#L118-L122 |
bfitech/zapcore | src/Logger.php | Logger.warning | public function warning(string $msg) {
if ($this->level > self::WARNING)
return;
$this->write('WRN', $msg);
} | php | public function warning(string $msg) {
if ($this->level > self::WARNING)
return;
$this->write('WRN', $msg);
} | [
"public",
"function",
"warning",
"(",
"string",
"$",
"msg",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"level",
">",
"self",
"::",
"WARNING",
")",
"return",
";",
"$",
"this",
"->",
"write",
"(",
"'WRN'",
",",
"$",
"msg",
")",
";",
"}"
] | Warning.
@param string $msg Error message. | [
"Warning",
"."
] | train | https://github.com/bfitech/zapcore/blob/0ae4cb9370876ab3583556bf272063685ec57948/src/Logger.php#L129-L133 |
vincentchalamon/VinceCmsSonataAdminBundle | Admin/Entity/BlockAdmin.php | BlockAdmin.configureFormFields | protected function configureFormFields(FormMapper $mapper)
{
$mapper
->with('block.field.contents', array('class' => 'col-md-6'))
->add('title', null, array(
'label' => 'block.field.title',
)
)
->add('con... | php | protected function configureFormFields(FormMapper $mapper)
{
$mapper
->with('block.field.contents', array('class' => 'col-md-6'))
->add('title', null, array(
'label' => 'block.field.title',
)
)
->add('con... | [
"protected",
"function",
"configureFormFields",
"(",
"FormMapper",
"$",
"mapper",
")",
"{",
"$",
"mapper",
"->",
"with",
"(",
"'block.field.contents'",
",",
"array",
"(",
"'class'",
"=>",
"'col-md-6'",
")",
")",
"->",
"add",
"(",
"'title'",
",",
"null",
",",... | {@inheritdoc} | [
"{"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Admin/Entity/BlockAdmin.php#L66-L80 |
phizzl/deployee | src/Bootstrap/Bootstrap.php | Bootstrap.bootstrap | public function bootstrap()
{
$this->registerBootstrapArguments();
$this->registerEventDispatcher();
$this->registerConfigLoader();
$this->registerConfig();
$this->registerPlugins();
$this->registerTaskDispatcherCollection();
$this->registerLogger();
... | php | public function bootstrap()
{
$this->registerBootstrapArguments();
$this->registerEventDispatcher();
$this->registerConfigLoader();
$this->registerConfig();
$this->registerPlugins();
$this->registerTaskDispatcherCollection();
$this->registerLogger();
... | [
"public",
"function",
"bootstrap",
"(",
")",
"{",
"$",
"this",
"->",
"registerBootstrapArguments",
"(",
")",
";",
"$",
"this",
"->",
"registerEventDispatcher",
"(",
")",
";",
"$",
"this",
"->",
"registerConfigLoader",
"(",
")",
";",
"$",
"this",
"->",
"reg... | Run bootstrap an register services to the DI container
@return Container | [
"Run",
"bootstrap",
"an",
"register",
"services",
"to",
"the",
"DI",
"container"
] | train | https://github.com/phizzl/deployee/blob/def884e49608589d9594b8d538f3ec9aa0e25add/src/Bootstrap/Bootstrap.php#L44-L65 |
o2system/html | src/Dom/Lists/Asset.php | Asset.import | public function import(Asset $assetNodes)
{
if (is_array($assetNodes = $assetNodes->getArrayCopy())) {
foreach ($assetNodes as $name => $value) {
$this->offsetSet($name, $value);
}
}
return $this;
} | php | public function import(Asset $assetNodes)
{
if (is_array($assetNodes = $assetNodes->getArrayCopy())) {
foreach ($assetNodes as $name => $value) {
$this->offsetSet($name, $value);
}
}
return $this;
} | [
"public",
"function",
"import",
"(",
"Asset",
"$",
"assetNodes",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"assetNodes",
"=",
"$",
"assetNodes",
"->",
"getArrayCopy",
"(",
")",
")",
")",
"{",
"foreach",
"(",
"$",
"assetNodes",
"as",
"$",
"name",
"=>",... | Asset::import
@param \O2System\Html\Dom\Lists\Asset $assetNodes
@return static | [
"Asset",
"::",
"import"
] | train | https://github.com/o2system/html/blob/b7336fb45d42603ce1064b25572a05d495887670/src/Dom/Lists/Asset.php#L63-L72 |
o2system/html | src/Dom/Lists/Asset.php | Asset.offsetSet | public function offsetSet($name, $value)
{
if ($value instanceof Element) {
parent::offsetSet($name, $value);
} else {
$meta = $this->ownerDocument->createElement($this->element);
$meta->setAttribute($name, $value);
parent::offsetSet($name, $meta);
... | php | public function offsetSet($name, $value)
{
if ($value instanceof Element) {
parent::offsetSet($name, $value);
} else {
$meta = $this->ownerDocument->createElement($this->element);
$meta->setAttribute($name, $value);
parent::offsetSet($name, $meta);
... | [
"public",
"function",
"offsetSet",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
"instanceof",
"Element",
")",
"{",
"parent",
"::",
"offsetSet",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"}",
"else",
"{",
"$",
"meta",... | Asset::offsetSet
@param string $name
@param string $value | [
"Asset",
"::",
"offsetSet"
] | train | https://github.com/o2system/html/blob/b7336fb45d42603ce1064b25572a05d495887670/src/Dom/Lists/Asset.php#L82-L92 |
o2system/html | src/Dom/Lists/Asset.php | Asset.createElement | public function createElement(array $attributes)
{
$element = $this->ownerDocument->createElement($this->element);
$name = null;
foreach ($attributes as $key => $value) {
$element->setAttribute($key, $value);
}
$this[] = $element;
return $element;
} | php | public function createElement(array $attributes)
{
$element = $this->ownerDocument->createElement($this->element);
$name = null;
foreach ($attributes as $key => $value) {
$element->setAttribute($key, $value);
}
$this[] = $element;
return $element;
} | [
"public",
"function",
"createElement",
"(",
"array",
"$",
"attributes",
")",
"{",
"$",
"element",
"=",
"$",
"this",
"->",
"ownerDocument",
"->",
"createElement",
"(",
"$",
"this",
"->",
"element",
")",
";",
"$",
"name",
"=",
"null",
";",
"foreach",
"(",
... | Asset::createElement
@param array $attributes
@return \DOMElement | [
"Asset",
"::",
"createElement"
] | train | https://github.com/o2system/html/blob/b7336fb45d42603ce1064b25572a05d495887670/src/Dom/Lists/Asset.php#L103-L115 |
axelitus/php-base | src/BoolOr.php | BoolOr.val | public static function val($value1, $value2, $_ = null)
{
if (!static::is($value1) || !static::is($value2)) {
throw new \InvalidArgumentException("All parameters must be of type bool.");
}
$ret = ($value1 || $value2);
$args = array_slice(func_get_args(), 2);
whil... | php | public static function val($value1, $value2, $_ = null)
{
if (!static::is($value1) || !static::is($value2)) {
throw new \InvalidArgumentException("All parameters must be of type bool.");
}
$ret = ($value1 || $value2);
$args = array_slice(func_get_args(), 2);
whil... | [
"public",
"static",
"function",
"val",
"(",
"$",
"value1",
",",
"$",
"value2",
",",
"$",
"_",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"static",
"::",
"is",
"(",
"$",
"value1",
")",
"||",
"!",
"static",
"::",
"is",
"(",
"$",
"value2",
")",
")",
... | Applies the OR operation to the given values.
The function is optimized to return early (if a true is found the function returns true immediately),
therefore we can't assume that all values had been tested for validity.
@param bool $value1 The left operand to apply the operation to.
@param bool $value2 The right oper... | [
"Applies",
"the",
"OR",
"operation",
"to",
"the",
"given",
"values",
"."
] | train | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BoolOr.php#L43-L60 |
axelitus/php-base | src/BoolOr.php | BoolOr.arr | public static function arr(array $value1, array $_ = null)
{
$ret = [];
$args = func_get_args();
foreach ($args as $arg) {
if (!is_array($arg) || count($arg) < 2) {
throw new \InvalidArgumentException(
"All parameters must be of type array and ... | php | public static function arr(array $value1, array $_ = null)
{
$ret = [];
$args = func_get_args();
foreach ($args as $arg) {
if (!is_array($arg) || count($arg) < 2) {
throw new \InvalidArgumentException(
"All parameters must be of type array and ... | [
"public",
"static",
"function",
"arr",
"(",
"array",
"$",
"value1",
",",
"array",
"$",
"_",
"=",
"null",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"foreach",
"(",
"$",
"args",
"as",
"$",
"arg",
... | Applies the OR operation to the items of the given array(s).
If only one array is given, the result will be a bool instead of an array.
@param array $value1 The array to apply the operation to its items.
@param array $_ More arrays to apply the operation to its items.
@return bool|array The result of applying t... | [
"Applies",
"the",
"OR",
"operation",
"to",
"the",
"items",
"of",
"the",
"given",
"array",
"(",
"s",
")",
"."
] | train | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/BoolOr.php#L76-L91 |
minerva-framework/totalvoice-api | src/TotalVoice/HTTP/HttpClient.php | HttpClient.post | public static function post($url, array $data)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, TotalVoice::$api . $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RET... | php | public static function post($url, array $data)
{
$ch = curl_init();
curl_setopt($ch, CURLOPT_URL, TotalVoice::$api . $url);
curl_setopt($ch, CURLOPT_POST, 1);
curl_setopt($ch, CURLOPT_POSTFIELDS, http_build_query($data));
curl_setopt($ch, CURLOPT_RET... | [
"public",
"static",
"function",
"post",
"(",
"$",
"url",
",",
"array",
"$",
"data",
")",
"{",
"$",
"ch",
"=",
"curl_init",
"(",
")",
";",
"curl_setopt",
"(",
"$",
"ch",
",",
"CURLOPT_URL",
",",
"TotalVoice",
"::",
"$",
"api",
".",
"$",
"url",
")",
... | Envia um conjunto de parâmetros via post
@param $url
@param array $data
@return HttpResponse | [
"Envia",
"um",
"conjunto",
"de",
"parâmetros",
"via",
"post"
] | train | https://github.com/minerva-framework/totalvoice-api/blob/acd15574c9977975b385ee2c836f55f636c01be7/src/TotalVoice/HTTP/HttpClient.php#L23-L43 |
movoin/one-swoole | src/Support/Helpers/Json.php | Json.encode | public static function encode($value): string
{
$flags = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
| (defined('JSON_PRESERVE_ZERO_FRACTION') ? JSON_PRESERVE_ZERO_FRACTION : 0);
$json = json_encode($value, $flags);
if ($error = json_last_error()) {
throw new Js... | php | public static function encode($value): string
{
$flags = JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES
| (defined('JSON_PRESERVE_ZERO_FRACTION') ? JSON_PRESERVE_ZERO_FRACTION : 0);
$json = json_encode($value, $flags);
if ($error = json_last_error()) {
throw new Js... | [
"public",
"static",
"function",
"encode",
"(",
"$",
"value",
")",
":",
"string",
"{",
"$",
"flags",
"=",
"JSON_UNESCAPED_UNICODE",
"|",
"JSON_UNESCAPED_SLASHES",
"|",
"(",
"defined",
"(",
"'JSON_PRESERVE_ZERO_FRACTION'",
")",
"?",
"JSON_PRESERVE_ZERO_FRACTION",
":",... | 对内容进行 JSON 编码
@param mixed $value
@return string
@throws \One\Support\Exceptions\JsonException | [
"对内容进行",
"JSON",
"编码"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Support/Helpers/Json.php#L27-L39 |
movoin/one-swoole | src/Support/Helpers/Json.php | Json.decode | public static function decode(string $json)
{
$value = json_decode($json, true, 512, JSON_BIGINT_AS_STRING);
if ($error = json_last_error()) {
throw new JsonException(json_last_error_msg(), $error);
}
return $value;
} | php | public static function decode(string $json)
{
$value = json_decode($json, true, 512, JSON_BIGINT_AS_STRING);
if ($error = json_last_error()) {
throw new JsonException(json_last_error_msg(), $error);
}
return $value;
} | [
"public",
"static",
"function",
"decode",
"(",
"string",
"$",
"json",
")",
"{",
"$",
"value",
"=",
"json_decode",
"(",
"$",
"json",
",",
"true",
",",
"512",
",",
"JSON_BIGINT_AS_STRING",
")",
";",
"if",
"(",
"$",
"error",
"=",
"json_last_error",
"(",
"... | 对 JSON 进行解码
@param string $json
@return mixed
@throws \One\Support\Exceptions\JsonException | [
"对",
"JSON",
"进行解码"
] | train | https://github.com/movoin/one-swoole/blob/b9b175963ead91416cc50902a04e05ff3ef571de/src/Support/Helpers/Json.php#L49-L58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.