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 |
|---|---|---|---|---|---|---|---|---|---|---|
ufocoder/yii2-SyncSocial | src/components/services/Vkontakte.php | Vkontakte.publishPost | public function publishPost( $message, $url = null ) {
$userAttributes = $this->service->getUserAttributes();
$postResponse = $this->service->api( 'wall.post', 'GET', [
'message' => $message
] );
$getResponse = $this->service->api( 'wall.getById', 'GET', [
'pos... | php | public function publishPost( $message, $url = null ) {
$userAttributes = $this->service->getUserAttributes();
$postResponse = $this->service->api( 'wall.post', 'GET', [
'message' => $message
] );
$getResponse = $this->service->api( 'wall.getById', 'GET', [
'pos... | [
"public",
"function",
"publishPost",
"(",
"$",
"message",
",",
"$",
"url",
"=",
"null",
")",
"{",
"$",
"userAttributes",
"=",
"$",
"this",
"->",
"service",
"->",
"getUserAttributes",
"(",
")",
";",
"$",
"postResponse",
"=",
"$",
"this",
"->",
"service",
... | @param $message
@param null $url
@return array|void
@throws Exception | [
"@param",
"$message",
"@param",
"null",
"$url"
] | train | https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/services/Vkontakte.php#L39-L56 |
ufocoder/yii2-SyncSocial | src/components/services/Vkontakte.php | Vkontakte.deletePost | public function deletePost( $id ) {
$userAttributes = $this->service->getUserAttributes();
$response = $this->service->api( 'wall.delete', 'GET', [
'owner_id' => $userAttributes['id'],
'post_id' => $id
] );
return $response['response'] == 1;
} | php | public function deletePost( $id ) {
$userAttributes = $this->service->getUserAttributes();
$response = $this->service->api( 'wall.delete', 'GET', [
'owner_id' => $userAttributes['id'],
'post_id' => $id
] );
return $response['response'] == 1;
} | [
"public",
"function",
"deletePost",
"(",
"$",
"id",
")",
"{",
"$",
"userAttributes",
"=",
"$",
"this",
"->",
"service",
"->",
"getUserAttributes",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"service",
"->",
"api",
"(",
"'wall.delete'",
",",
... | @param $id
@return bool | [
"@param",
"$id"
] | train | https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/services/Vkontakte.php#L63-L73 |
ufocoder/yii2-SyncSocial | src/components/services/Vkontakte.php | Vkontakte.getWallGetRequestUrl | protected function getWallGetRequestUrl( $limit = null ) {
$query = http_build_query( [
'owner_id' => ArrayHelper::getValue( $this->serviceSettings, 'options.owner_id' ),
'from_group' => ArrayHelper::getValue( $this->serviceSettings, 'options.from_group' ),
'limit' =>... | php | protected function getWallGetRequestUrl( $limit = null ) {
$query = http_build_query( [
'owner_id' => ArrayHelper::getValue( $this->serviceSettings, 'options.owner_id' ),
'from_group' => ArrayHelper::getValue( $this->serviceSettings, 'options.from_group' ),
'limit' =>... | [
"protected",
"function",
"getWallGetRequestUrl",
"(",
"$",
"limit",
"=",
"null",
")",
"{",
"$",
"query",
"=",
"http_build_query",
"(",
"[",
"'owner_id'",
"=>",
"ArrayHelper",
"::",
"getValue",
"(",
"$",
"this",
"->",
"serviceSettings",
",",
"'options.owner_id'",... | @param integer $limit
@return string | [
"@param",
"integer",
"$limit"
] | train | https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/services/Vkontakte.php#L80-L89 |
ufocoder/yii2-SyncSocial | src/components/services/Vkontakte.php | Vkontakte.getPosts | public function getPosts( $limit = 100 ) {
return $this->parseGetPosts(
$this->service->api( $this->getWallGetRequestUrl( $limit ), 'GET' ),
'response',
[
'id',
'text'
],
[
'service_id_author' => 'from_i... | php | public function getPosts( $limit = 100 ) {
return $this->parseGetPosts(
$this->service->api( $this->getWallGetRequestUrl( $limit ), 'GET' ),
'response',
[
'id',
'text'
],
[
'service_id_author' => 'from_i... | [
"public",
"function",
"getPosts",
"(",
"$",
"limit",
"=",
"100",
")",
"{",
"return",
"$",
"this",
"->",
"parseGetPosts",
"(",
"$",
"this",
"->",
"service",
"->",
"api",
"(",
"$",
"this",
"->",
"getWallGetRequestUrl",
"(",
"$",
"limit",
")",
",",
"'GET'... | @param int $limit
@return array
@throws Exception | [
"@param",
"int",
"$limit"
] | train | https://github.com/ufocoder/yii2-SyncSocial/blob/2dbaaec2dad782c52fdd5b648a31ba7fe2a75e1b/src/components/services/Vkontakte.php#L97-L112 |
yuncms/framework | src/notifications/RoutesNotifications.php | RoutesNotifications.shouldReceiveNotification | public function shouldReceiveNotification(Notification $notification)
{
$alias = get_class($notification);
if (isset($this->notificationSettings)) {
$settings = $this->notificationSettings;
if (array_key_exists($alias, $settings)) {
if ($settings[$alias] insta... | php | public function shouldReceiveNotification(Notification $notification)
{
$alias = get_class($notification);
if (isset($this->notificationSettings)) {
$settings = $this->notificationSettings;
if (array_key_exists($alias, $settings)) {
if ($settings[$alias] insta... | [
"public",
"function",
"shouldReceiveNotification",
"(",
"Notification",
"$",
"notification",
")",
"{",
"$",
"alias",
"=",
"get_class",
"(",
"$",
"notification",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"notificationSettings",
")",
")",
"{",
"$",... | 确定通知实体是否应通过签入通知设置来接收通知。
@param Notification $notification
@return bool | [
"确定通知实体是否应通过签入通知设置来接收通知。"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/notifications/RoutesNotifications.php#L38-L51 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style/TableFull.php | PHPWord_Style_TableFull.setBorderSize | public function setBorderSize($pValue = null) {
$this->_borderTopSize = $pValue;
$this->_borderLeftSize = $pValue;
$this->_borderRightSize = $pValue;
$this->_borderBottomSize = $pValue;
$this->_borderInsideHSize = $pValue;
$this->_borderInsideVSize = $pValue;
} | php | public function setBorderSize($pValue = null) {
$this->_borderTopSize = $pValue;
$this->_borderLeftSize = $pValue;
$this->_borderRightSize = $pValue;
$this->_borderBottomSize = $pValue;
$this->_borderInsideHSize = $pValue;
$this->_borderInsideVSize = $pValue;
} | [
"public",
"function",
"setBorderSize",
"(",
"$",
"pValue",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_borderTopSize",
"=",
"$",
"pValue",
";",
"$",
"this",
"->",
"_borderLeftSize",
"=",
"$",
"pValue",
";",
"$",
"this",
"->",
"_borderRightSize",
"=",
"$"... | Set TLRBVH Border Size
@param int $pValue | [
"Set",
"TLRBVH",
"Border",
"Size"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style/TableFull.php#L250-L257 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style/TableFull.php | PHPWord_Style_TableFull.getBorderSize | public function getBorderSize() {
$t = $this->getBorderTopSize();
$l = $this->getBorderLeftSize();
$r = $this->getBorderRightSize();
$b = $this->getBorderBottomSize();
$h = $this->getBorderInsideHSize();
$v = $this->getBorderInsideVSize();
return array($t, $l, $r, $b, $h, $v);
} | php | public function getBorderSize() {
$t = $this->getBorderTopSize();
$l = $this->getBorderLeftSize();
$r = $this->getBorderRightSize();
$b = $this->getBorderBottomSize();
$h = $this->getBorderInsideHSize();
$v = $this->getBorderInsideVSize();
return array($t, $l, $r, $b, $h, $v);
} | [
"public",
"function",
"getBorderSize",
"(",
")",
"{",
"$",
"t",
"=",
"$",
"this",
"->",
"getBorderTopSize",
"(",
")",
";",
"$",
"l",
"=",
"$",
"this",
"->",
"getBorderLeftSize",
"(",
")",
";",
"$",
"r",
"=",
"$",
"this",
"->",
"getBorderRightSize",
"... | Get TLRBVH Border Size
@return array | [
"Get",
"TLRBVH",
"Border",
"Size"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style/TableFull.php#L264-L273 |
webforge-labs/psc-cms | lib/PHPWord/PHPWord/Style/TableFull.php | PHPWord_Style_TableFull.getBorderColor | public function getBorderColor() {
$t = $this->getBorderTopColor();
$l = $this->getBorderLeftColor();
$r = $this->getBorderRightColor();
$b = $this->getBorderBottomColor();
$h = $this->getBorderInsideHColor();
$v = $this->getBorderInsideVColor();
return array($t, $l, $r, $b, $h, $v);
} | php | public function getBorderColor() {
$t = $this->getBorderTopColor();
$l = $this->getBorderLeftColor();
$r = $this->getBorderRightColor();
$b = $this->getBorderBottomColor();
$h = $this->getBorderInsideHColor();
$v = $this->getBorderInsideVColor();
return array($t, $l, $r, $b, $h, $v);
} | [
"public",
"function",
"getBorderColor",
"(",
")",
"{",
"$",
"t",
"=",
"$",
"this",
"->",
"getBorderTopColor",
"(",
")",
";",
"$",
"l",
"=",
"$",
"this",
"->",
"getBorderLeftColor",
"(",
")",
";",
"$",
"r",
"=",
"$",
"this",
"->",
"getBorderRightColor",... | Get TLRB Border Color
@return array | [
"Get",
"TLRB",
"Border",
"Color"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/PHPWord/PHPWord/Style/TableFull.php#L292-L301 |
chubbyphp/chubbyphp-api-http | src/Manager/ResponseManager.php | ResponseManager.create | public function create(
$object,
string $accept,
int $status = 200,
NormalizerContextInterface $context = null
): ResponseInterface {
$body = $this->serializer->serialize($object, $accept, $context);
$response = $this->responseFactory->createResponse($status)->withHe... | php | public function create(
$object,
string $accept,
int $status = 200,
NormalizerContextInterface $context = null
): ResponseInterface {
$body = $this->serializer->serialize($object, $accept, $context);
$response = $this->responseFactory->createResponse($status)->withHe... | [
"public",
"function",
"create",
"(",
"$",
"object",
",",
"string",
"$",
"accept",
",",
"int",
"$",
"status",
"=",
"200",
",",
"NormalizerContextInterface",
"$",
"context",
"=",
"null",
")",
":",
"ResponseInterface",
"{",
"$",
"body",
"=",
"$",
"this",
"-... | @param object $object
@param string $accept
@param int $status
@param NormalizerContextInterface|null $context
@return ResponseInterface | [
"@param",
"object",
"$object",
"@param",
"string",
"$accept",
"@param",
"int",
"$status",
"@param",
"NormalizerContextInterface|null",
"$context"
] | train | https://github.com/chubbyphp/chubbyphp-api-http/blob/675d657b686e96aa16be56d0e9e07aaa844266ed/src/Manager/ResponseManager.php#L54-L66 |
chubbyphp/chubbyphp-api-http | src/Manager/ResponseManager.php | ResponseManager.createEmpty | public function createEmpty(string $accept, int $status = 204): ResponseInterface
{
return $this->responseFactory->createResponse($status)->withHeader('Content-Type', $accept);
} | php | public function createEmpty(string $accept, int $status = 204): ResponseInterface
{
return $this->responseFactory->createResponse($status)->withHeader('Content-Type', $accept);
} | [
"public",
"function",
"createEmpty",
"(",
"string",
"$",
"accept",
",",
"int",
"$",
"status",
"=",
"204",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"responseFactory",
"->",
"createResponse",
"(",
"$",
"status",
")",
"->",
"withHeader",... | @param string $accept
@param int $status
@return ResponseInterface | [
"@param",
"string",
"$accept",
"@param",
"int",
"$status"
] | train | https://github.com/chubbyphp/chubbyphp-api-http/blob/675d657b686e96aa16be56d0e9e07aaa844266ed/src/Manager/ResponseManager.php#L74-L77 |
chubbyphp/chubbyphp-api-http | src/Manager/ResponseManager.php | ResponseManager.createRedirect | public function createRedirect(string $location, int $status = 307): ResponseInterface
{
return $this->responseFactory->createResponse($status)->withHeader('Location', $location);
} | php | public function createRedirect(string $location, int $status = 307): ResponseInterface
{
return $this->responseFactory->createResponse($status)->withHeader('Location', $location);
} | [
"public",
"function",
"createRedirect",
"(",
"string",
"$",
"location",
",",
"int",
"$",
"status",
"=",
"307",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"responseFactory",
"->",
"createResponse",
"(",
"$",
"status",
")",
"->",
"withHea... | @param string $location
@param int $status
@return ResponseInterface | [
"@param",
"string",
"$location",
"@param",
"int",
"$status"
] | train | https://github.com/chubbyphp/chubbyphp-api-http/blob/675d657b686e96aa16be56d0e9e07aaa844266ed/src/Manager/ResponseManager.php#L85-L88 |
chubbyphp/chubbyphp-api-http | src/Manager/ResponseManager.php | ResponseManager.createFromApiProblem | public function createFromApiProblem(
ApiProblemInterface $apiProblem,
string $accept,
NormalizerContextInterface $context = null
): ResponseInterface {
$status = $apiProblem->getStatus();
$response = $this->responseFactory->createResponse($status)
->withHeader('... | php | public function createFromApiProblem(
ApiProblemInterface $apiProblem,
string $accept,
NormalizerContextInterface $context = null
): ResponseInterface {
$status = $apiProblem->getStatus();
$response = $this->responseFactory->createResponse($status)
->withHeader('... | [
"public",
"function",
"createFromApiProblem",
"(",
"ApiProblemInterface",
"$",
"apiProblem",
",",
"string",
"$",
"accept",
",",
"NormalizerContextInterface",
"$",
"context",
"=",
"null",
")",
":",
"ResponseInterface",
"{",
"$",
"status",
"=",
"$",
"apiProblem",
"-... | @param ApiProblemInterface $apiProblem
@param string $accept
@param NormalizerContextInterface $context
@return ResponseInterface | [
"@param",
"ApiProblemInterface",
"$apiProblem",
"@param",
"string",
"$accept",
"@param",
"NormalizerContextInterface",
"$context"
] | train | https://github.com/chubbyphp/chubbyphp-api-http/blob/675d657b686e96aa16be56d0e9e07aaa844266ed/src/Manager/ResponseManager.php#L97-L116 |
AydinHassan/cli-md-renderer | src/Renderer/FencedCodeRenderer.php | FencedCodeRenderer.render | public function render(AbstractBlock $block, CliRenderer $renderer)
{
if (!($block instanceof FencedCode)) {
throw new \InvalidArgumentException(sprintf('Incompatible block type: "%s"', get_class($block)));
}
$infoWords = $block->getInfoWords();
$codeType = null;
... | php | public function render(AbstractBlock $block, CliRenderer $renderer)
{
if (!($block instanceof FencedCode)) {
throw new \InvalidArgumentException(sprintf('Incompatible block type: "%s"', get_class($block)));
}
$infoWords = $block->getInfoWords();
$codeType = null;
... | [
"public",
"function",
"render",
"(",
"AbstractBlock",
"$",
"block",
",",
"CliRenderer",
"$",
"renderer",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"block",
"instanceof",
"FencedCode",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",... | @param AbstractBlock $block
@param CliRenderer $renderer
@return string | [
"@param",
"AbstractBlock",
"$block",
"@param",
"CliRenderer",
"$renderer"
] | train | https://github.com/AydinHassan/cli-md-renderer/blob/521f9ace2aeadd58bf8a3910704be8360f5bd7b2/src/Renderer/FencedCodeRenderer.php#L54-L73 |
phug-php/formatter | src/Phug/Formatter/Partial/PatternTrait.php | PatternTrait.setPattern | public function setPattern($name, $pattern)
{
if (is_array($pattern)) {
return $this->provideHelper($this->patternName($name), $pattern);
}
$this->registerHelper('patterns.'.$name, $pattern);
return $this->provideHelper($this->patternName($name), [
'pattern'... | php | public function setPattern($name, $pattern)
{
if (is_array($pattern)) {
return $this->provideHelper($this->patternName($name), $pattern);
}
$this->registerHelper('patterns.'.$name, $pattern);
return $this->provideHelper($this->patternName($name), [
'pattern'... | [
"public",
"function",
"setPattern",
"(",
"$",
"name",
",",
"$",
"pattern",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"pattern",
")",
")",
"{",
"return",
"$",
"this",
"->",
"provideHelper",
"(",
"$",
"this",
"->",
"patternName",
"(",
"$",
"name",
")"... | @param $name
@param $pattern
@return PatternTrait | [
"@param",
"$name",
"@param",
"$pattern"
] | train | https://github.com/phug-php/formatter/blob/3f9286a169a0d45b8b8acc1fae64e880ebdb567e/src/Phug/Formatter/Partial/PatternTrait.php#L30-L50 |
phug-php/formatter | src/Phug/Formatter/Partial/PatternTrait.php | PatternTrait.addPattern | public function addPattern($name, $pattern)
{
if (!$this->hasPattern($name)) {
$this->setPattern($name, $pattern);
}
return $this;
} | php | public function addPattern($name, $pattern)
{
if (!$this->hasPattern($name)) {
$this->setPattern($name, $pattern);
}
return $this;
} | [
"public",
"function",
"addPattern",
"(",
"$",
"name",
",",
"$",
"pattern",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasPattern",
"(",
"$",
"name",
")",
")",
"{",
"$",
"this",
"->",
"setPattern",
"(",
"$",
"name",
",",
"$",
"pattern",
")",
";... | @param $name
@param $pattern
@return PatternTrait | [
"@param",
"$name",
"@param",
"$pattern"
] | train | https://github.com/phug-php/formatter/blob/3f9286a169a0d45b8b8acc1fae64e880ebdb567e/src/Phug/Formatter/Partial/PatternTrait.php#L58-L65 |
phug-php/formatter | src/Phug/Formatter/Partial/PatternTrait.php | PatternTrait.addPatterns | public function addPatterns($patterns)
{
foreach ($patterns as $name => $pattern) {
$this->addPattern($name, $pattern);
}
return $this;
} | php | public function addPatterns($patterns)
{
foreach ($patterns as $name => $pattern) {
$this->addPattern($name, $pattern);
}
return $this;
} | [
"public",
"function",
"addPatterns",
"(",
"$",
"patterns",
")",
"{",
"foreach",
"(",
"$",
"patterns",
"as",
"$",
"name",
"=>",
"$",
"pattern",
")",
"{",
"$",
"this",
"->",
"addPattern",
"(",
"$",
"name",
",",
"$",
"pattern",
")",
";",
"}",
"return",
... | @param $patterns
@return $this | [
"@param",
"$patterns"
] | train | https://github.com/phug-php/formatter/blob/3f9286a169a0d45b8b8acc1fae64e880ebdb567e/src/Phug/Formatter/Partial/PatternTrait.php#L72-L79 |
phug-php/formatter | src/Phug/Formatter/Partial/PatternTrait.php | PatternTrait.setPatterns | public function setPatterns($patterns)
{
foreach ($patterns as $name => $pattern) {
$this->setPattern($name, $pattern);
}
return $this;
} | php | public function setPatterns($patterns)
{
foreach ($patterns as $name => $pattern) {
$this->setPattern($name, $pattern);
}
return $this;
} | [
"public",
"function",
"setPatterns",
"(",
"$",
"patterns",
")",
"{",
"foreach",
"(",
"$",
"patterns",
"as",
"$",
"name",
"=>",
"$",
"pattern",
")",
"{",
"$",
"this",
"->",
"setPattern",
"(",
"$",
"name",
",",
"$",
"pattern",
")",
";",
"}",
"return",
... | @param $patterns
@return $this | [
"@param",
"$patterns"
] | train | https://github.com/phug-php/formatter/blob/3f9286a169a0d45b8b8acc1fae64e880ebdb567e/src/Phug/Formatter/Partial/PatternTrait.php#L86-L93 |
phug-php/formatter | src/Phug/Formatter/Partial/PatternTrait.php | PatternTrait.exportHelper | public function exportHelper($name, array $arguments = null)
{
$this->requireHelper($name);
$code = $this->formatter->getDependencyStorage(
$this->helperName($name)
);
if (!is_null($arguments)) {
$code .= '('.implode(', ', $arguments).')';
}
... | php | public function exportHelper($name, array $arguments = null)
{
$this->requireHelper($name);
$code = $this->formatter->getDependencyStorage(
$this->helperName($name)
);
if (!is_null($arguments)) {
$code .= '('.implode(', ', $arguments).')';
}
... | [
"public",
"function",
"exportHelper",
"(",
"$",
"name",
",",
"array",
"$",
"arguments",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"requireHelper",
"(",
"$",
"name",
")",
";",
"$",
"code",
"=",
"$",
"this",
"->",
"formatter",
"->",
"getDependencyStorage",... | @param string $name
@param array $name
@return string | [
"@param",
"string",
"$name",
"@param",
"array",
"$name"
] | train | https://github.com/phug-php/formatter/blob/3f9286a169a0d45b8b8acc1fae64e880ebdb567e/src/Phug/Formatter/Partial/PatternTrait.php#L101-L113 |
webforge-labs/psc-cms | lib/Psc/Doctrine/EntityCollectionSynchronizer.php | EntityCollectionSynchronizer.init | public function init(Entity $entity) {
// check entity
if ($entity->getEntityName() !== ($class = $this->entityMeta->getClass())) {
throw new \InvalidArgumentException('Das übergebene Entity für diesen Synchronizer kann nur vom Typ: '.$class.' sein. Ein Entity des Typs '.$entity->getEntityName().' wurde ü... | php | public function init(Entity $entity) {
// check entity
if ($entity->getEntityName() !== ($class = $this->entityMeta->getClass())) {
throw new \InvalidArgumentException('Das übergebene Entity für diesen Synchronizer kann nur vom Typ: '.$class.' sein. Ein Entity des Typs '.$entity->getEntityName().' wurde ü... | [
"public",
"function",
"init",
"(",
"Entity",
"$",
"entity",
")",
"{",
"// check entity",
"if",
"(",
"$",
"entity",
"->",
"getEntityName",
"(",
")",
"!==",
"(",
"$",
"class",
"=",
"$",
"this",
"->",
"entityMeta",
"->",
"getClass",
"(",
")",
")",
")",
... | Initialisiert den Synchronizer mit dem $entity in dem $this->collectionName vorhanden ist
dies er gibt dann die fromCollection | [
"Initialisiert",
"den",
"Synchronizer",
"mit",
"dem",
"$entity",
"in",
"dem",
"$this",
"-",
">",
"collectionName",
"vorhanden",
"ist"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Doctrine/EntityCollectionSynchronizer.php#L52-L66 |
yuncms/framework | src/user/behaviors/LoginAttemptBehavior.php | LoginAttemptBehavior.getUserLoginAttempt | public function getUserLoginAttempt()
{
if (!$this->_attempt) {
$this->_attempt = new UserLoginAttempt;
$this->_attempt->key = $this->getKey();
}
return $this->_attempt;
} | php | public function getUserLoginAttempt()
{
if (!$this->_attempt) {
$this->_attempt = new UserLoginAttempt;
$this->_attempt->key = $this->getKey();
}
return $this->_attempt;
} | [
"public",
"function",
"getUserLoginAttempt",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_attempt",
")",
"{",
"$",
"this",
"->",
"_attempt",
"=",
"new",
"UserLoginAttempt",
";",
"$",
"this",
"->",
"_attempt",
"->",
"key",
"=",
"$",
"this",
"->",... | 获取拦截历史
@return UserLoginAttempt | [
"获取拦截历史"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/user/behaviors/LoginAttemptBehavior.php#L158-L165 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php | BaseCountryPeer.getFieldNames | public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, CountryPeer::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, Ba... | php | public static function getFieldNames($type = BasePeer::TYPE_PHPNAME)
{
if (!array_key_exists($type, CountryPeer::$fieldNames)) {
throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME, Ba... | [
"public",
"static",
"function",
"getFieldNames",
"(",
"$",
"type",
"=",
"BasePeer",
"::",
"TYPE_PHPNAME",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"type",
",",
"CountryPeer",
"::",
"$",
"fieldNames",
")",
")",
"{",
"throw",
"new",
"PropelExc... | Returns an array of field names.
@param string $type The type of fieldnames to return:
One of the class type constants BasePeer::TYPE_PHPNAME, BasePeer::TYPE_STUDLYPHPNAME
BasePeer::TYPE_COLNAME, BasePeer::TYPE_FIELDNAME, BasePeer::TYPE_NUM
@return array A list of field names
@throws PropelException - i... | [
"Returns",
"an",
"array",
"of",
"field",
"names",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php#L124-L131 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php | BaseCountryPeer.addSelectColumns | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(CountryPeer::ID);
$criteria->addSelectColumn(CountryPeer::CODE);
$criteria->addSelectColumn(CountryPeer::EN);
$criteria->addSelectCol... | php | public static function addSelectColumns(Criteria $criteria, $alias = null)
{
if (null === $alias) {
$criteria->addSelectColumn(CountryPeer::ID);
$criteria->addSelectColumn(CountryPeer::CODE);
$criteria->addSelectColumn(CountryPeer::EN);
$criteria->addSelectCol... | [
"public",
"static",
"function",
"addSelectColumns",
"(",
"Criteria",
"$",
"criteria",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"alias",
")",
"{",
"$",
"criteria",
"->",
"addSelectColumn",
"(",
"CountryPeer",
"::",
"ID",
")... | Add all the columns needed to create a new object.
Note: any columns that were marked with lazyLoad="true" in the
XML schema will not be added to the select list and only loaded
on demand.
@param Criteria $criteria object containing the columns to add.
@param string $alias optional table alias
@throws ... | [
"Add",
"all",
"the",
"columns",
"needed",
"to",
"create",
"a",
"new",
"object",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php#L162-L175 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php | BaseCountryPeer.removeInstanceFromPool | public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof Country) {
$key = (string) $value->getId();
} elseif (is_scalar($value)) {
// assume we've b... | php | public static function removeInstanceFromPool($value)
{
if (Propel::isInstancePoolingEnabled() && $value !== null) {
if (is_object($value) && $value instanceof Country) {
$key = (string) $value->getId();
} elseif (is_scalar($value)) {
// assume we've b... | [
"public",
"static",
"function",
"removeInstanceFromPool",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"Propel",
"::",
"isInstancePoolingEnabled",
"(",
")",
"&&",
"$",
"value",
"!==",
"null",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
"&&",
"$"... | Removes an object from the instance pool.
Propel keeps cached copies of objects in an instance pool when they are retrieved
from the database. In some cases -- especially when you override doDelete
methods in your stub classes -- you may need to explicitly remove objects
from the cache in order to prevent returning o... | [
"Removes",
"an",
"object",
"from",
"the",
"instance",
"pool",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php#L319-L334 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php | BaseCountryPeer.getInstanceFromPool | public static function getInstanceFromPool($key)
{
if (Propel::isInstancePoolingEnabled()) {
if (isset(CountryPeer::$instances[$key])) {
return CountryPeer::$instances[$key];
}
}
return null; // just to be explicit
} | php | public static function getInstanceFromPool($key)
{
if (Propel::isInstancePoolingEnabled()) {
if (isset(CountryPeer::$instances[$key])) {
return CountryPeer::$instances[$key];
}
}
return null; // just to be explicit
} | [
"public",
"static",
"function",
"getInstanceFromPool",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"Propel",
"::",
"isInstancePoolingEnabled",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"CountryPeer",
"::",
"$",
"instances",
"[",
"$",
"key",
"]",
")",
")",
... | Retrieves a string version of the primary key from the DB resultset row that can be used to uniquely identify a row in this table.
For tables with a single-column primary key, that simple pkey value will be returned. For tables with
a multi-column primary key, a serialize()d version of the primary key will be returne... | [
"Retrieves",
"a",
"string",
"version",
"of",
"the",
"primary",
"key",
"from",
"the",
"DB",
"resultset",
"row",
"that",
"can",
"be",
"used",
"to",
"uniquely",
"identify",
"a",
"row",
"in",
"this",
"table",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php#L346-L355 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php | BaseCountryPeer.populateObject | public static function populateObject($row, $startcol = 0)
{
$key = CountryPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CountryPeer::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.... | php | public static function populateObject($row, $startcol = 0)
{
$key = CountryPeer::getPrimaryKeyHashFromRow($row, $startcol);
if (null !== ($obj = CountryPeer::getInstanceFromPool($key))) {
// We no longer rehydrate the object, since this can cause data loss.
// See http://www.... | [
"public",
"static",
"function",
"populateObject",
"(",
"$",
"row",
",",
"$",
"startcol",
"=",
"0",
")",
"{",
"$",
"key",
"=",
"CountryPeer",
"::",
"getPrimaryKeyHashFromRow",
"(",
"$",
"row",
",",
"$",
"startcol",
")",
";",
"if",
"(",
"null",
"!==",
"(... | Populates an object of the default type or an object that inherit from the default.
@param array $row PropelPDO resultset row.
@param int $startcol The 0-based offset for reading from the resultset row.
@throws PropelException Any exceptions caught during processing will be
rethrown wrapped into a PropelExce... | [
"Populates",
"an",
"object",
"of",
"the",
"default",
"type",
"or",
"an",
"object",
"that",
"inherit",
"from",
"the",
"default",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php#L456-L472 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php | BaseCountryPeer.buildTableMap | public static function buildTableMap()
{
$dbMap = Propel::getDatabaseMap(BaseCountryPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCountryPeer::TABLE_NAME)) {
$dbMap->addTableObject(new \Slashworks\AppBundle\Model\map\CountryTableMap());
}
} | php | public static function buildTableMap()
{
$dbMap = Propel::getDatabaseMap(BaseCountryPeer::DATABASE_NAME);
if (!$dbMap->hasTable(BaseCountryPeer::TABLE_NAME)) {
$dbMap->addTableObject(new \Slashworks\AppBundle\Model\map\CountryTableMap());
}
} | [
"public",
"static",
"function",
"buildTableMap",
"(",
")",
"{",
"$",
"dbMap",
"=",
"Propel",
"::",
"getDatabaseMap",
"(",
"BaseCountryPeer",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"!",
"$",
"dbMap",
"->",
"hasTable",
"(",
"BaseCountryPeer",
"::",
"TABLE... | Add a TableMap instance to the database for this peer class. | [
"Add",
"a",
"TableMap",
"instance",
"to",
"the",
"database",
"for",
"this",
"peer",
"class",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCountryPeer.php#L489-L495 |
ClanCats/Core | src/classes/CCShipyard.php | CCShipyard.create | public static function create()
{
$arguments = func_get_args();
$name = array_shift( $arguments );
$class_name = "Core\\CCShipyard_".ucfirst( $name );
if ( !class_exists( $class_name ) )
{
throw new CCException( "CCShipyard - invalid builder (".$name.") given." );
}
$builder = new $class_n... | php | public static function create()
{
$arguments = func_get_args();
$name = array_shift( $arguments );
$class_name = "Core\\CCShipyard_".ucfirst( $name );
if ( !class_exists( $class_name ) )
{
throw new CCException( "CCShipyard - invalid builder (".$name.") given." );
}
$builder = new $class_n... | [
"public",
"static",
"function",
"create",
"(",
")",
"{",
"$",
"arguments",
"=",
"func_get_args",
"(",
")",
";",
"$",
"name",
"=",
"array_shift",
"(",
"$",
"arguments",
")",
";",
"$",
"class_name",
"=",
"\"Core\\\\CCShipyard_\"",
".",
"ucfirst",
"(",
"$",
... | Static call wrapper to require the right builder
@param string $name
@param array $arguments
@return CCShipyard_Builder | [
"Static",
"call",
"wrapper",
"to",
"require",
"the",
"right",
"builder"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCShipyard.php#L21-L39 |
picamator/CacheManager | src/Operation/Search.php | Search.search | public function search(SearchCriteriaInterface $searchCriteria) : SearchResultInterface
{
$cacheItemGenerator = $this->getCacheItemGenerator($searchCriteria);
$fieldList = $searchCriteria->getFieldList();
$data = [];
$missedData = [];
/** @var \Psr\Cache\CacheItemInterface ... | php | public function search(SearchCriteriaInterface $searchCriteria) : SearchResultInterface
{
$cacheItemGenerator = $this->getCacheItemGenerator($searchCriteria);
$fieldList = $searchCriteria->getFieldList();
$data = [];
$missedData = [];
/** @var \Psr\Cache\CacheItemInterface ... | [
"public",
"function",
"search",
"(",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
":",
"SearchResultInterface",
"{",
"$",
"cacheItemGenerator",
"=",
"$",
"this",
"->",
"getCacheItemGenerator",
"(",
"$",
"searchCriteria",
")",
";",
"$",
"fieldList",
"=",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/Operation/Search.php#L55-L74 |
picamator/CacheManager | src/Operation/Search.php | Search.hasValidCacheItem | private function hasValidCacheItem(CacheItemInterface $cacheItem, array $fieldList) : bool
{
$data = $cacheItem->get();
if (is_null($data)) {
return false;
}
$fieldDiff = array_diff($fieldList, array_keys($data));
return !$fieldDiff;
} | php | private function hasValidCacheItem(CacheItemInterface $cacheItem, array $fieldList) : bool
{
$data = $cacheItem->get();
if (is_null($data)) {
return false;
}
$fieldDiff = array_diff($fieldList, array_keys($data));
return !$fieldDiff;
} | [
"private",
"function",
"hasValidCacheItem",
"(",
"CacheItemInterface",
"$",
"cacheItem",
",",
"array",
"$",
"fieldList",
")",
":",
"bool",
"{",
"$",
"data",
"=",
"$",
"cacheItem",
"->",
"get",
"(",
")",
";",
"if",
"(",
"is_null",
"(",
"$",
"data",
")",
... | Has valid cache item.
@param CacheItemInterface $cacheItem
@param array $fieldList
@return bool | [
"Has",
"valid",
"cache",
"item",
"."
] | train | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/Operation/Search.php#L84-L94 |
picamator/CacheManager | src/Operation/Search.php | Search.getCacheItemGenerator | private function getCacheItemGenerator(SearchCriteriaInterface $searchCriteria)
{
try {
foreach ($searchCriteria->getIdList() as $item) {
$cacheKey = $this->keyGenerator->generate($item, $searchCriteria);
yield $item => $this->cacheItemPool->getItem($cacheKey);
... | php | private function getCacheItemGenerator(SearchCriteriaInterface $searchCriteria)
{
try {
foreach ($searchCriteria->getIdList() as $item) {
$cacheKey = $this->keyGenerator->generate($item, $searchCriteria);
yield $item => $this->cacheItemPool->getItem($cacheKey);
... | [
"private",
"function",
"getCacheItemGenerator",
"(",
"SearchCriteriaInterface",
"$",
"searchCriteria",
")",
"{",
"try",
"{",
"foreach",
"(",
"$",
"searchCriteria",
"->",
"getIdList",
"(",
")",
"as",
"$",
"item",
")",
"{",
"$",
"cacheKey",
"=",
"$",
"this",
"... | Retrieve cache data generator.
@param SearchCriteriaInterface $searchCriteria
@throws InvalidCacheKeyException
@return void | [
"Retrieve",
"cache",
"data",
"generator",
"."
] | train | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/Operation/Search.php#L105-L116 |
christianblos/markdown2html | src/Builder.php | Builder.build | public function build($src, $dest, Theme $theme)
{
$this->filesystem->purge($dest);
foreach ($theme->getCopyFiles() as $from => $to) {
$this->filesystem->copy($from, $dest . '/' . $to);
}
$treeItems = $this->parse(new SplFileInfo($src), $dest);
$theme->setTreeIt... | php | public function build($src, $dest, Theme $theme)
{
$this->filesystem->purge($dest);
foreach ($theme->getCopyFiles() as $from => $to) {
$this->filesystem->copy($from, $dest . '/' . $to);
}
$treeItems = $this->parse(new SplFileInfo($src), $dest);
$theme->setTreeIt... | [
"public",
"function",
"build",
"(",
"$",
"src",
",",
"$",
"dest",
",",
"Theme",
"$",
"theme",
")",
"{",
"$",
"this",
"->",
"filesystem",
"->",
"purge",
"(",
"$",
"dest",
")",
";",
"foreach",
"(",
"$",
"theme",
"->",
"getCopyFiles",
"(",
")",
"as",
... | @param string $src
@param string $dest
@param Theme $theme
@throws \RuntimeException | [
"@param",
"string",
"$src",
"@param",
"string",
"$dest",
"@param",
"Theme",
"$theme"
] | train | https://github.com/christianblos/markdown2html/blob/2ae1177d71fe313c802962dbb9226b5a90bbc65a/src/Builder.php#L37-L59 |
christianblos/markdown2html | src/Builder.php | Builder.parse | private function parse(SplFileInfo $src, $destDir, TreeItem $parent = null)
{
$files = $this->filesystem->getFilesOfDir($src->getPathname());
$items = [];
foreach ($files as $file) {
$item = new TreeItem();
if ($file->isDir()) {
$item->isDir = true;... | php | private function parse(SplFileInfo $src, $destDir, TreeItem $parent = null)
{
$files = $this->filesystem->getFilesOfDir($src->getPathname());
$items = [];
foreach ($files as $file) {
$item = new TreeItem();
if ($file->isDir()) {
$item->isDir = true;... | [
"private",
"function",
"parse",
"(",
"SplFileInfo",
"$",
"src",
",",
"$",
"destDir",
",",
"TreeItem",
"$",
"parent",
"=",
"null",
")",
"{",
"$",
"files",
"=",
"$",
"this",
"->",
"filesystem",
"->",
"getFilesOfDir",
"(",
"$",
"src",
"->",
"getPathname",
... | @param SplFileInfo $src
@param string $destDir
@param TreeItem $parent
@return TreeItem[] | [
"@param",
"SplFileInfo",
"$src",
"@param",
"string",
"$destDir",
"@param",
"TreeItem",
"$parent"
] | train | https://github.com/christianblos/markdown2html/blob/2ae1177d71fe313c802962dbb9226b5a90bbc65a/src/Builder.php#L68-L113 |
christianblos/markdown2html | src/Builder.php | Builder.exportFile | private function exportFile(TreeItem $item, Theme $theme)
{
if ($item->isAsset) {
$this->filesystem->copy($item->src, $item->dest);
return;
}
if ($item->isDir) {
foreach ($item->children as $child) {
$this->exportFile($child, $theme);
... | php | private function exportFile(TreeItem $item, Theme $theme)
{
if ($item->isAsset) {
$this->filesystem->copy($item->src, $item->dest);
return;
}
if ($item->isDir) {
foreach ($item->children as $child) {
$this->exportFile($child, $theme);
... | [
"private",
"function",
"exportFile",
"(",
"TreeItem",
"$",
"item",
",",
"Theme",
"$",
"theme",
")",
"{",
"if",
"(",
"$",
"item",
"->",
"isAsset",
")",
"{",
"$",
"this",
"->",
"filesystem",
"->",
"copy",
"(",
"$",
"item",
"->",
"src",
",",
"$",
"ite... | @param TreeItem $item
@param Theme $theme
@throws \RuntimeException | [
"@param",
"TreeItem",
"$item",
"@param",
"Theme",
"$theme"
] | train | https://github.com/christianblos/markdown2html/blob/2ae1177d71fe313c802962dbb9226b5a90bbc65a/src/Builder.php#L121-L163 |
cohesion/cohesion-core | src/Structure/Factory/UtilityFactory.php | UtilityFactory.get | public function get($class) {
if ($class instanceof ReflectionClass) {
$reflection = $class;
$class = $reflection->getName();
}
if (isset($this->utils[$class])) {
return $this->utils[$class];
}
if (!isset($reflection)) {
if (!class_... | php | public function get($class) {
if ($class instanceof ReflectionClass) {
$reflection = $class;
$class = $reflection->getName();
}
if (isset($this->utils[$class])) {
return $this->utils[$class];
}
if (!isset($reflection)) {
if (!class_... | [
"public",
"function",
"get",
"(",
"$",
"class",
")",
"{",
"if",
"(",
"$",
"class",
"instanceof",
"ReflectionClass",
")",
"{",
"$",
"reflection",
"=",
"$",
"class",
";",
"$",
"class",
"=",
"$",
"reflection",
"->",
"getName",
"(",
")",
";",
"}",
"if",
... | Get a utility class
@param mixed $class Either a string of the class name or an instance of a \ReflectionClass representing the utility to get
@return mixed The utility matching the given class
@throws InvalidClassException if either the utility class or the utility driver class doesn't exist
@throws MissingConfigurat... | [
"Get",
"a",
"utility",
"class"
] | train | https://github.com/cohesion/cohesion-core/blob/c6352aef7336e06285f0943da68235dc45523998/src/Structure/Factory/UtilityFactory.php#L25-L74 |
lmammino/e-foundation | src/Cart/Model/Cart.php | Cart.incrementExpiresAt | public function incrementExpiresAt(\DateInterval $interval = null)
{
if (null === $this->expiresAt) {
$this->expiresAt = new \DateTime();
}
if (null === $interval) {
$interval = new \DateInterval('PT3H');
}
$this->expiresAt->add($interval);
... | php | public function incrementExpiresAt(\DateInterval $interval = null)
{
if (null === $this->expiresAt) {
$this->expiresAt = new \DateTime();
}
if (null === $interval) {
$interval = new \DateInterval('PT3H');
}
$this->expiresAt->add($interval);
... | [
"public",
"function",
"incrementExpiresAt",
"(",
"\\",
"DateInterval",
"$",
"interval",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"expiresAt",
")",
"{",
"$",
"this",
"->",
"expiresAt",
"=",
"new",
"\\",
"DateTime",
"(",
")",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Cart/Model/Cart.php#L126-L139 |
lmammino/e-foundation | src/Cart/Model/Cart.php | Cart.isExpired | public function isExpired()
{
if (null === $this->expiresAt) {
return false;
}
$now = new \DateTime();
return $this->expiresAt < $now;
} | php | public function isExpired()
{
if (null === $this->expiresAt) {
return false;
}
$now = new \DateTime();
return $this->expiresAt < $now;
} | [
"public",
"function",
"isExpired",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"expiresAt",
")",
"{",
"return",
"false",
";",
"}",
"$",
"now",
"=",
"new",
"\\",
"DateTime",
"(",
")",
";",
"return",
"$",
"this",
"->",
"expiresAt",
"<... | Checks whether the cart is expired or not.
@return Boolean | [
"Checks",
"whether",
"the",
"cart",
"is",
"expired",
"or",
"not",
"."
] | train | https://github.com/lmammino/e-foundation/blob/198b7047d93eb11c9bc0c7ddf0bfa8229d42807a/src/Cart/Model/Cart.php#L146-L155 |
titon/db | src/Titon/Db/Query/BindingAware.php | BindingAware.addBinding | public function addBinding($field, $values) {
if (!is_array($values)) {
$values = [$values];
}
foreach ($values as $value) {
if ($value instanceof Predicate) {
$this->resolvePredicate($value);
} else if ($value instanceof SubQuery) {
... | php | public function addBinding($field, $values) {
if (!is_array($values)) {
$values = [$values];
}
foreach ($values as $value) {
if ($value instanceof Predicate) {
$this->resolvePredicate($value);
} else if ($value instanceof SubQuery) {
... | [
"public",
"function",
"addBinding",
"(",
"$",
"field",
",",
"$",
"values",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"values",
")",
")",
"{",
"$",
"values",
"=",
"[",
"$",
"values",
"]",
";",
"}",
"foreach",
"(",
"$",
"values",
"as",
"$",
... | Add a value to use in SQL parameter binding.
@param string $field
@param mixed $values
@return $this | [
"Add",
"a",
"value",
"to",
"use",
"in",
"SQL",
"parameter",
"binding",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/BindingAware.php#L32-L53 |
titon/db | src/Titon/Db/Query/BindingAware.php | BindingAware.resolvePredicate | public function resolvePredicate(Predicate $predicate) {
$this->_bindings = array_merge($this->_bindings, $predicate->getBindings());
return $this;
} | php | public function resolvePredicate(Predicate $predicate) {
$this->_bindings = array_merge($this->_bindings, $predicate->getBindings());
return $this;
} | [
"public",
"function",
"resolvePredicate",
"(",
"Predicate",
"$",
"predicate",
")",
"{",
"$",
"this",
"->",
"_bindings",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"_bindings",
",",
"$",
"predicate",
"->",
"getBindings",
"(",
")",
")",
";",
"return",
"$",
... | Merge an external predicates bindings with the current bindings.
@param \Titon\Db\Query\Predicate $predicate
@return $this | [
"Merge",
"an",
"external",
"predicates",
"bindings",
"with",
"the",
"current",
"bindings",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/BindingAware.php#L70-L74 |
titon/db | src/Titon/Db/Query/BindingAware.php | BindingAware.resolveSubQuery | public function resolveSubQuery(SubQuery $query) {
foreach ($query->getGroupedBindings() as $bindings) {
$this->_bindings = array_merge($this->_bindings, $bindings);
}
return $this;
} | php | public function resolveSubQuery(SubQuery $query) {
foreach ($query->getGroupedBindings() as $bindings) {
$this->_bindings = array_merge($this->_bindings, $bindings);
}
return $this;
} | [
"public",
"function",
"resolveSubQuery",
"(",
"SubQuery",
"$",
"query",
")",
"{",
"foreach",
"(",
"$",
"query",
"->",
"getGroupedBindings",
"(",
")",
"as",
"$",
"bindings",
")",
"{",
"$",
"this",
"->",
"_bindings",
"=",
"array_merge",
"(",
"$",
"this",
"... | Merge an external sub-queries bindings with the current bindings.
@param \Titon\Db\Query\SubQuery $query
@return $this | [
"Merge",
"an",
"external",
"sub",
"-",
"queries",
"bindings",
"with",
"the",
"current",
"bindings",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/BindingAware.php#L82-L88 |
simple-php-mvc/simple-php-mvc | src/MVC/Injection/Extension.php | Extension.getRootDirModule | public function getRootDirModule()
{
$r = new \ReflectionObject($this);
$injectionDir = str_replace('\\', '/', dirname($r->getFileName()));
return $injectionDir . '/..';
} | php | public function getRootDirModule()
{
$r = new \ReflectionObject($this);
$injectionDir = str_replace('\\', '/', dirname($r->getFileName()));
return $injectionDir . '/..';
} | [
"public",
"function",
"getRootDirModule",
"(",
")",
"{",
"$",
"r",
"=",
"new",
"\\",
"ReflectionObject",
"(",
"$",
"this",
")",
";",
"$",
"injectionDir",
"=",
"str_replace",
"(",
"'\\\\'",
",",
"'/'",
",",
"dirname",
"(",
"$",
"r",
"->",
"getFileName",
... | Get Root Dir Module
@return string Root Dir Module | [
"Get",
"Root",
"Dir",
"Module"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Injection/Extension.php#L74-L79 |
simple-php-mvc/simple-php-mvc | src/MVC/Injection/Extension.php | Extension.loadRoutes | public function loadRoutes()
{
$routesJsonFile = $this->configDir . '/routes.json';
$routesPhpFile = $this->configDir . '/routes.php';
if (file_exists($this->resourcesDir) && file_exists($this->configDir)) {
if (file_exists($routesJsonFile))
return json_d... | php | public function loadRoutes()
{
$routesJsonFile = $this->configDir . '/routes.json';
$routesPhpFile = $this->configDir . '/routes.php';
if (file_exists($this->resourcesDir) && file_exists($this->configDir)) {
if (file_exists($routesJsonFile))
return json_d... | [
"public",
"function",
"loadRoutes",
"(",
")",
"{",
"$",
"routesJsonFile",
"=",
"$",
"this",
"->",
"configDir",
".",
"'/routes.json'",
";",
"$",
"routesPhpFile",
"=",
"$",
"this",
"->",
"configDir",
".",
"'/routes.php'",
";",
"if",
"(",
"file_exists",
"(",
... | Load routes of the Module
@return array | [
"Load",
"routes",
"of",
"the",
"Module"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/Injection/Extension.php#L86-L99 |
miisieq/InfaktClient | src/Infakt/Mapper/ReverseMapperTrait.php | ReverseMapperTrait.reverseMapPrice | public function reverseMapPrice(?float $price): ?int
{
if (null === $price) {
return null;
}
if (0.00 === $price) {
return 0;
}
return (int) str_replace('.', '', number_format($price, 2, '.', ''));
} | php | public function reverseMapPrice(?float $price): ?int
{
if (null === $price) {
return null;
}
if (0.00 === $price) {
return 0;
}
return (int) str_replace('.', '', number_format($price, 2, '.', ''));
} | [
"public",
"function",
"reverseMapPrice",
"(",
"?",
"float",
"$",
"price",
")",
":",
"?",
"int",
"{",
"if",
"(",
"null",
"===",
"$",
"price",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"0.00",
"===",
"$",
"price",
")",
"{",
"return",
"0",
";... | Maps price to string.
@param float|null $price
@return int|null | [
"Maps",
"price",
"to",
"string",
"."
] | train | https://github.com/miisieq/InfaktClient/blob/5f0ae58c7be32580f3c92c2a7e7a7808d83d4e81/src/Infakt/Mapper/ReverseMapperTrait.php#L16-L27 |
CakeCMS/Core | src/Notify/Email.php | Email.send | public function send($subject, $content, $to, $fromName = '', $fromEmail = '')
{
$mail = new CakeEmail();
$fromName = ($fromName !== '') ? $fromName : $this->_fromName;
$fromEmail = ($fromEmail !== '') ? $fromEmail : $this->_fromEmail;
$transport = new MailTransport();
... | php | public function send($subject, $content, $to, $fromName = '', $fromEmail = '')
{
$mail = new CakeEmail();
$fromName = ($fromName !== '') ? $fromName : $this->_fromName;
$fromEmail = ($fromEmail !== '') ? $fromEmail : $this->_fromEmail;
$transport = new MailTransport();
... | [
"public",
"function",
"send",
"(",
"$",
"subject",
",",
"$",
"content",
",",
"$",
"to",
",",
"$",
"fromName",
"=",
"''",
",",
"$",
"fromEmail",
"=",
"''",
")",
"{",
"$",
"mail",
"=",
"new",
"CakeEmail",
"(",
")",
";",
"$",
"fromName",
"=",
"(",
... | Send message method.
@param string $subject
@param string $content
@param string|array $to
@param string $fromName
@param string $fromEmail
@return array | [
"Send",
"message",
"method",
"."
] | train | https://github.com/CakeCMS/Core/blob/f9cba7aa0043a10e5c35bd45fbad158688a09a96/src/Notify/Email.php#L95-L111 |
factorio-item-browser/export-data | src/Entity/Mod.php | Mod.setDependencies | public function setDependencies(array $dependencies)
{
$this->dependencies = array_values(array_filter($dependencies, function ($dependency): bool {
return $dependency instanceof Dependency;
}));
return $this;
} | php | public function setDependencies(array $dependencies)
{
$this->dependencies = array_values(array_filter($dependencies, function ($dependency): bool {
return $dependency instanceof Dependency;
}));
return $this;
} | [
"public",
"function",
"setDependencies",
"(",
"array",
"$",
"dependencies",
")",
"{",
"$",
"this",
"->",
"dependencies",
"=",
"array_values",
"(",
"array_filter",
"(",
"$",
"dependencies",
",",
"function",
"(",
"$",
"dependency",
")",
":",
"bool",
"{",
"retu... | Sets the dependencies of the mod.
@param array|Dependency[] $dependencies
@return $this Implementing fluent interface. | [
"Sets",
"the",
"dependencies",
"of",
"the",
"mod",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Mod.php#L258-L264 |
factorio-item-browser/export-data | src/Entity/Mod.php | Mod.writeData | public function writeData(): array
{
$dataBuilder = new DataBuilder();
$dataBuilder->setString('n', $this->name, '')
->setArray('t', $this->titles->writeData(), null, [])
->setArray('d', $this->descriptions->writeData(), null, [])
->setStri... | php | public function writeData(): array
{
$dataBuilder = new DataBuilder();
$dataBuilder->setString('n', $this->name, '')
->setArray('t', $this->titles->writeData(), null, [])
->setArray('d', $this->descriptions->writeData(), null, [])
->setStri... | [
"public",
"function",
"writeData",
"(",
")",
":",
"array",
"{",
"$",
"dataBuilder",
"=",
"new",
"DataBuilder",
"(",
")",
";",
"$",
"dataBuilder",
"->",
"setString",
"(",
"'n'",
",",
"$",
"this",
"->",
"name",
",",
"''",
")",
"->",
"setArray",
"(",
"'... | Writes the entity data to an array.
@return array | [
"Writes",
"the",
"entity",
"data",
"to",
"an",
"array",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Mod.php#L383-L401 |
factorio-item-browser/export-data | src/Entity/Mod.php | Mod.readData | public function readData(DataContainer $data)
{
$this->name = $data->getString('n', '');
$this->titles->readData($data->getObject('t'));
$this->descriptions->readData($data->getObject('d'));
$this->author = $data->getString('a', '');
$this->version = $data->getString('v', '')... | php | public function readData(DataContainer $data)
{
$this->name = $data->getString('n', '');
$this->titles->readData($data->getObject('t'));
$this->descriptions->readData($data->getObject('d'));
$this->author = $data->getString('a', '');
$this->version = $data->getString('v', '')... | [
"public",
"function",
"readData",
"(",
"DataContainer",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"name",
"=",
"$",
"data",
"->",
"getString",
"(",
"'n'",
",",
"''",
")",
";",
"$",
"this",
"->",
"titles",
"->",
"readData",
"(",
"$",
"data",
"->",
"... | Reads the entity data.
@param DataContainer $data
@return $this | [
"Reads",
"the",
"entity",
"data",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Mod.php#L408-L425 |
factorio-item-browser/export-data | src/Entity/Mod.php | Mod.calculateHash | public function calculateHash(): string
{
return EntityUtils::calculateHashOfArray([
$this->name,
$this->titles->calculateHash(),
$this->descriptions->calculateHash(),
$this->author,
$this->version,
$this->fileName,
$this->d... | php | public function calculateHash(): string
{
return EntityUtils::calculateHashOfArray([
$this->name,
$this->titles->calculateHash(),
$this->descriptions->calculateHash(),
$this->author,
$this->version,
$this->fileName,
$this->d... | [
"public",
"function",
"calculateHash",
"(",
")",
":",
"string",
"{",
"return",
"EntityUtils",
"::",
"calculateHashOfArray",
"(",
"[",
"$",
"this",
"->",
"name",
",",
"$",
"this",
"->",
"titles",
"->",
"calculateHash",
"(",
")",
",",
"$",
"this",
"->",
"d... | Calculates a hash value representing the entity.
@return string | [
"Calculates",
"a",
"hash",
"value",
"representing",
"the",
"entity",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Entity/Mod.php#L431-L448 |
xinix-technology/norm | src/Norm/Connection/BonoConnection.php | BonoConnection.restGet | public function restGet($cursor) {
if ($cursor instanceof Cursor) {
$name = $cursor->getCollection()->getName();
$criteria = $cursor->getCriteria();
$limit = $cursor->limit();
$skip = $cursor->skip();
$sorts = $cursor->sort();
$query = arr... | php | public function restGet($cursor) {
if ($cursor instanceof Cursor) {
$name = $cursor->getCollection()->getName();
$criteria = $cursor->getCriteria();
$limit = $cursor->limit();
$skip = $cursor->skip();
$sorts = $cursor->sort();
$query = arr... | [
"public",
"function",
"restGet",
"(",
"$",
"cursor",
")",
"{",
"if",
"(",
"$",
"cursor",
"instanceof",
"Cursor",
")",
"{",
"$",
"name",
"=",
"$",
"cursor",
"->",
"getCollection",
"(",
")",
"->",
"getName",
"(",
")",
";",
"$",
"criteria",
"=",
"$",
... | Get data from rest service.
@param \Norm\Cursor $cursor
@throws \Exception
@return array | [
"Get",
"data",
"from",
"rest",
"service",
"."
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection/BonoConnection.php#L52-L107 |
crypto-markets/common | src/Common/Gateway.php | Gateway.createRequest | public function createRequest($class, array $params = [])
{
$instance = new $class($this->getHttpClient());
return $instance->configure(array_replace($this->getOptions(), $params));
} | php | public function createRequest($class, array $params = [])
{
$instance = new $class($this->getHttpClient());
return $instance->configure(array_replace($this->getOptions(), $params));
} | [
"public",
"function",
"createRequest",
"(",
"$",
"class",
",",
"array",
"$",
"params",
"=",
"[",
"]",
")",
"{",
"$",
"instance",
"=",
"new",
"$",
"class",
"(",
"$",
"this",
"->",
"getHttpClient",
"(",
")",
")",
";",
"return",
"$",
"instance",
"->",
... | Create a new request object.
@param string $class
@param array $params
@return \CryptoMarkets\Common\Http\Request | [
"Create",
"a",
"new",
"request",
"object",
"."
] | train | https://github.com/crypto-markets/common/blob/206b1d9b88502d3fb73cef1323cd086156d3e633/src/Common/Gateway.php#L89-L94 |
picamator/CacheManager | src/Operation/Save.php | Save.save | public function save(SearchCriteriaInterface $searchCriteria, array $data) : bool
{
// validate
$idName = $searchCriteria->getIdName();
if (!$this->isValid($idName, $data)) {
throw new InvalidArgumentException(
sprintf('Invalid data "%s". Data should be array of e... | php | public function save(SearchCriteriaInterface $searchCriteria, array $data) : bool
{
// validate
$idName = $searchCriteria->getIdName();
if (!$this->isValid($idName, $data)) {
throw new InvalidArgumentException(
sprintf('Invalid data "%s". Data should be array of e... | [
"public",
"function",
"save",
"(",
"SearchCriteriaInterface",
"$",
"searchCriteria",
",",
"array",
"$",
"data",
")",
":",
"bool",
"{",
"// validate",
"$",
"idName",
"=",
"$",
"searchCriteria",
"->",
"getIdName",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/Operation/Save.php#L52-L71 |
picamator/CacheManager | src/Operation/Save.php | Save.isValid | private function isValid(string $idName, array $data)
{
foreach ($data as $item) {
if (!is_array($item) || !array_key_exists($idName, $item)) {
return false;
}
}
return true;
} | php | private function isValid(string $idName, array $data)
{
foreach ($data as $item) {
if (!is_array($item) || !array_key_exists($idName, $item)) {
return false;
}
}
return true;
} | [
"private",
"function",
"isValid",
"(",
"string",
"$",
"idName",
",",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"data",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"item",
")",
"||",
"!",
"array_key_exists",
"(",
"$... | Validate data structure: array of arrays with presented correct id.
@param string $idName
@param array $data
@return bool _true_ for valid and _false_ otherwise | [
"Validate",
"data",
"structure",
":",
"array",
"of",
"arrays",
"with",
"presented",
"correct",
"id",
"."
] | train | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/Operation/Save.php#L81-L90 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addInstallMacroblock | public function addInstallMacroblock($name, $file, $url)
{
$macroblockElement = new InstallMacroblock($name, $file, $url);
return $this->addElement($macroblockElement);
} | php | public function addInstallMacroblock($name, $file, $url)
{
$macroblockElement = new InstallMacroblock($name, $file, $url);
return $this->addElement($macroblockElement);
} | [
"public",
"function",
"addInstallMacroblock",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
"{",
"$",
"macroblockElement",
"=",
"new",
"InstallMacroblock",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
";",
"return",
"$",
"this"... | Install a Macroblock
@api
@param string $name Macroblock name
@param string $file Macroblock file
@param string $url Macroblock url
@return static | [
"Install",
"a",
"Macroblock"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L99-L103 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addInstallMap | public function addInstallMap($name, $url)
{
$mapElement = new InstallMap($name, $url);
return $this->addElement($mapElement);
} | php | public function addInstallMap($name, $url)
{
$mapElement = new InstallMap($name, $url);
return $this->addElement($mapElement);
} | [
"public",
"function",
"addInstallMap",
"(",
"$",
"name",
",",
"$",
"url",
")",
"{",
"$",
"mapElement",
"=",
"new",
"InstallMap",
"(",
"$",
"name",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
"addElement",
"(",
"$",
"mapElement",
")",
";",... | Install a map
@api
@param string $name Map name
@param string $url Map url
@return static | [
"Install",
"a",
"map"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L113-L117 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addPlayMap | public function addPlayMap($name, $url)
{
$mapElement = new PlayMap($name, $url);
return $this->addElement($mapElement);
} | php | public function addPlayMap($name, $url)
{
$mapElement = new PlayMap($name, $url);
return $this->addElement($mapElement);
} | [
"public",
"function",
"addPlayMap",
"(",
"$",
"name",
",",
"$",
"url",
")",
"{",
"$",
"mapElement",
"=",
"new",
"PlayMap",
"(",
"$",
"name",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
"addElement",
"(",
"$",
"mapElement",
")",
";",
"}"... | Play a map
@api
@param string $name Map name
@param string $url Map url
@return static | [
"Play",
"a",
"map"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L127-L131 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addInstallReplay | public function addInstallReplay($name, $url)
{
$replayElement = new InstallReplay($name, $url);
return $this->addElement($replayElement);
} | php | public function addInstallReplay($name, $url)
{
$replayElement = new InstallReplay($name, $url);
return $this->addElement($replayElement);
} | [
"public",
"function",
"addInstallReplay",
"(",
"$",
"name",
",",
"$",
"url",
")",
"{",
"$",
"replayElement",
"=",
"new",
"InstallReplay",
"(",
"$",
"name",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
"addElement",
"(",
"$",
"replayElement",
... | Install a replay
@api
@param string $name Replay name
@param string $url Replay url
@return static | [
"Install",
"a",
"replay"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L141-L145 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addViewReplay | public function addViewReplay($name, $url)
{
$replayElement = new ViewReplay($name, $url);
return $this->addElement($replayElement);
} | php | public function addViewReplay($name, $url)
{
$replayElement = new ViewReplay($name, $url);
return $this->addElement($replayElement);
} | [
"public",
"function",
"addViewReplay",
"(",
"$",
"name",
",",
"$",
"url",
")",
"{",
"$",
"replayElement",
"=",
"new",
"ViewReplay",
"(",
"$",
"name",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
"addElement",
"(",
"$",
"replayElement",
")",
... | View a replay
@api
@param string $name Replay name
@param string $url Replay url
@return static | [
"View",
"a",
"replay"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L155-L159 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addPlayReplay | public function addPlayReplay($name, $url)
{
$replayElement = new PlayReplay($name, $url);
return $this->addElement($replayElement);
} | php | public function addPlayReplay($name, $url)
{
$replayElement = new PlayReplay($name, $url);
return $this->addElement($replayElement);
} | [
"public",
"function",
"addPlayReplay",
"(",
"$",
"name",
",",
"$",
"url",
")",
"{",
"$",
"replayElement",
"=",
"new",
"PlayReplay",
"(",
"$",
"name",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
"addElement",
"(",
"$",
"replayElement",
")",
... | Play a replay
@api
@param string $name Replay name
@param string $url Replay url
@return static | [
"Play",
"a",
"replay"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L169-L173 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addInstallSkin | public function addInstallSkin($name, $file, $url)
{
$skinElement = new InstallSkin($name, $file, $url);
return $this->addElement($skinElement);
} | php | public function addInstallSkin($name, $file, $url)
{
$skinElement = new InstallSkin($name, $file, $url);
return $this->addElement($skinElement);
} | [
"public",
"function",
"addInstallSkin",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
"{",
"$",
"skinElement",
"=",
"new",
"InstallSkin",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
"addEl... | Install a skin
@api
@param string $name Skin name
@param string $file Skin file
@param string $url Skin url
@return static | [
"Install",
"a",
"skin"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L184-L188 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addGetSkin | public function addGetSkin($name, $file, $url)
{
$skinElement = new GetSkin($name, $file, $url);
return $this->addElement($skinElement);
} | php | public function addGetSkin($name, $file, $url)
{
$skinElement = new GetSkin($name, $file, $url);
return $this->addElement($skinElement);
} | [
"public",
"function",
"addGetSkin",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
"{",
"$",
"skinElement",
"=",
"new",
"GetSkin",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
"addElement",
... | Get a skin
@api
@param string $name Skin name
@param string $file Skin file
@param string $url Skin url
@return static | [
"Get",
"a",
"skin"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L199-L203 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addJoinServer | public function addJoinServer($loginOrIp = null, $port = null)
{
$serverElement = new JoinServer($loginOrIp, $port);
return $this->addElement($serverElement);
} | php | public function addJoinServer($loginOrIp = null, $port = null)
{
$serverElement = new JoinServer($loginOrIp, $port);
return $this->addElement($serverElement);
} | [
"public",
"function",
"addJoinServer",
"(",
"$",
"loginOrIp",
"=",
"null",
",",
"$",
"port",
"=",
"null",
")",
"{",
"$",
"serverElement",
"=",
"new",
"JoinServer",
"(",
"$",
"loginOrIp",
",",
"$",
"port",
")",
";",
"return",
"$",
"this",
"->",
"addElem... | Join a server
@api
@param string $loginOrIp (optional) Server login or ip
@param int $port (optional) Server port
@return static | [
"Join",
"a",
"server"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L239-L243 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addAddFavorite | public function addAddFavorite($loginOrIp = null, $port = null)
{
$favoriteElement = new AddFavorite($loginOrIp, $port);
return $this->addElement($favoriteElement);
} | php | public function addAddFavorite($loginOrIp = null, $port = null)
{
$favoriteElement = new AddFavorite($loginOrIp, $port);
return $this->addElement($favoriteElement);
} | [
"public",
"function",
"addAddFavorite",
"(",
"$",
"loginOrIp",
"=",
"null",
",",
"$",
"port",
"=",
"null",
")",
"{",
"$",
"favoriteElement",
"=",
"new",
"AddFavorite",
"(",
"$",
"loginOrIp",
",",
"$",
"port",
")",
";",
"return",
"$",
"this",
"->",
"add... | Add a server as favorite
@api
@param string $loginOrIp (optional) Server login or ip
@param int $port (optional) Server port
@return static | [
"Add",
"a",
"server",
"as",
"favorite"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L253-L257 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addInstallScript | public function addInstallScript($name, $file, $url)
{
$scriptElement = new InstallScript($name, $file, $url);
return $this->addElement($scriptElement);
} | php | public function addInstallScript($name, $file, $url)
{
$scriptElement = new InstallScript($name, $file, $url);
return $this->addElement($scriptElement);
} | [
"public",
"function",
"addInstallScript",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
"{",
"$",
"scriptElement",
"=",
"new",
"InstallScript",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
... | Install a script
@api
@param string $name Script name
@param string $file Script file
@param string $url Script url
@return static | [
"Install",
"a",
"script"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L268-L272 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addInstallPack | public function addInstallPack($name, $file, $url)
{
$packElement = new InstallPack($name, $file, $url);
return $this->addElement($packElement);
} | php | public function addInstallPack($name, $file, $url)
{
$packElement = new InstallPack($name, $file, $url);
return $this->addElement($packElement);
} | [
"public",
"function",
"addInstallPack",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
"{",
"$",
"packElement",
"=",
"new",
"InstallPack",
"(",
"$",
"name",
",",
"$",
"file",
",",
"$",
"url",
")",
";",
"return",
"$",
"this",
"->",
"addEl... | Install a title pack
@api
@param string $name Pack name
@param string $file Pack file
@param string $url Pack url
@return static | [
"Install",
"a",
"title",
"pack"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L283-L287 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.addElement | public function addElement(Element $element)
{
if (!in_array($element, $this->elements, true)) {
array_push($this->elements, $element);
}
return $this;
} | php | public function addElement(Element $element)
{
if (!in_array($element, $this->elements, true)) {
array_push($this->elements, $element);
}
return $this;
} | [
"public",
"function",
"addElement",
"(",
"Element",
"$",
"element",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"element",
",",
"$",
"this",
"->",
"elements",
",",
"true",
")",
")",
"{",
"array_push",
"(",
"$",
"this",
"->",
"elements",
",",
"$",... | Add a ManiaCode Element
@api
@param Element $element Element to add
@return static | [
"Add",
"a",
"ManiaCode",
"Element"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L307-L313 |
steeffeen/FancyManiaLinks | FML/ManiaCode.php | ManiaCode.render | public function render($echo = false)
{
$domDocument = new \DOMDocument("1.0", "utf-8");
$domDocument->xmlStandalone = true;
$domElement = $domDocument->createElement("maniacode");
$domDocument->appendChild($domElement);
if ($this->disableConfirmation) {
... | php | public function render($echo = false)
{
$domDocument = new \DOMDocument("1.0", "utf-8");
$domDocument->xmlStandalone = true;
$domElement = $domDocument->createElement("maniacode");
$domDocument->appendChild($domElement);
if ($this->disableConfirmation) {
... | [
"public",
"function",
"render",
"(",
"$",
"echo",
"=",
"false",
")",
"{",
"$",
"domDocument",
"=",
"new",
"\\",
"DOMDocument",
"(",
"\"1.0\"",
",",
"\"utf-8\"",
")",
";",
"$",
"domDocument",
"->",
"xmlStandalone",
"=",
"true",
";",
"$",
"domElement",
"="... | Render the ManiaCode
@api
@param bool $echo (optional) If the XML text should be echoed and the Content-Type header should be set
@return \DOMDocument | [
"Render",
"the",
"ManiaCode"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode.php#L362-L385 |
weew/url | src/Weew/Url/UrlParser.php | UrlParser.parse | public function parse($string) {
$segments = $this->parseSegments($string);
$segments = array_extend($segments, $this->parseHost(array_get($segments, 'host')));
return $this->replaceEmptyStringsWithNull($segments);
} | php | public function parse($string) {
$segments = $this->parseSegments($string);
$segments = array_extend($segments, $this->parseHost(array_get($segments, 'host')));
return $this->replaceEmptyStringsWithNull($segments);
} | [
"public",
"function",
"parse",
"(",
"$",
"string",
")",
"{",
"$",
"segments",
"=",
"$",
"this",
"->",
"parseSegments",
"(",
"$",
"string",
")",
";",
"$",
"segments",
"=",
"array_extend",
"(",
"$",
"segments",
",",
"$",
"this",
"->",
"parseHost",
"(",
... | @param $string
@return array | [
"@param",
"$string"
] | train | https://github.com/weew/url/blob/117be15e899cc343f22f04f5eb9e92e2164c56c1/src/Weew/Url/UrlParser.php#L11-L16 |
weew/url | src/Weew/Url/UrlParser.php | UrlParser.parseHost | public function parseHost($string) {
$segments = [
'tld' => null,
'domain' => null,
'subdomain' => null,
];
$parts = explode('.', $string);
if (count($parts) == 1) {
$segments['domain'] = $parts[0];
return $segments;
... | php | public function parseHost($string) {
$segments = [
'tld' => null,
'domain' => null,
'subdomain' => null,
];
$parts = explode('.', $string);
if (count($parts) == 1) {
$segments['domain'] = $parts[0];
return $segments;
... | [
"public",
"function",
"parseHost",
"(",
"$",
"string",
")",
"{",
"$",
"segments",
"=",
"[",
"'tld'",
"=>",
"null",
",",
"'domain'",
"=>",
"null",
",",
"'subdomain'",
"=>",
"null",
",",
"]",
";",
"$",
"parts",
"=",
"explode",
"(",
"'.'",
",",
"$",
"... | @param $string
@return array | [
"@param",
"$string"
] | train | https://github.com/weew/url/blob/117be15e899cc343f22f04f5eb9e92e2164c56c1/src/Weew/Url/UrlParser.php#L23-L51 |
weew/url | src/Weew/Url/UrlParser.php | UrlParser.parseSegments | protected function parseSegments($string) {
preg_match_all(
'/^' .
'((?P<protocol>.*):\/\/)?' .
'(' .
'(?P<username>.*?)' .
'(:(?P<password>.*?)' .
')@)?' .
'(?P<host>[^:\/\s]+)?' .
'(:(?P<port>\d*))?' .
... | php | protected function parseSegments($string) {
preg_match_all(
'/^' .
'((?P<protocol>.*):\/\/)?' .
'(' .
'(?P<username>.*?)' .
'(:(?P<password>.*?)' .
')@)?' .
'(?P<host>[^:\/\s]+)?' .
'(:(?P<port>\d*))?' .
... | [
"protected",
"function",
"parseSegments",
"(",
"$",
"string",
")",
"{",
"preg_match_all",
"(",
"'/^'",
".",
"'((?P<protocol>.*):\\/\\/)?'",
".",
"'('",
".",
"'(?P<username>.*?)'",
".",
"'(:(?P<password>.*?)'",
".",
"')@)?'",
".",
"'(?P<host>[^:\\/\\s]+)?'",
".",
"'(:(... | @param $string
@return array | [
"@param",
"$string"
] | train | https://github.com/weew/url/blob/117be15e899cc343f22f04f5eb9e92e2164c56c1/src/Weew/Url/UrlParser.php#L58-L92 |
Craftsware/scissor | src/Scissor.php | Scissor.run | public function run() {
$router = new Router($this);
// // Get Route
if($route = $router->map($this->app('Routes'))) {
if($route instanceof \Closure) {
$body = $route->bindTo($this)($this->request, $this->response);
}
// Set headers
... | php | public function run() {
$router = new Router($this);
// // Get Route
if($route = $router->map($this->app('Routes'))) {
if($route instanceof \Closure) {
$body = $route->bindTo($this)($this->request, $this->response);
}
// Set headers
... | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"router",
"=",
"new",
"Router",
"(",
"$",
"this",
")",
";",
"// // Get Route",
"if",
"(",
"$",
"route",
"=",
"$",
"router",
"->",
"map",
"(",
"$",
"this",
"->",
"app",
"(",
"'Routes'",
")",
")",
")... | Run the app | [
"Run",
"the",
"app"
] | train | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Scissor.php#L164-L191 |
Craftsware/scissor | src/Scissor.php | Scissor.render | public function render($name, $args = []) {
if(strstr($name, '::')) {
$name = explode('::', $name);
} else {
$name = [$name, strtolower($name)];
}
if($this->set('module[controller]', $name[0])) {
$module = $this->get('module');
... | php | public function render($name, $args = []) {
if(strstr($name, '::')) {
$name = explode('::', $name);
} else {
$name = [$name, strtolower($name)];
}
if($this->set('module[controller]', $name[0])) {
$module = $this->get('module');
... | [
"public",
"function",
"render",
"(",
"$",
"name",
",",
"$",
"args",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"strstr",
"(",
"$",
"name",
",",
"'::'",
")",
")",
"{",
"$",
"name",
"=",
"explode",
"(",
"'::'",
",",
"$",
"name",
")",
";",
"}",
"else",... | Render
@param string $name
@param array $args
@return string | [
"Render"
] | train | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Scissor.php#L202-L238 |
Craftsware/scissor | src/Scissor.php | Scissor.controller | private function controller($module, $controller, $injetion = null) {
// Check if exist
if(class_exists($namespace = 'App\\Modules\\' . ucfirst($module) . '\\Controllers\\' . $controller)) {
return (new $namespace($injetion));
}
} | php | private function controller($module, $controller, $injetion = null) {
// Check if exist
if(class_exists($namespace = 'App\\Modules\\' . ucfirst($module) . '\\Controllers\\' . $controller)) {
return (new $namespace($injetion));
}
} | [
"private",
"function",
"controller",
"(",
"$",
"module",
",",
"$",
"controller",
",",
"$",
"injetion",
"=",
"null",
")",
"{",
"// Check if exist",
"if",
"(",
"class_exists",
"(",
"$",
"namespace",
"=",
"'App\\\\Modules\\\\'",
".",
"ucfirst",
"(",
"$",
"modul... | Controller
@param string $module
@param object $injetion
@param array $controller
@return object $namespace | [
"Controller"
] | train | https://github.com/Craftsware/scissor/blob/644e4a8ea9859fc30fee36705e54784acd8d43e2/src/Scissor.php#L251-L258 |
spiral-modules/scaffolder | source/Scaffolder/Declarations/Database/DocumentDeclaration.php | DocumentDeclaration.normalizeDeclaration | public function normalizeDeclaration()
{
if (empty($this->getCollection())) {
$this->getConstants()->remove('COLLECTION');
}
if (empty($this->getDatabase())) {
$this->getConstants()->remove('DATABASE');
}
return $this;
} | php | public function normalizeDeclaration()
{
if (empty($this->getCollection())) {
$this->getConstants()->remove('COLLECTION');
}
if (empty($this->getDatabase())) {
$this->getConstants()->remove('DATABASE');
}
return $this;
} | [
"public",
"function",
"normalizeDeclaration",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"getCollection",
"(",
")",
")",
")",
"{",
"$",
"this",
"->",
"getConstants",
"(",
")",
"->",
"remove",
"(",
"'COLLECTION'",
")",
";",
"}",
"if",
... | Drop non required properties and methods
@return $this | [
"Drop",
"non",
"required",
"properties",
"and",
"methods"
] | train | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Declarations/Database/DocumentDeclaration.php#L62-L73 |
spiral-modules/scaffolder | source/Scaffolder/Declarations/Database/DocumentDeclaration.php | DocumentDeclaration.declareStructure | protected function declareStructure()
{
$this->constant('COLLECTION');
$this->constant('DATABASE');
parent::declareStructure();
$this->constant('DEFAULTS')->setValue([]);
$this->constant('INDEXES')->setValue([]);
} | php | protected function declareStructure()
{
$this->constant('COLLECTION');
$this->constant('DATABASE');
parent::declareStructure();
$this->constant('DEFAULTS')->setValue([]);
$this->constant('INDEXES')->setValue([]);
} | [
"protected",
"function",
"declareStructure",
"(",
")",
"{",
"$",
"this",
"->",
"constant",
"(",
"'COLLECTION'",
")",
";",
"$",
"this",
"->",
"constant",
"(",
"'DATABASE'",
")",
";",
"parent",
"::",
"declareStructure",
"(",
")",
";",
"$",
"this",
"->",
"c... | Declare record entity structure. | [
"Declare",
"record",
"entity",
"structure",
"."
] | train | https://github.com/spiral-modules/scaffolder/blob/9be9dd0da6e4b02232db24e797fe5c288afbbddf/source/Scaffolder/Declarations/Database/DocumentDeclaration.php#L78-L87 |
phug-php/formatter | src/Phug/Formatter/Format/XmlFormat.php | XmlFormat.yieldAssignmentElement | protected function yieldAssignmentElement(AssignmentElement $element)
{
foreach ($this->getOption('assignment_handlers') as $handler) {
$iterator = $handler($element) ?: [];
foreach ($iterator as $newElement) {
yield $newElement;
}
}
/* @v... | php | protected function yieldAssignmentElement(AssignmentElement $element)
{
foreach ($this->getOption('assignment_handlers') as $handler) {
$iterator = $handler($element) ?: [];
foreach ($iterator as $newElement) {
yield $newElement;
}
}
/* @v... | [
"protected",
"function",
"yieldAssignmentElement",
"(",
"AssignmentElement",
"$",
"element",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getOption",
"(",
"'assignment_handlers'",
")",
"as",
"$",
"handler",
")",
"{",
"$",
"iterator",
"=",
"$",
"handler",
"(",... | @param AssignmentElement $element
@throws \Phug\FormatterException
@return \Generator | [
"@param",
"AssignmentElement",
"$element"
] | train | https://github.com/phug-php/formatter/blob/3f9286a169a0d45b8b8acc1fae64e880ebdb567e/src/Phug/Formatter/Format/XmlFormat.php#L255-L300 |
helthe/Chronos | Crontab.php | Crontab.read | private function read($user = null)
{
$process = new Process($this->getCommand() . ' -l');
$process->run();
return $process->getOutput();
} | php | private function read($user = null)
{
$process = new Process($this->getCommand() . ' -l');
$process->run();
return $process->getOutput();
} | [
"private",
"function",
"read",
"(",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"process",
"=",
"new",
"Process",
"(",
"$",
"this",
"->",
"getCommand",
"(",
")",
".",
"' -l'",
")",
";",
"$",
"process",
"->",
"run",
"(",
")",
";",
"return",
"$",
"pro... | Reads the crontab file and returns the output. Default: current user.
@param string $user
@return string | [
"Reads",
"the",
"crontab",
"file",
"and",
"returns",
"the",
"output",
".",
"Default",
":",
"current",
"user",
"."
] | train | https://github.com/helthe/Chronos/blob/6c783c55c32b323550fc6f21cd644c2be82720b0/Crontab.php#L102-L109 |
helthe/Chronos | Crontab.php | Crontab.getCommand | private function getCommand($user = null)
{
$command = $this->executable;
if ($user) {
$command .= ' -u' . $user;
}
return $command;
} | php | private function getCommand($user = null)
{
$command = $this->executable;
if ($user) {
$command .= ' -u' . $user;
}
return $command;
} | [
"private",
"function",
"getCommand",
"(",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"command",
"=",
"$",
"this",
"->",
"executable",
";",
"if",
"(",
"$",
"user",
")",
"{",
"$",
"command",
".=",
"' -u'",
".",
"$",
"user",
";",
"}",
"return",
"$",
"... | Get the base crontab command. Default: current user.
@param string $user
@return string | [
"Get",
"the",
"base",
"crontab",
"command",
".",
"Default",
":",
"current",
"user",
"."
] | train | https://github.com/helthe/Chronos/blob/6c783c55c32b323550fc6f21cd644c2be82720b0/Crontab.php#L118-L127 |
helthe/Chronos | Crontab.php | Crontab.render | private function render()
{
$output = '';
foreach ($this->jobs as $job) {
$output .= $this->getTaskDefinition($job);
}
return $output;
} | php | private function render()
{
$output = '';
foreach ($this->jobs as $job) {
$output .= $this->getTaskDefinition($job);
}
return $output;
} | [
"private",
"function",
"render",
"(",
")",
"{",
"$",
"output",
"=",
"''",
";",
"foreach",
"(",
"$",
"this",
"->",
"jobs",
"as",
"$",
"job",
")",
"{",
"$",
"output",
".=",
"$",
"this",
"->",
"getTaskDefinition",
"(",
"$",
"job",
")",
";",
"}",
"re... | Render all the cron jobs.
@return string | [
"Render",
"all",
"the",
"cron",
"jobs",
"."
] | train | https://github.com/helthe/Chronos/blob/6c783c55c32b323550fc6f21cd644c2be82720b0/Crontab.php#L166-L175 |
helthe/Chronos | Crontab.php | Crontab.write | private function write($content, $user = null)
{
$crontab = $this->read($user);
$header = $this->getHeaderComment();
$footer = $this->getFooterComment();
$content = $header . PHP_EOL . $content . $footer;
$hasHeader = preg_match("/^$header\s*$/m", $crontab) === 1;
$ha... | php | private function write($content, $user = null)
{
$crontab = $this->read($user);
$header = $this->getHeaderComment();
$footer = $this->getFooterComment();
$content = $header . PHP_EOL . $content . $footer;
$hasHeader = preg_match("/^$header\s*$/m", $crontab) === 1;
$ha... | [
"private",
"function",
"write",
"(",
"$",
"content",
",",
"$",
"user",
"=",
"null",
")",
"{",
"$",
"crontab",
"=",
"$",
"this",
"->",
"read",
"(",
"$",
"user",
")",
";",
"$",
"header",
"=",
"$",
"this",
"->",
"getHeaderComment",
"(",
")",
";",
"$... | Writes the crontab into the system for the given user. Default: current user.
@param string $content
@param string $user
@return integer
@throws InvalidIdentifierException
@throws RuntimeException | [
"Writes",
"the",
"crontab",
"into",
"the",
"system",
"for",
"the",
"given",
"user",
".",
"Default",
":",
"current",
"user",
"."
] | train | https://github.com/helthe/Chronos/blob/6c783c55c32b323550fc6f21cd644c2be82720b0/Crontab.php#L188-L218 |
joomlatools/joomlatools-platform-legacy | code/base/observable.php | JObservable.attach | public function attach($observer)
{
if (is_array($observer))
{
if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler']))
{
return;
}
// Make sure we haven't already attached this array as an observer
foreach ($this->_observers as $check)
{
if (... | php | public function attach($observer)
{
if (is_array($observer))
{
if (!isset($observer['handler']) || !isset($observer['event']) || !is_callable($observer['handler']))
{
return;
}
// Make sure we haven't already attached this array as an observer
foreach ($this->_observers as $check)
{
if (... | [
"public",
"function",
"attach",
"(",
"$",
"observer",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"observer",
")",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"observer",
"[",
"'handler'",
"]",
")",
"||",
"!",
"isset",
"(",
"$",
"observer",
"[",
... | Attach an observer object
@param object $observer An observer object to attach
@return void
@since 11.1
@deprecated 12.3 | [
"Attach",
"an",
"observer",
"object"
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/observable.php#L102-L159 |
joomlatools/joomlatools-platform-legacy | code/base/observable.php | JObservable.detach | public function detach($observer)
{
$retval = false;
$key = array_search($observer, $this->_observers);
if ($key !== false)
{
unset($this->_observers[$key]);
$retval = true;
foreach ($this->_methods as &$method)
{
$k = array_search($key, $method);
if ($k !== false)
{
unset($met... | php | public function detach($observer)
{
$retval = false;
$key = array_search($observer, $this->_observers);
if ($key !== false)
{
unset($this->_observers[$key]);
$retval = true;
foreach ($this->_methods as &$method)
{
$k = array_search($key, $method);
if ($k !== false)
{
unset($met... | [
"public",
"function",
"detach",
"(",
"$",
"observer",
")",
"{",
"$",
"retval",
"=",
"false",
";",
"$",
"key",
"=",
"array_search",
"(",
"$",
"observer",
",",
"$",
"this",
"->",
"_observers",
")",
";",
"if",
"(",
"$",
"key",
"!==",
"false",
")",
"{"... | Detach an observer object
@param object $observer An observer object to detach.
@return boolean True if the observer object was detached.
@since 11.1
@deprecated 12.3 | [
"Detach",
"an",
"observer",
"object"
] | train | https://github.com/joomlatools/joomlatools-platform-legacy/blob/3a76944e2f2c415faa6504754c75321a3b478c06/code/base/observable.php#L171-L194 |
ClanCats/Core | src/bundles/UI/E.php | E.attr | public static function attr( $attr = array() ) {
$buffer = " ";
foreach( $attr as $key => $value ) {
$buffer .= $key.'="'.$value.'" ';
}
return substr( $buffer, 0, -1 );
} | php | public static function attr( $attr = array() ) {
$buffer = " ";
foreach( $attr as $key => $value ) {
$buffer .= $key.'="'.$value.'" ';
}
return substr( $buffer, 0, -1 );
} | [
"public",
"static",
"function",
"attr",
"(",
"$",
"attr",
"=",
"array",
"(",
")",
")",
"{",
"$",
"buffer",
"=",
"\" \"",
";",
"foreach",
"(",
"$",
"attr",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"buffer",
".=",
"$",
"key",
".",
"'=... | generates element attribute string
@param array $attr | [
"generates",
"element",
"attribute",
"string"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/E.php#L44-L51 |
ClanCats/Core | src/bundles/UI/E.php | E.set_attr | public function set_attr( $attribute, $value = null ) {
if ( is_null( $value ) || $value === false ) {
if ( array_key_exists( $attribute, $this->attr ) ) {
unset( $this->attr[$attribute] );
}
} else {
if ( $value === true ) {
$value = $attribute;
}
$this->attr[ $attribute ] = $value;
}
... | php | public function set_attr( $attribute, $value = null ) {
if ( is_null( $value ) || $value === false ) {
if ( array_key_exists( $attribute, $this->attr ) ) {
unset( $this->attr[$attribute] );
}
} else {
if ( $value === true ) {
$value = $attribute;
}
$this->attr[ $attribute ] = $value;
}
... | [
"public",
"function",
"set_attr",
"(",
"$",
"attribute",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
"||",
"$",
"value",
"===",
"false",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"attribute",
",",
... | Set an attribute
@param string $attribute
@param mixed $value
@return $this | [
"Set",
"an",
"attribute"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/E.php#L103-L116 |
ClanCats/Core | src/bundles/UI/E.php | E.render | public function render() {
// execute callback if we have one first
if ( is_closure( $this->value ) ) {
ob_start(); $return = call_user_func( $this->value ); $this->value = ob_get_clean().$return;
}
return '<'.$this->name.static::attr( $this->attr ).
( !is_null( $this->value ) ? '>'.$this->value.'</'.$thi... | php | public function render() {
// execute callback if we have one first
if ( is_closure( $this->value ) ) {
ob_start(); $return = call_user_func( $this->value ); $this->value = ob_get_clean().$return;
}
return '<'.$this->name.static::attr( $this->attr ).
( !is_null( $this->value ) ? '>'.$this->value.'</'.$thi... | [
"public",
"function",
"render",
"(",
")",
"{",
"// execute callback if we have one first",
"if",
"(",
"is_closure",
"(",
"$",
"this",
"->",
"value",
")",
")",
"{",
"ob_start",
"(",
")",
";",
"$",
"return",
"=",
"call_user_func",
"(",
"$",
"this",
"->",
"va... | render this element
@return string | [
"render",
"this",
"element"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/bundles/UI/E.php#L143-L150 |
factorio-item-browser/export-data | src/Registry/Adapter/FileSystemAdapter.php | FileSystemAdapter.save | public function save(string $namespace, string $hash, string $content): void
{
$fileName = $this->getFileName($namespace, $hash);
$this->ensureDirectory(dirname($fileName));
$success = false;
if (!file_exists($fileName) || is_writable($fileName)) {
$success = file_put_co... | php | public function save(string $namespace, string $hash, string $content): void
{
$fileName = $this->getFileName($namespace, $hash);
$this->ensureDirectory(dirname($fileName));
$success = false;
if (!file_exists($fileName) || is_writable($fileName)) {
$success = file_put_co... | [
"public",
"function",
"save",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"hash",
",",
"string",
"$",
"content",
")",
":",
"void",
"{",
"$",
"fileName",
"=",
"$",
"this",
"->",
"getFileName",
"(",
"$",
"namespace",
",",
"$",
"hash",
")",
";"... | Saves the content under the specified hash.
@param string $namespace
@param string $hash
@param string $content
@return void
@throws ExportDataException | [
"Saves",
"the",
"content",
"under",
"the",
"specified",
"hash",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/Adapter/FileSystemAdapter.php#L43-L55 |
factorio-item-browser/export-data | src/Registry/Adapter/FileSystemAdapter.php | FileSystemAdapter.load | public function load(string $namespace, string $hash): ?string
{
$result = null;
$fileName = $this->getFileName($namespace, $hash);
if (file_exists($fileName) && is_readable($fileName)) {
$result = file_get_contents($fileName);
}
return is_string($result) ? $resul... | php | public function load(string $namespace, string $hash): ?string
{
$result = null;
$fileName = $this->getFileName($namespace, $hash);
if (file_exists($fileName) && is_readable($fileName)) {
$result = file_get_contents($fileName);
}
return is_string($result) ? $resul... | [
"public",
"function",
"load",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"hash",
")",
":",
"?",
"string",
"{",
"$",
"result",
"=",
"null",
";",
"$",
"fileName",
"=",
"$",
"this",
"->",
"getFileName",
"(",
"$",
"namespace",
",",
"$",
"hash",... | Loads and returns the content of the specified hash, if available.
@param string $namespace
@param string $hash
@return string|null | [
"Loads",
"and",
"returns",
"the",
"content",
"of",
"the",
"specified",
"hash",
"if",
"available",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/Adapter/FileSystemAdapter.php#L63-L71 |
factorio-item-browser/export-data | src/Registry/Adapter/FileSystemAdapter.php | FileSystemAdapter.delete | public function delete(string $namespace, string $hash): void
{
$fileName = $this->getFileName($namespace, $hash);
if (file_exists($fileName)) {
unlink($fileName);
}
} | php | public function delete(string $namespace, string $hash): void
{
$fileName = $this->getFileName($namespace, $hash);
if (file_exists($fileName)) {
unlink($fileName);
}
} | [
"public",
"function",
"delete",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"hash",
")",
":",
"void",
"{",
"$",
"fileName",
"=",
"$",
"this",
"->",
"getFileName",
"(",
"$",
"namespace",
",",
"$",
"hash",
")",
";",
"if",
"(",
"file_exists",
"... | Deletes the content under the specified hash.
@param string $namespace
@param string $hash | [
"Deletes",
"the",
"content",
"under",
"the",
"specified",
"hash",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/Adapter/FileSystemAdapter.php#L78-L84 |
factorio-item-browser/export-data | src/Registry/Adapter/FileSystemAdapter.php | FileSystemAdapter.getFileName | protected function getFileName(string $namespace, string $hash): string
{
$fileName = implode(DIRECTORY_SEPARATOR, [
$this->directory,
$namespace,
substr($hash, 0, 2),
$hash
]);
return $fileName;
} | php | protected function getFileName(string $namespace, string $hash): string
{
$fileName = implode(DIRECTORY_SEPARATOR, [
$this->directory,
$namespace,
substr($hash, 0, 2),
$hash
]);
return $fileName;
} | [
"protected",
"function",
"getFileName",
"(",
"string",
"$",
"namespace",
",",
"string",
"$",
"hash",
")",
":",
"string",
"{",
"$",
"fileName",
"=",
"implode",
"(",
"DIRECTORY_SEPARATOR",
",",
"[",
"$",
"this",
"->",
"directory",
",",
"$",
"namespace",
",",... | Returns the filename to use to save the content with the specified namespace and hash.
@param string $namespace
@param string $hash
@return string | [
"Returns",
"the",
"filename",
"to",
"use",
"to",
"save",
"the",
"content",
"with",
"the",
"specified",
"namespace",
"and",
"hash",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/Adapter/FileSystemAdapter.php#L92-L101 |
factorio-item-browser/export-data | src/Registry/Adapter/FileSystemAdapter.php | FileSystemAdapter.ensureDirectory | protected function ensureDirectory(string $directory): void
{
if (!is_dir($directory)) {
$success = @mkdir($directory, 0775, true);
if (!$success && !is_dir($directory)) {
throw new ExportDataException('Unable to create directory ' . $directory . '.');
}
... | php | protected function ensureDirectory(string $directory): void
{
if (!is_dir($directory)) {
$success = @mkdir($directory, 0775, true);
if (!$success && !is_dir($directory)) {
throw new ExportDataException('Unable to create directory ' . $directory . '.');
}
... | [
"protected",
"function",
"ensureDirectory",
"(",
"string",
"$",
"directory",
")",
":",
"void",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"$",
"success",
"=",
"@",
"mkdir",
"(",
"$",
"directory",
",",
"0775",
",",
"true",
")... | Ensures that the specified directory is available and writable.
@param string $directory
@throws ExportDataException | [
"Ensures",
"that",
"the",
"specified",
"directory",
"is",
"available",
"and",
"writable",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/Adapter/FileSystemAdapter.php#L108-L120 |
factorio-item-browser/export-data | src/Registry/Adapter/FileSystemAdapter.php | FileSystemAdapter.getAllHashes | public function getAllHashes(string $namespace): array
{
$directory = implode(DIRECTORY_SEPARATOR, [
$this->directory,
$namespace,
]);
$result = [];
if (is_dir($directory)) {
$directoryIterator = new RecursiveDirectoryIterator(
$di... | php | public function getAllHashes(string $namespace): array
{
$directory = implode(DIRECTORY_SEPARATOR, [
$this->directory,
$namespace,
]);
$result = [];
if (is_dir($directory)) {
$directoryIterator = new RecursiveDirectoryIterator(
$di... | [
"public",
"function",
"getAllHashes",
"(",
"string",
"$",
"namespace",
")",
":",
"array",
"{",
"$",
"directory",
"=",
"implode",
"(",
"DIRECTORY_SEPARATOR",
",",
"[",
"$",
"this",
"->",
"directory",
",",
"$",
"namespace",
",",
"]",
")",
";",
"$",
"result... | Returns all hashes currently known to the adapter.
@param string $namespace
@return array|string[] | [
"Returns",
"all",
"hashes",
"currently",
"known",
"to",
"the",
"adapter",
"."
] | train | https://github.com/factorio-item-browser/export-data/blob/1413b2eed0fbfed0521457ac7ef0d668ac30c212/src/Registry/Adapter/FileSystemAdapter.php#L127-L147 |
simple-php-mvc/simple-php-mvc | src/MVC/DataBase/Model.php | Model.getInstance | public static function getInstance(PDO $pdo, $table)
{
if (!self::$instance) {
self::$instance = new self($pdo, $table);
}
return self::$instance;
} | php | public static function getInstance(PDO $pdo, $table)
{
if (!self::$instance) {
self::$instance = new self($pdo, $table);
}
return self::$instance;
} | [
"public",
"static",
"function",
"getInstance",
"(",
"PDO",
"$",
"pdo",
",",
"$",
"table",
")",
"{",
"if",
"(",
"!",
"self",
"::",
"$",
"instance",
")",
"{",
"self",
"::",
"$",
"instance",
"=",
"new",
"self",
"(",
"$",
"pdo",
",",
"$",
"table",
")... | Get the instance
@access public
@param PDO $pdo
@param string $table
@return Model | [
"Get",
"the",
"instance"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/DataBase/Model.php#L56-L62 |
simple-php-mvc/simple-php-mvc | src/MVC/DataBase/Model.php | Model.delete | protected function delete(array $criteria = array())
{
$conditions = array();
foreach ($criteria as $field => $value) {
$conditions[] = "$field = ?";
}
$sql = "DELETE FROM $this->_table WHERE " . implode(' AND ', $conditions);
$pdos = $t... | php | protected function delete(array $criteria = array())
{
$conditions = array();
foreach ($criteria as $field => $value) {
$conditions[] = "$field = ?";
}
$sql = "DELETE FROM $this->_table WHERE " . implode(' AND ', $conditions);
$pdos = $t... | [
"protected",
"function",
"delete",
"(",
"array",
"$",
"criteria",
"=",
"array",
"(",
")",
")",
"{",
"$",
"conditions",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"criteria",
"as",
"$",
"field",
"=>",
"$",
"value",
")",
"{",
"$",
"conditions",
... | Function SQL DELETE
@access protected
@param array $criteria
@return int | [
"Function",
"SQL",
"DELETE"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/DataBase/Model.php#L81-L96 |
simple-php-mvc/simple-php-mvc | src/MVC/DataBase/Model.php | Model.insert | protected function insert(array $data = array())
{
$fields = array();
$values = array();
foreach ($data as $field => $value) {
$fields[] = $field;
$values[] = '?';
}
$sql = "INSERT INTO $this->_table "
. "(" . implode... | php | protected function insert(array $data = array())
{
$fields = array();
$values = array();
foreach ($data as $field => $value) {
$fields[] = $field;
$values[] = '?';
}
$sql = "INSERT INTO $this->_table "
. "(" . implode... | [
"protected",
"function",
"insert",
"(",
"array",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"$",
"fields",
"=",
"array",
"(",
")",
";",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"field",
"=>",
"$",
... | Function SQL INSERT
@access protected
@param array $data
@return int | [
"Function",
"SQL",
"INSERT"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/DataBase/Model.php#L104-L123 |
simple-php-mvc/simple-php-mvc | src/MVC/DataBase/Model.php | Model.select | protected function select(array $fields, array $criteria = array(), array $operators = array(), array $conditions = array())
{
$sql = "";
$stringConditions = array();
if ((!empty($criteria) && !empty($operators)) && !empty($conditions)) {
if ((count($criteria) == count($... | php | protected function select(array $fields, array $criteria = array(), array $operators = array(), array $conditions = array())
{
$sql = "";
$stringConditions = array();
if ((!empty($criteria) && !empty($operators)) && !empty($conditions)) {
if ((count($criteria) == count($... | [
"protected",
"function",
"select",
"(",
"array",
"$",
"fields",
",",
"array",
"$",
"criteria",
"=",
"array",
"(",
")",
",",
"array",
"$",
"operators",
"=",
"array",
"(",
")",
",",
"array",
"$",
"conditions",
"=",
"array",
"(",
")",
")",
"{",
"$",
"... | Function SQL SELECT
@access protected
@param array $fields
@param array $criteria
@param array $operators
@param array $conditions
@return array
@throws \Exception | [
"Function",
"SQL",
"SELECT"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/DataBase/Model.php#L135-L185 |
simple-php-mvc/simple-php-mvc | src/MVC/DataBase/Model.php | Model.update | protected function update(array $data = array(), array $criteria)
{
$set = array();
foreach ($data as $columnName => $value) {
$set[] = "$columnName = ?";
}
$params = array_merge(array_values($data), array_values($criteria));
$sql = "UPDATE $this... | php | protected function update(array $data = array(), array $criteria)
{
$set = array();
foreach ($data as $columnName => $value) {
$set[] = "$columnName = ?";
}
$params = array_merge(array_values($data), array_values($criteria));
$sql = "UPDATE $this... | [
"protected",
"function",
"update",
"(",
"array",
"$",
"data",
"=",
"array",
"(",
")",
",",
"array",
"$",
"criteria",
")",
"{",
"$",
"set",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"columnName",
"=>",
"$",
"value",
")",
... | Function SQL UPDATE
@access protected
@param array $data
@param array $criteria
@return int | [
"Function",
"SQL",
"UPDATE"
] | train | https://github.com/simple-php-mvc/simple-php-mvc/blob/e319eb09d29afad6993acb4a7e35f32a87dd0841/src/MVC/DataBase/Model.php#L194-L211 |
picamator/CacheManager | src/Data/SearchResult.php | SearchResult.hasData | public function hasData() : bool
{
if (is_null($this->hasData)) {
$this->hasData = count($this->data) > 0;
}
return $this->hasData;
} | php | public function hasData() : bool
{
if (is_null($this->hasData)) {
$this->hasData = count($this->data) > 0;
}
return $this->hasData;
} | [
"public",
"function",
"hasData",
"(",
")",
":",
"bool",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"hasData",
")",
")",
"{",
"$",
"this",
"->",
"hasData",
"=",
"count",
"(",
"$",
"this",
"->",
"data",
")",
">",
"0",
";",
"}",
"return",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/Data/SearchResult.php#L67-L74 |
picamator/CacheManager | src/Data/SearchResult.php | SearchResult.count | public function count() : int
{
if (is_null($this->count)) {
$this->count = count($this->data);
}
return $this->count;
} | php | public function count() : int
{
if (is_null($this->count)) {
$this->count = count($this->data);
}
return $this->count;
} | [
"public",
"function",
"count",
"(",
")",
":",
"int",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"count",
")",
")",
"{",
"$",
"this",
"->",
"count",
"=",
"count",
"(",
"$",
"this",
"->",
"data",
")",
";",
"}",
"return",
"$",
"this",
"->"... | {@inheritdoc} | [
"{"
] | train | https://github.com/picamator/CacheManager/blob/5e5493910610b65ae31a362786d7963ba3e33806/src/Data/SearchResult.php#L79-L86 |
xinix-technology/norm | src/Norm/Connection/FlatFileConnection.php | FlatFileConnection.prepareDatabaseEcosystem | protected function prepareDatabaseEcosystem()
{
$basePath = realpath('../');
$dbPath = $basePath.'/'.$this->options['dbPath'].'/'.$this->options['database'];
if (! is_dir($dbPath)) {
mkdir($dbPath, 0755, true);
}
$this->dbPath = realpath($dbPath);
} | php | protected function prepareDatabaseEcosystem()
{
$basePath = realpath('../');
$dbPath = $basePath.'/'.$this->options['dbPath'].'/'.$this->options['database'];
if (! is_dir($dbPath)) {
mkdir($dbPath, 0755, true);
}
$this->dbPath = realpath($dbPath);
} | [
"protected",
"function",
"prepareDatabaseEcosystem",
"(",
")",
"{",
"$",
"basePath",
"=",
"realpath",
"(",
"'../'",
")",
";",
"$",
"dbPath",
"=",
"$",
"basePath",
".",
"'/'",
".",
"$",
"this",
"->",
"options",
"[",
"'dbPath'",
"]",
".",
"'/'",
".",
"$"... | Prepare database file and folder structure.
@return void | [
"Prepare",
"database",
"file",
"and",
"folder",
"structure",
"."
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection/FlatFileConnection.php#L63-L73 |
xinix-technology/norm | src/Norm/Connection/FlatFileConnection.php | FlatFileConnection.persist | public function persist($collection, array $document)
{
if (is_null($this->dbPath)) {
$this->prepareDatabaseEcosystem();
}
if ($collection instanceof Collection) {
$collectionName = $collection->getName();
} else {
$collectionName = $collection;
... | php | public function persist($collection, array $document)
{
if (is_null($this->dbPath)) {
$this->prepareDatabaseEcosystem();
}
if ($collection instanceof Collection) {
$collectionName = $collection->getName();
} else {
$collectionName = $collection;
... | [
"public",
"function",
"persist",
"(",
"$",
"collection",
",",
"array",
"$",
"document",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"dbPath",
")",
")",
"{",
"$",
"this",
"->",
"prepareDatabaseEcosystem",
"(",
")",
";",
"}",
"if",
"(",
"$"... | {@inheritDoc} | [
"{"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection/FlatFileConnection.php#L86-L112 |
xinix-technology/norm | src/Norm/Connection/FlatFileConnection.php | FlatFileConnection.getCollectionData | public function getCollectionData($collection, $criteria = null)
{
if (is_null($this->dbPath)) {
$this->prepareDatabaseEcosystem();
}
if (! is_dir($this->dbPath.'/'.$collection)) {
mkdir($this->dbPath.'/'.$collection, 0755, true);
}
$rows = array();
... | php | public function getCollectionData($collection, $criteria = null)
{
if (is_null($this->dbPath)) {
$this->prepareDatabaseEcosystem();
}
if (! is_dir($this->dbPath.'/'.$collection)) {
mkdir($this->dbPath.'/'.$collection, 0755, true);
}
$rows = array();
... | [
"public",
"function",
"getCollectionData",
"(",
"$",
"collection",
",",
"$",
"criteria",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"dbPath",
")",
")",
"{",
"$",
"this",
"->",
"prepareDatabaseEcosystem",
"(",
")",
";",
"}",
"i... | Getter for specific data for collection
@return array | [
"Getter",
"for",
"specific",
"data",
"for",
"collection"
] | train | https://github.com/xinix-technology/norm/blob/c357f7d3a75d05324dd84b8f6a968a094c53d603/src/Norm/Connection/FlatFileConnection.php#L159-L207 |
leedavis81/altr-ego | library/AltrEgo/Adapter/Php54.php | Php54._call | public function _call($name, $arguments)
{
$object = $this->getObject();
$callable = function() use ($name, $arguments, $object){
if (!method_exists($object, $name)) {
throw new \Exception('Unable to invoke method ' . $name . ' on object of class ' . get_class($object));
}
return call_user_fu... | php | public function _call($name, $arguments)
{
$object = $this->getObject();
$callable = function() use ($name, $arguments, $object){
if (!method_exists($object, $name)) {
throw new \Exception('Unable to invoke method ' . $name . ' on object of class ' . get_class($object));
}
return call_user_fu... | [
"public",
"function",
"_call",
"(",
"$",
"name",
",",
"$",
"arguments",
")",
"{",
"$",
"object",
"=",
"$",
"this",
"->",
"getObject",
"(",
")",
";",
"$",
"callable",
"=",
"function",
"(",
")",
"use",
"(",
"$",
"name",
",",
"$",
"arguments",
",",
... | (non-PHPdoc)
@see AltrEgo\Adapter.AdapterInterface::_call() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/leedavis81/altr-ego/blob/1556556a33c2b6caddef94444522c5bbffc217c7/library/AltrEgo/Adapter/Php54.php#L48-L58 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.