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 |
|---|---|---|---|---|---|---|---|---|---|---|
edvinaskrucas/notification | src/Krucas/Notification/Notification.php | Notification.getContainerFormat | public function getContainerFormat($container)
{
if (isset($this->format[$container])) {
return $this->format[$container];
}
return $this->defaultFormat;
} | php | public function getContainerFormat($container)
{
if (isset($this->format[$container])) {
return $this->format[$container];
}
return $this->defaultFormat;
} | [
"public",
"function",
"getContainerFormat",
"(",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"format",
"[",
"$",
"container",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"format",
"[",
"$",
"container",
"]",
";",
"}",... | Return format for a container.
@param $container
@return string|null | [
"Return",
"format",
"for",
"a",
"container",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Notification.php#L159-L166 |
edvinaskrucas/notification | src/Krucas/Notification/Notification.php | Notification.getContainerFormats | public function getContainerFormats($container)
{
if (isset($this->formats[$container])) {
return $this->formats[$container];
}
return $this->defaultFormats;
} | php | public function getContainerFormats($container)
{
if (isset($this->formats[$container])) {
return $this->formats[$container];
}
return $this->defaultFormats;
} | [
"public",
"function",
"getContainerFormats",
"(",
"$",
"container",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"formats",
"[",
"$",
"container",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
"formats",
"[",
"$",
"container",
"]",
";",
"... | Return formats for a container.
@param $container
@return array | [
"Return",
"formats",
"for",
"a",
"container",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Notification.php#L188-L195 |
edvinaskrucas/notification | src/Krucas/Notification/Notification.php | Notification.addContainer | public function addContainer($container, $types = [], $defaultFormat = null, $formats = [])
{
if (isset($this->containers[$container])) {
return $this;
}
$this->containers[$container] = new NotificationsBag($container, $types, $defaultFormat, $formats);
$this->containers... | php | public function addContainer($container, $types = [], $defaultFormat = null, $formats = [])
{
if (isset($this->containers[$container])) {
return $this;
}
$this->containers[$container] = new NotificationsBag($container, $types, $defaultFormat, $formats);
$this->containers... | [
"public",
"function",
"addContainer",
"(",
"$",
"container",
",",
"$",
"types",
"=",
"[",
"]",
",",
"$",
"defaultFormat",
"=",
"null",
",",
"$",
"formats",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"containers",
"[",
"$",... | Add new container.
@param string $container
@param array $types
@param null $defaultFormat
@param array $formats
@return \Krucas\Notification\Notification | [
"Add",
"new",
"container",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Notification.php#L206-L216 |
edvinaskrucas/notification | src/Krucas/Notification/Notification.php | Notification.container | public function container($container = null, Closure $callback = null)
{
$container = is_null($container) ? $this->defaultContainer : $container;
if (!isset($this->containers[$container])) {
$this->addContainer(
$container,
$this->getContainerTypes($conta... | php | public function container($container = null, Closure $callback = null)
{
$container = is_null($container) ? $this->defaultContainer : $container;
if (!isset($this->containers[$container])) {
$this->addContainer(
$container,
$this->getContainerTypes($conta... | [
"public",
"function",
"container",
"(",
"$",
"container",
"=",
"null",
",",
"Closure",
"$",
"callback",
"=",
"null",
")",
"{",
"$",
"container",
"=",
"is_null",
"(",
"$",
"container",
")",
"?",
"$",
"this",
"->",
"defaultContainer",
":",
"$",
"container"... | Returns container instance.
@param null|string $container
@param callable $callback
@return \Krucas\Notification\NotificationsBag | [
"Returns",
"container",
"instance",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Notification.php#L235-L253 |
edvinaskrucas/notification | src/Krucas/Notification/Notification.php | Notification.fire | public function fire($event, NotificationsBag $notificationBag, Message $message)
{
if (!isset(static::$dispatcher)) {
return true;
}
$event = "notification.{$event}: ".$notificationBag->getName();
return static::$dispatcher->fire($event, array($this, $notificationBag, ... | php | public function fire($event, NotificationsBag $notificationBag, Message $message)
{
if (!isset(static::$dispatcher)) {
return true;
}
$event = "notification.{$event}: ".$notificationBag->getName();
return static::$dispatcher->fire($event, array($this, $notificationBag, ... | [
"public",
"function",
"fire",
"(",
"$",
"event",
",",
"NotificationsBag",
"$",
"notificationBag",
",",
"Message",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"static",
"::",
"$",
"dispatcher",
")",
")",
"{",
"return",
"true",
";",
"}",
"$",... | Fire given event.
@param $event
@param \Krucas\Notification\NotificationsBag $notificationBag
@param \Krucas\Notification\Message $message
@return array|bool|null | [
"Fire",
"given",
"event",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/Notification.php#L276-L285 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.addType | public function addType($type)
{
if (func_num_args() > 1) {
foreach (func_get_args() as $t) {
$this->addType($t);
}
} else {
if (is_array($type)) {
foreach ($type as $t) {
$this->addType($t);
}
... | php | public function addType($type)
{
if (func_num_args() > 1) {
foreach (func_get_args() as $t) {
$this->addType($t);
}
} else {
if (is_array($type)) {
foreach ($type as $t) {
$this->addType($t);
}
... | [
"public",
"function",
"addType",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"1",
")",
"{",
"foreach",
"(",
"func_get_args",
"(",
")",
"as",
"$",
"t",
")",
"{",
"$",
"this",
"->",
"addType",
"(",
"$",
"t",
")",
";",
"... | Add new available type of message to bag.
@param $type
@return \Krucas\Notification\NotificationsBag | [
"Add",
"new",
"available",
"type",
"of",
"message",
"to",
"bag",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L104-L123 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.extractType | protected function extractType($name)
{
if (count($this->types) <= 0) {
return false;
}
foreach ($this->types as $type) {
foreach ($this->matcher as $function => $pattern) {
if (str_replace(array('{type}', '{uType}'), array($type, ucfirst($type)), $pa... | php | protected function extractType($name)
{
if (count($this->types) <= 0) {
return false;
}
foreach ($this->types as $type) {
foreach ($this->matcher as $function => $pattern) {
if (str_replace(array('{type}', '{uType}'), array($type, ucfirst($type)), $pa... | [
"protected",
"function",
"extractType",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"types",
")",
"<=",
"0",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"types",
"as",
"$",
"type",
")",
"{... | Extract type from a given string.
@param $name
@return bool|array | [
"Extract",
"type",
"from",
"a",
"given",
"string",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L164-L179 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.setFormats | public function setFormats($formats)
{
foreach ($formats as $type => $format) {
$this->setFormat($type, $format);
}
return $this;
} | php | public function setFormats($formats)
{
foreach ($formats as $type => $format) {
$this->setFormat($type, $format);
}
return $this;
} | [
"public",
"function",
"setFormats",
"(",
"$",
"formats",
")",
"{",
"foreach",
"(",
"$",
"formats",
"as",
"$",
"type",
"=>",
"$",
"format",
")",
"{",
"$",
"this",
"->",
"setFormat",
"(",
"$",
"type",
",",
"$",
"format",
")",
";",
"}",
"return",
"$",... | Set formats for a given types.
@param $formats
@return \Krucas\Notification\NotificationsBag | [
"Set",
"formats",
"for",
"a",
"given",
"types",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L210-L217 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.setFormat | public function setFormat($type, $format)
{
if ($this->typeIsAvailable($type)) {
$this->formats[$type] = $format;
}
return $this;
} | php | public function setFormat($type, $format)
{
if ($this->typeIsAvailable($type)) {
$this->formats[$type] = $format;
}
return $this;
} | [
"public",
"function",
"setFormat",
"(",
"$",
"type",
",",
"$",
"format",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"typeIsAvailable",
"(",
"$",
"type",
")",
")",
"{",
"$",
"this",
"->",
"formats",
"[",
"$",
"type",
"]",
"=",
"$",
"format",
";",
"}"... | Set format for a given type.
@param $type
@param $format
@return \Krucas\Notification\NotificationsBag | [
"Set",
"format",
"for",
"a",
"given",
"type",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L226-L233 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.getFormat | public function getFormat($type)
{
if (!$this->typeIsAvailable($type)) {
return false;
}
if (isset($this->formats[$type])) {
return $this->formats[$type];
}
if (!is_null($this->getDefaultFormat())) {
return $this->getDefaultFormat();
... | php | public function getFormat($type)
{
if (!$this->typeIsAvailable($type)) {
return false;
}
if (isset($this->formats[$type])) {
return $this->formats[$type];
}
if (!is_null($this->getDefaultFormat())) {
return $this->getDefaultFormat();
... | [
"public",
"function",
"getFormat",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"typeIsAvailable",
"(",
"$",
"type",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"formats",
"[",
"$",
"t... | Return format for a given type.
@param $type
@return bool|string | [
"Return",
"format",
"for",
"a",
"given",
"type",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L241-L256 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.checkFormat | protected function checkFormat($format, $type = null)
{
return !is_null($format) ? $format : $this->getFormat($type);
} | php | protected function checkFormat($format, $type = null)
{
return !is_null($format) ? $format : $this->getFormat($type);
} | [
"protected",
"function",
"checkFormat",
"(",
"$",
"format",
",",
"$",
"type",
"=",
"null",
")",
"{",
"return",
"!",
"is_null",
"(",
"$",
"format",
")",
"?",
"$",
"format",
":",
"$",
"this",
"->",
"getFormat",
"(",
"$",
"type",
")",
";",
"}"
] | Returns valid format.
@param $format
@param null $type
@return null | [
"Returns",
"valid",
"format",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L290-L293 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.add | public function add($type, $message, $flash = true, $format = null)
{
if (!$this->typeIsAvailable($type)) {
return $this;
}
if ($message instanceof \Krucas\Notification\Message) {
$m = $message;
$this->addInstance($m, $type, $flash, $format);
} el... | php | public function add($type, $message, $flash = true, $format = null)
{
if (!$this->typeIsAvailable($type)) {
return $this;
}
if ($message instanceof \Krucas\Notification\Message) {
$m = $message;
$this->addInstance($m, $type, $flash, $format);
} el... | [
"public",
"function",
"add",
"(",
"$",
"type",
",",
"$",
"message",
",",
"$",
"flash",
"=",
"true",
",",
"$",
"format",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"typeIsAvailable",
"(",
"$",
"type",
")",
")",
"{",
"return",
"$",
... | Adds new notification message to one of collections.
If message is array, adds multiple messages.
Message can be string, array (array can contain string for message, or array of message and format).
Flashes flashable messages.
@param $type
@param string|\Krucas\Notification\Message|\Closure $message
@param bool $flash... | [
"Adds",
"new",
"notification",
"message",
"to",
"one",
"of",
"collections",
".",
"If",
"message",
"is",
"array",
"adds",
"multiple",
"messages",
".",
"Message",
"can",
"be",
"string",
"array",
"(",
"array",
"can",
"contain",
"string",
"for",
"message",
"or",... | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L307-L332 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.addInstance | protected function addInstance(Message $message, $type, $flash = true, $format = null)
{
$message->setType($type);
if ($message->isFlash() != $flash) {
$message->setFlash($flash);
}
if (is_null($message->getFormat())) {
$message->setFormat($this->getFormat($ty... | php | protected function addInstance(Message $message, $type, $flash = true, $format = null)
{
$message->setType($type);
if ($message->isFlash() != $flash) {
$message->setFlash($flash);
}
if (is_null($message->getFormat())) {
$message->setFormat($this->getFormat($ty... | [
"protected",
"function",
"addInstance",
"(",
"Message",
"$",
"message",
",",
"$",
"type",
",",
"$",
"flash",
"=",
"true",
",",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"message",
"->",
"setType",
"(",
"$",
"type",
")",
";",
"if",
"(",
"$",
"messa... | Add message by instance.
@param \Krucas\Notification\Message $message
@param string $type
@param bool $flash
@param null $format | [
"Add",
"message",
"by",
"instance",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L342-L354 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.get | public function get($type)
{
$collection = new Collection();
foreach ($this->notifications as $key => $message) {
if ($message->getType() == $type) {
$collection->add($message);
}
}
return $collection;
} | php | public function get($type)
{
$collection = new Collection();
foreach ($this->notifications as $key => $message) {
if ($message->getType() == $type) {
$collection->add($message);
}
}
return $collection;
} | [
"public",
"function",
"get",
"(",
"$",
"type",
")",
"{",
"$",
"collection",
"=",
"new",
"Collection",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"notifications",
"as",
"$",
"key",
"=>",
"$",
"message",
")",
"{",
"if",
"(",
"$",
"message",
"-... | Returns all messages for given type.
@param $type
@return \Krucas\Notification\Collection | [
"Returns",
"all",
"messages",
"for",
"given",
"type",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L362-L373 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.clear | public function clear($type = null)
{
if (is_null($type)) {
$this->notifications = new Collection();
} else {
$notifications = new Collection();
foreach ($this->notifications as $message) {
if ($message->getType() != $type) {
$... | php | public function clear($type = null)
{
if (is_null($type)) {
$this->notifications = new Collection();
} else {
$notifications = new Collection();
foreach ($this->notifications as $message) {
if ($message->getType() != $type) {
$... | [
"public",
"function",
"clear",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"type",
")",
")",
"{",
"$",
"this",
"->",
"notifications",
"=",
"new",
"Collection",
"(",
")",
";",
"}",
"else",
"{",
"$",
"notifications",
"=",... | Clears message for a given type.
@param null $type
@return \Krucas\Notification\NotificationsBag | [
"Clears",
"message",
"for",
"a",
"given",
"type",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L381-L398 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.show | public function show($type = null, $format = null)
{
$messages = $this->getMessagesForRender($type);
$this->groupForRender = array();
$output = '';
foreach ($messages as $message) {
if (!$message->isFlash()) {
if (!is_null($format)) {
... | php | public function show($type = null, $format = null)
{
$messages = $this->getMessagesForRender($type);
$this->groupForRender = array();
$output = '';
foreach ($messages as $message) {
if (!$message->isFlash()) {
if (!is_null($format)) {
... | [
"public",
"function",
"show",
"(",
"$",
"type",
"=",
"null",
",",
"$",
"format",
"=",
"null",
")",
"{",
"$",
"messages",
"=",
"$",
"this",
"->",
"getMessagesForRender",
"(",
"$",
"type",
")",
";",
"$",
"this",
"->",
"groupForRender",
"=",
"array",
"(... | Returns generated output of non flash messages.
@param null $type
@param null $format
@return string | [
"Returns",
"generated",
"output",
"of",
"non",
"flash",
"messages",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L438-L457 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.getMessagesForRender | protected function getMessagesForRender($type = null)
{
if (is_null($type)) {
if (count($this->groupForRender) > 0) {
$messages = array();
foreach ($this->groupForRender as $typeToRender) {
$messages = array_merge($messages, $this->get($typeTo... | php | protected function getMessagesForRender($type = null)
{
if (is_null($type)) {
if (count($this->groupForRender) > 0) {
$messages = array();
foreach ($this->groupForRender as $typeToRender) {
$messages = array_merge($messages, $this->get($typeTo... | [
"protected",
"function",
"getMessagesForRender",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"type",
")",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"groupForRender",
")",
">",
"0",
")",
"{",
"$",
"messages",
... | Resolves which messages should be returned for rendering.
@param null $type
@return \Krucas\Notification\Collection | [
"Resolves",
"which",
"messages",
"should",
"be",
"returned",
"for",
"rendering",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L476-L492 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.group | public function group()
{
if (func_num_args() > 0) {
$types = func_get_args();
$this->groupForRender = array();
foreach ($types as $type) {
$this->addToGrouping($type);
}
}
return $this;
} | php | public function group()
{
if (func_num_args() > 0) {
$types = func_get_args();
$this->groupForRender = array();
foreach ($types as $type) {
$this->addToGrouping($type);
}
}
return $this;
} | [
"public",
"function",
"group",
"(",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
">",
"0",
")",
"{",
"$",
"types",
"=",
"func_get_args",
"(",
")",
";",
"$",
"this",
"->",
"groupForRender",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"types... | Set order to render types.
Call this method: group('success', 'info', ...)
@return \Krucas\Notification\NotificationsBag | [
"Set",
"order",
"to",
"render",
"types",
".",
"Call",
"this",
"method",
":",
"group",
"(",
"success",
"info",
"...",
")"
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L510-L521 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.addToGrouping | public function addToGrouping($type)
{
if (!$this->typeIsAvailable($type)) {
return $this;
}
if (!in_array($type, $this->groupForRender)) {
$this->groupForRender[] = $type;
}
return $this;
} | php | public function addToGrouping($type)
{
if (!$this->typeIsAvailable($type)) {
return $this;
}
if (!in_array($type, $this->groupForRender)) {
$this->groupForRender[] = $type;
}
return $this;
} | [
"public",
"function",
"addToGrouping",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"typeIsAvailable",
"(",
"$",
"type",
")",
")",
"{",
"return",
"$",
"this",
";",
"}",
"if",
"(",
"!",
"in_array",
"(",
"$",
"type",
",",
"$",
"th... | Adds type for rendering.
@param $type
@return \Krucas\Notification\NotificationsBag | [
"Adds",
"type",
"for",
"rendering",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L529-L540 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.removeFromGrouping | public function removeFromGrouping($type)
{
foreach ($this->groupForRender as $key => $typeToRender) {
if ($type == $typeToRender) {
unset($this->groupForRender[$key]);
}
}
$this->groupForRender = array_values($this->groupForRender);
return $... | php | public function removeFromGrouping($type)
{
foreach ($this->groupForRender as $key => $typeToRender) {
if ($type == $typeToRender) {
unset($this->groupForRender[$key]);
}
}
$this->groupForRender = array_values($this->groupForRender);
return $... | [
"public",
"function",
"removeFromGrouping",
"(",
"$",
"type",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"groupForRender",
"as",
"$",
"key",
"=>",
"$",
"typeToRender",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"$",
"typeToRender",
")",
"{",
"unset",
"(... | Removes type from rendering.
@param $type
@return \Krucas\Notification\NotificationsBag | [
"Removes",
"type",
"from",
"rendering",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L548-L559 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.toArray | public function toArray()
{
$arr = array
(
'container' => $this->container,
'format' => $this->getDefaultFormat(),
'types' => $this->getTypes(),
'notifications' => $this->notifications->toArray()
);
r... | php | public function toArray()
{
$arr = array
(
'container' => $this->container,
'format' => $this->getDefaultFormat(),
'types' => $this->getTypes(),
'notifications' => $this->notifications->toArray()
);
r... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"arr",
"=",
"array",
"(",
"'container'",
"=>",
"$",
"this",
"->",
"container",
",",
"'format'",
"=>",
"$",
"this",
"->",
"getDefaultFormat",
"(",
")",
",",
"'types'",
"=>",
"$",
"this",
"->",
"getTyp... | Get the instance as an array.
@return array | [
"Get",
"the",
"instance",
"as",
"an",
"array",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L566-L577 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.has | public function has($type = null)
{
if ($this->count() <= 0) {
return false;
}
if (is_null($type)) {
return true;
}
if (!$this->typeIsAvailable($type)) {
return false;
}
foreach ($this->notifications as $key => $message) ... | php | public function has($type = null)
{
if ($this->count() <= 0) {
return false;
}
if (is_null($type)) {
return true;
}
if (!$this->typeIsAvailable($type)) {
return false;
}
foreach ($this->notifications as $key => $message) ... | [
"public",
"function",
"has",
"(",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"count",
"(",
")",
"<=",
"0",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"is_null",
"(",
"$",
"type",
")",
")",
"{",
"return",
"true",
... | Check if a message is set for given type.
@param $type
@return bool | [
"Check",
"if",
"a",
"message",
"is",
"set",
"for",
"given",
"type",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L616-L637 |
edvinaskrucas/notification | src/Krucas/Notification/NotificationsBag.php | NotificationsBag.fireEvent | protected function fireEvent($event, $message)
{
if (!isset($this->notification)) {
return true;
}
return $this->getNotification()->fire($event, $this, $message);
} | php | protected function fireEvent($event, $message)
{
if (!isset($this->notification)) {
return true;
}
return $this->getNotification()->fire($event, $this, $message);
} | [
"protected",
"function",
"fireEvent",
"(",
"$",
"event",
",",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"notification",
")",
")",
"{",
"return",
"true",
";",
"}",
"return",
"$",
"this",
"->",
"getNotification",
"(",
"... | Fire event for a given message.
@param $event
@param $message
@return boolean | [
"Fire",
"event",
"for",
"a",
"given",
"message",
"."
] | train | https://github.com/edvinaskrucas/notification/blob/f47205558171f5146fe6aa03da1c60ed2789f284/src/Krucas/Notification/NotificationsBag.php#L646-L653 |
dunglas/DunglasAngularCsrfBundle | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('dunglas_angular_csrf');
$rootNode
->children()
->arrayNode('token')
->addDefaultsIfNotSet()
->children()
... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('dunglas_angular_csrf');
$rootNode
->children()
->arrayNode('token')
->addDefaultsIfNotSet()
->children()
... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'dunglas_angular_csrf'",
")",
";",
"$",
"rootNode",
"->",
"children",
"("... | {@inheritdoc} | [
"{"
] | train | https://github.com/dunglas/DunglasAngularCsrfBundle/blob/4d50e23d3b306ba3e48d799df66b59d919d6a6dd/DependencyInjection/Configuration.php#L27-L88 |
dunglas/DunglasAngularCsrfBundle | Form/Extension/DisableCsrfExtension.php | DisableCsrfExtension.configureOptions | public function configureOptions(OptionsResolver $resolver)
{
$request = $this->requestStack->getCurrentRequest();
if (null === $request) {
return;
}
if (false === $this->routeMatcher->match($request, $this->routes)) {
return;
}
$value = $req... | php | public function configureOptions(OptionsResolver $resolver)
{
$request = $this->requestStack->getCurrentRequest();
if (null === $request) {
return;
}
if (false === $this->routeMatcher->match($request, $this->routes)) {
return;
}
$value = $req... | [
"public",
"function",
"configureOptions",
"(",
"OptionsResolver",
"$",
"resolver",
")",
"{",
"$",
"request",
"=",
"$",
"this",
"->",
"requestStack",
"->",
"getCurrentRequest",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"request",
")",
"{",
"return",
";"... | {@inheritdoc} | [
"{"
] | train | https://github.com/dunglas/DunglasAngularCsrfBundle/blob/4d50e23d3b306ba3e48d799df66b59d919d6a6dd/Form/Extension/DisableCsrfExtension.php#L73-L91 |
dunglas/DunglasAngularCsrfBundle | EventListener/AngularCsrfCookieListener.php | AngularCsrfCookieListener.onKernelResponse | public function onKernelResponse(FilterResponseEvent $event)
{
if (
HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()
||
!$this->routeMatcher->match($event->getRequest(), $this->routes)
) {
return;
}
$event->getResponse()... | php | public function onKernelResponse(FilterResponseEvent $event)
{
if (
HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()
||
!$this->routeMatcher->match($event->getRequest(), $this->routes)
) {
return;
}
$event->getResponse()... | [
"public",
"function",
"onKernelResponse",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"HttpKernelInterface",
"::",
"MASTER_REQUEST",
"!==",
"$",
"event",
"->",
"getRequestType",
"(",
")",
"||",
"!",
"$",
"this",
"->",
"routeMatcher",
"->",
"... | Sets a cookie to the response containing the CRSF token.
@param FilterResponseEvent $event | [
"Sets",
"a",
"cookie",
"to",
"the",
"response",
"containing",
"the",
"CRSF",
"token",
"."
] | train | https://github.com/dunglas/DunglasAngularCsrfBundle/blob/4d50e23d3b306ba3e48d799df66b59d919d6a6dd/EventListener/AngularCsrfCookieListener.php#L89-L107 |
dunglas/DunglasAngularCsrfBundle | EventListener/AngularCsrfValidationListener.php | AngularCsrfValidationListener.onKernelRequest | public function onKernelRequest(GetResponseEvent $event)
{
if (
HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()
||
$this->routeMatcher->match($event->getRequest(), $this->exclude)
||
!$this->routeMatcher->match($event->getRequest()... | php | public function onKernelRequest(GetResponseEvent $event)
{
if (
HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()
||
$this->routeMatcher->match($event->getRequest(), $this->exclude)
||
!$this->routeMatcher->match($event->getRequest()... | [
"public",
"function",
"onKernelRequest",
"(",
"GetResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"HttpKernelInterface",
"::",
"MASTER_REQUEST",
"!==",
"$",
"event",
"->",
"getRequestType",
"(",
")",
"||",
"$",
"this",
"->",
"routeMatcher",
"->",
"match",
"... | Handles CSRF token validation.
@param GetResponseEvent $event
@throws AccessDeniedHttpException | [
"Handles",
"CSRF",
"token",
"validation",
"."
] | train | https://github.com/dunglas/DunglasAngularCsrfBundle/blob/4d50e23d3b306ba3e48d799df66b59d919d6a6dd/EventListener/AngularCsrfValidationListener.php#L74-L90 |
dunglas/DunglasAngularCsrfBundle | Csrf/AngularCsrfTokenManager.php | AngularCsrfTokenManager.isTokenValid | public function isTokenValid($value)
{
$csrfToken = new CsrfToken($this->tokenId, $value);
return $this->csrfTokenManager->isTokenValid($csrfToken);
} | php | public function isTokenValid($value)
{
$csrfToken = new CsrfToken($this->tokenId, $value);
return $this->csrfTokenManager->isTokenValid($csrfToken);
} | [
"public",
"function",
"isTokenValid",
"(",
"$",
"value",
")",
"{",
"$",
"csrfToken",
"=",
"new",
"CsrfToken",
"(",
"$",
"this",
"->",
"tokenId",
",",
"$",
"value",
")",
";",
"return",
"$",
"this",
"->",
"csrfTokenManager",
"->",
"isTokenValid",
"(",
"$",... | Tests if the given token value is valid.
@param $value The CSRF token value to test
@return bool
@see CsrfTokenManagerInterface::isTokenValid() | [
"Tests",
"if",
"the",
"given",
"token",
"value",
"is",
"valid",
"."
] | train | https://github.com/dunglas/DunglasAngularCsrfBundle/blob/4d50e23d3b306ba3e48d799df66b59d919d6a6dd/Csrf/AngularCsrfTokenManager.php#L86-L91 |
dunglas/DunglasAngularCsrfBundle | Routing/RouteMatcher.php | RouteMatcher.match | public function match(Request $request, array $routes)
{
foreach ($routes as $route) {
if (empty($route['methods'])) {
$methodMatch = true;
} else {
$methodMatch = false;
foreach ($route['methods'] as $method) {
if (... | php | public function match(Request $request, array $routes)
{
foreach ($routes as $route) {
if (empty($route['methods'])) {
$methodMatch = true;
} else {
$methodMatch = false;
foreach ($route['methods'] as $method) {
if (... | [
"public",
"function",
"match",
"(",
"Request",
"$",
"request",
",",
"array",
"$",
"routes",
")",
"{",
"foreach",
"(",
"$",
"routes",
"as",
"$",
"route",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"route",
"[",
"'methods'",
"]",
")",
")",
"{",
"$",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/dunglas/DunglasAngularCsrfBundle/blob/4d50e23d3b306ba3e48d799df66b59d919d6a6dd/Routing/RouteMatcher.php#L24-L53 |
oat-sa/extension-tao-delivery | model/execution/DeliveryExecutionContext.php | DeliveryExecutionContext.jsonSerialize | public function jsonSerialize()
{
return [
self::PARAM_EXECUTION_ID => $this->getExecutionId(),
self::PARAM_CONTEXT_ID => $this->getExecutionContextId(),
self::PARAM_TYPE => $this->getType(),
self::PARAM_LABEL => $this->getLabel()
];
} | php | public function jsonSerialize()
{
return [
self::PARAM_EXECUTION_ID => $this->getExecutionId(),
self::PARAM_CONTEXT_ID => $this->getExecutionContextId(),
self::PARAM_TYPE => $this->getType(),
self::PARAM_LABEL => $this->getLabel()
];
} | [
"public",
"function",
"jsonSerialize",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"PARAM_EXECUTION_ID",
"=>",
"$",
"this",
"->",
"getExecutionId",
"(",
")",
",",
"self",
"::",
"PARAM_CONTEXT_ID",
"=>",
"$",
"this",
"->",
"getExecutionContextId",
"(",
")",
"... | {@inheritdoc} | [
"{"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/DeliveryExecutionContext.php#L177-L185 |
oat-sa/extension-tao-delivery | model/authorization/strategy/StateValidation.php | StateValidation.verifyResumeAuthorization | public function verifyResumeAuthorization(DeliveryExecutionInterface $deliveryExecution, User $user)
{
$stateId = $deliveryExecution->getState()->getUri();
if (!in_array($stateId, $this->getResumableStates())) {
\common_Logger::w('Unexpected state "'.$stateId);
throw new \com... | php | public function verifyResumeAuthorization(DeliveryExecutionInterface $deliveryExecution, User $user)
{
$stateId = $deliveryExecution->getState()->getUri();
if (!in_array($stateId, $this->getResumableStates())) {
\common_Logger::w('Unexpected state "'.$stateId);
throw new \com... | [
"public",
"function",
"verifyResumeAuthorization",
"(",
"DeliveryExecutionInterface",
"$",
"deliveryExecution",
",",
"User",
"$",
"user",
")",
"{",
"$",
"stateId",
"=",
"$",
"deliveryExecution",
"->",
"getState",
"(",
")",
"->",
"getUri",
"(",
")",
";",
"if",
... | Verify that a given delivery execution is allowed to be executed
@param DeliveryExecutionInterface $deliveryExecution
@param User $user
@throws \common_exception_Unauthorized | [
"Verify",
"that",
"a",
"given",
"delivery",
"execution",
"is",
"allowed",
"to",
"be",
"executed"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/authorization/strategy/StateValidation.php#L49-L56 |
oat-sa/extension-tao-delivery | model/container/delivery/LegacyServiceContainer.php | LegacyServiceContainer.getRuntime | public function getRuntime(DeliveryExecution $execution)
{
$delivery = $execution->getDelivery();
return $this->getServiceLocator()->get(RuntimeService::SERVICE_ID)->getRuntime($delivery->getUri());
} | php | public function getRuntime(DeliveryExecution $execution)
{
$delivery = $execution->getDelivery();
return $this->getServiceLocator()->get(RuntimeService::SERVICE_ID)->getRuntime($delivery->getUri());
} | [
"public",
"function",
"getRuntime",
"(",
"DeliveryExecution",
"$",
"execution",
")",
"{",
"$",
"delivery",
"=",
"$",
"execution",
"->",
"getDelivery",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"RuntimeServic... | Return the service call to run the delivery
@param DeliveryExecution $execution
@return \tao_models_classes_service_ServiceCall | [
"Return",
"the",
"service",
"call",
"to",
"run",
"the",
"delivery"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/container/delivery/LegacyServiceContainer.php#L32-L36 |
oat-sa/extension-tao-delivery | model/execution/implementation/KeyValueService.php | KeyValueService.spawnDeliveryExecution | public function spawnDeliveryExecution($label, $deliveryId, $userId, $status)
{
$identifier = self::DELIVERY_EXECUTION_PREFIX . \common_Utils::getNewUri();
$data = array(
OntologyRdfs::RDFS_LABEL => $label,
OntologyDeliveryExecution::PROPERTY_DELIVERY => $deliveryId,
... | php | public function spawnDeliveryExecution($label, $deliveryId, $userId, $status)
{
$identifier = self::DELIVERY_EXECUTION_PREFIX . \common_Utils::getNewUri();
$data = array(
OntologyRdfs::RDFS_LABEL => $label,
OntologyDeliveryExecution::PROPERTY_DELIVERY => $deliveryId,
... | [
"public",
"function",
"spawnDeliveryExecution",
"(",
"$",
"label",
",",
"$",
"deliveryId",
",",
"$",
"userId",
",",
"$",
"status",
")",
"{",
"$",
"identifier",
"=",
"self",
"::",
"DELIVERY_EXECUTION_PREFIX",
".",
"\\",
"common_Utils",
"::",
"getNewUri",
"(",
... | Spawn a new Delivery Execution
@param string $label
@param string $deliveryId
@param string $userId
@param string $status
@return \oat\taoDelivery\model\execution\DeliveryExecution | [
"Spawn",
"a",
"new",
"Delivery",
"Execution"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/implementation/KeyValueService.php#L99-L113 |
oat-sa/extension-tao-delivery | model/execution/implementation/KeyValueService.php | KeyValueService.initDeliveryExecution | public function initDeliveryExecution(core_kernel_classes_Resource $assembly, $userId)
{
common_Logger::w('Call to deprecated function '.__FUNCTION__);
return $this->spawnDeliveryExecution($assembly->getLabel(), $assembly->getUri(), $userId, KvDeliveryExecution::STATE_ACTIVE);
} | php | public function initDeliveryExecution(core_kernel_classes_Resource $assembly, $userId)
{
common_Logger::w('Call to deprecated function '.__FUNCTION__);
return $this->spawnDeliveryExecution($assembly->getLabel(), $assembly->getUri(), $userId, KvDeliveryExecution::STATE_ACTIVE);
} | [
"public",
"function",
"initDeliveryExecution",
"(",
"core_kernel_classes_Resource",
"$",
"assembly",
",",
"$",
"userId",
")",
"{",
"common_Logger",
"::",
"w",
"(",
"'Call to deprecated function '",
".",
"__FUNCTION__",
")",
";",
"return",
"$",
"this",
"->",
"spawnDe... | Generate a new delivery execution
@deprecated
@param core_kernel_classes_Resource $assembly
@param string $userId
@return core_kernel_classes_Resource the delivery execution | [
"Generate",
"a",
"new",
"delivery",
"execution"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/implementation/KeyValueService.php#L122-L126 |
oat-sa/extension-tao-delivery | model/execution/implementation/KeyValueService.php | KeyValueService.updateDeliveryExecutionStatus | public function updateDeliveryExecutionStatus(KVDeliveryExecution $deliveryExecution, $old, $new)
{
$this->update($deliveryExecution);
$userId = $deliveryExecution->getUserIdentifier();
if ($old != null) {
$oldReferences = $this->getDeliveryExecutionsByStatus($userId, $old);
... | php | public function updateDeliveryExecutionStatus(KVDeliveryExecution $deliveryExecution, $old, $new)
{
$this->update($deliveryExecution);
$userId = $deliveryExecution->getUserIdentifier();
if ($old != null) {
$oldReferences = $this->getDeliveryExecutionsByStatus($userId, $old);
... | [
"public",
"function",
"updateDeliveryExecutionStatus",
"(",
"KVDeliveryExecution",
"$",
"deliveryExecution",
",",
"$",
"old",
",",
"$",
"new",
")",
"{",
"$",
"this",
"->",
"update",
"(",
"$",
"deliveryExecution",
")",
";",
"$",
"userId",
"=",
"$",
"deliveryExe... | Update the collection of deliveries
@param KVDeliveryExecution $deliveryExecution
@param string $old
@param string $new
@return mixed | [
"Update",
"the",
"collection",
"of",
"deliveries"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/implementation/KeyValueService.php#L191-L208 |
oat-sa/extension-tao-delivery | model/execution/ServiceProxy.php | ServiceProxy.getExecutionsByDelivery | public function getExecutionsByDelivery(core_kernel_classes_Resource $compiled)
{
if (!$this->implementsMonitoring()) {
throw new common_exception_NoImplementation(get_class($this->getImplementation()).' does not implement \oat\taoDelivery\model\execution\Monitoring');
}
return $... | php | public function getExecutionsByDelivery(core_kernel_classes_Resource $compiled)
{
if (!$this->implementsMonitoring()) {
throw new common_exception_NoImplementation(get_class($this->getImplementation()).' does not implement \oat\taoDelivery\model\execution\Monitoring');
}
return $... | [
"public",
"function",
"getExecutionsByDelivery",
"(",
"core_kernel_classes_Resource",
"$",
"compiled",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"implementsMonitoring",
"(",
")",
")",
"{",
"throw",
"new",
"common_exception_NoImplementation",
"(",
"get_class",
"("... | Implemented in the monitoring interface
@param core_kernel_classes_Resource $compiled
@return DeliveryExecution[] executions for a single compilation
@throws \common_exception_Error
@throws common_exception_NoImplementation | [
"Implemented",
"in",
"the",
"monitoring",
"interface"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/ServiceProxy.php#L164-L170 |
oat-sa/extension-tao-delivery | scripts/install/GenerateRdsDeliveryExecutionTable.php | GenerateRdsDeliveryExecutionTable.areColumnsExist | private function areColumnsExist(\common_persistence_sql_SchemaManager $schemaManager)
{
$columnNames = [
RdsDeliveryExecutionService::COLUMN_ID,
RdsDeliveryExecutionService::COLUMN_USER_ID,
RdsDeliveryExecutionService::COLUMN_DELIVERY_ID,
RdsDeliveryExecution... | php | private function areColumnsExist(\common_persistence_sql_SchemaManager $schemaManager)
{
$columnNames = [
RdsDeliveryExecutionService::COLUMN_ID,
RdsDeliveryExecutionService::COLUMN_USER_ID,
RdsDeliveryExecutionService::COLUMN_DELIVERY_ID,
RdsDeliveryExecution... | [
"private",
"function",
"areColumnsExist",
"(",
"\\",
"common_persistence_sql_SchemaManager",
"$",
"schemaManager",
")",
"{",
"$",
"columnNames",
"=",
"[",
"RdsDeliveryExecutionService",
"::",
"COLUMN_ID",
",",
"RdsDeliveryExecutionService",
"::",
"COLUMN_USER_ID",
",",
"R... | Returns that the delivery_executions table columns are already exist in the table or not
@param \common_persistence_sql_SchemaManager $schemaManager
@return bool | [
"Returns",
"that",
"the",
"delivery_executions",
"table",
"columns",
"are",
"already",
"exist",
"in",
"the",
"table",
"or",
"not"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/scripts/install/GenerateRdsDeliveryExecutionTable.php#L87-L108 |
oat-sa/extension-tao-delivery | scripts/install/GenerateRdsDeliveryExecutionTable.php | GenerateRdsDeliveryExecutionTable.createTable | private function createTable(Schema $schema)
{
$table = $schema->createTable(RdsDeliveryExecutionService::TABLE_NAME);
$table->addOption("engine", "InnoDB");
$table->addOption("charset", "utf8");
$table->addOption("collate", "utf8_unicode_ci");
$this->createColumns($table);... | php | private function createTable(Schema $schema)
{
$table = $schema->createTable(RdsDeliveryExecutionService::TABLE_NAME);
$table->addOption("engine", "InnoDB");
$table->addOption("charset", "utf8");
$table->addOption("collate", "utf8_unicode_ci");
$this->createColumns($table);... | [
"private",
"function",
"createTable",
"(",
"Schema",
"$",
"schema",
")",
"{",
"$",
"table",
"=",
"$",
"schema",
"->",
"createTable",
"(",
"RdsDeliveryExecutionService",
"::",
"TABLE_NAME",
")",
";",
"$",
"table",
"->",
"addOption",
"(",
"\"engine\"",
",",
"\... | Creates the table in the database for the Delivery
@param Schema $schema
@return void | [
"Creates",
"the",
"table",
"in",
"the",
"database",
"for",
"the",
"Delivery"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/scripts/install/GenerateRdsDeliveryExecutionTable.php#L116-L143 |
oat-sa/extension-tao-delivery | scripts/install/GenerateRdsDeliveryExecutionTable.php | GenerateRdsDeliveryExecutionTable.createColumns | private function createColumns(Table $table)
{
$table->addColumn(RdsDeliveryExecutionService::COLUMN_ID, Type::STRING, ["length" => 255, "notnull" => true]);
$table->addColumn(RdsDeliveryExecutionService::COLUMN_DELIVERY_ID, Type::STRING, ["length" => 255, "notnull" => true]);
$table->addCol... | php | private function createColumns(Table $table)
{
$table->addColumn(RdsDeliveryExecutionService::COLUMN_ID, Type::STRING, ["length" => 255, "notnull" => true]);
$table->addColumn(RdsDeliveryExecutionService::COLUMN_DELIVERY_ID, Type::STRING, ["length" => 255, "notnull" => true]);
$table->addCol... | [
"private",
"function",
"createColumns",
"(",
"Table",
"$",
"table",
")",
"{",
"$",
"table",
"->",
"addColumn",
"(",
"RdsDeliveryExecutionService",
"::",
"COLUMN_ID",
",",
"Type",
"::",
"STRING",
",",
"[",
"\"length\"",
"=>",
"255",
",",
"\"notnull\"",
"=>",
... | Generates columns
@param Table $table
@return void | [
"Generates",
"columns"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/scripts/install/GenerateRdsDeliveryExecutionTable.php#L151-L161 |
oat-sa/extension-tao-delivery | scripts/install/GenerateRdsDeliveryExecutionTable.php | GenerateRdsDeliveryExecutionTable.createIndex | private function createIndex(Table $table, array $columns)
{
if (count($columns) > 0) {
$indexPrefix = "idx_" . RdsDeliveryExecutionService::TABLE_NAME . "_";
// Index names are limited to 63 characters in PostgreSQL (64 in MySQL)
$indexName = substr($indexPrefix . implo... | php | private function createIndex(Table $table, array $columns)
{
if (count($columns) > 0) {
$indexPrefix = "idx_" . RdsDeliveryExecutionService::TABLE_NAME . "_";
// Index names are limited to 63 characters in PostgreSQL (64 in MySQL)
$indexName = substr($indexPrefix . implo... | [
"private",
"function",
"createIndex",
"(",
"Table",
"$",
"table",
",",
"array",
"$",
"columns",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"columns",
")",
">",
"0",
")",
"{",
"$",
"indexPrefix",
"=",
"\"idx_\"",
".",
"RdsDeliveryExecutionService",
"::",
"TA... | Generates index for the given columns
@param Table $table
@param array $columns
@return void | [
"Generates",
"index",
"for",
"the",
"given",
"columns"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/scripts/install/GenerateRdsDeliveryExecutionTable.php#L170-L180 |
oat-sa/extension-tao-delivery | model/AssignmentAggregator/UnionAssignmentService.php | UnionAssignmentService.getAssignments | public function getAssignments(User $user)
{
$assignments = [];
foreach ($this->getInternalServices() as $service) {
$assignments = array_merge($assignments, $service->getAssignments($user));
}
return $assignments;
} | php | public function getAssignments(User $user)
{
$assignments = [];
foreach ($this->getInternalServices() as $service) {
$assignments = array_merge($assignments, $service->getAssignments($user));
}
return $assignments;
} | [
"public",
"function",
"getAssignments",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"assignments",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getInternalServices",
"(",
")",
"as",
"$",
"service",
")",
"{",
"$",
"assignments",
"=",
"array_merge"... | Returns the deliveries available to a user
@param User $user
@return Assignment[] list of deliveries | [
"Returns",
"the",
"deliveries",
"available",
"to",
"a",
"user"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/AssignmentAggregator/UnionAssignmentService.php#L47-L55 |
oat-sa/extension-tao-delivery | model/AssignmentAggregator/UnionAssignmentService.php | UnionAssignmentService.getAssignedUsers | public function getAssignedUsers($deliveryId)
{
$users = [];
foreach ($this->getInternalServices() as $service) {
$users = array_merge($users, $service->getAssignedUsers($deliveryId));
}
return $users;
} | php | public function getAssignedUsers($deliveryId)
{
$users = [];
foreach ($this->getInternalServices() as $service) {
$users = array_merge($users, $service->getAssignedUsers($deliveryId));
}
return $users;
} | [
"public",
"function",
"getAssignedUsers",
"(",
"$",
"deliveryId",
")",
"{",
"$",
"users",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getInternalServices",
"(",
")",
"as",
"$",
"service",
")",
"{",
"$",
"users",
"=",
"array_merge",
"(",
"$"... | Returns the ids of users assigned to a delivery
@param string|\core_kernel_classes_Resource $deliveryId form|delivery instance or form id
@return string[] ids of users | [
"Returns",
"the",
"ids",
"of",
"users",
"assigned",
"to",
"a",
"delivery"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/AssignmentAggregator/UnionAssignmentService.php#L63-L71 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.index | public function index(){
$user = common_session_SessionManager::getSession()->getUser();
/**
* Retrieve resumable deliveries (via delivery execution)
*/
$resumableData = array();
foreach ($this->getDeliveryServer()->getResumableDeliveries($user) as $de) {
$resumableData[] = DeliveryHelper::build... | php | public function index(){
$user = common_session_SessionManager::getSession()->getUser();
/**
* Retrieve resumable deliveries (via delivery execution)
*/
$resumableData = array();
foreach ($this->getDeliveryServer()->getResumableDeliveries($user) as $de) {
$resumableData[] = DeliveryHelper::build... | [
"public",
"function",
"index",
"(",
")",
"{",
"$",
"user",
"=",
"common_session_SessionManager",
"::",
"getSession",
"(",
")",
"->",
"getUser",
"(",
")",
";",
"/**\n\t\t * Retrieve resumable deliveries (via delivery execution)\n\t\t */",
"$",
"resumableData",
"=",
"arra... | Set a view with the list of process instances (both started or finished) and available process definitions
@access public
@author CRP Henri Tudor - TAO Team - {@link http://www.tao.lu}
@param processDefinitionUri
@return void
@throws \common_exception_Error | [
"Set",
"a",
"view",
"with",
"the",
"list",
"of",
"process",
"instances",
"(",
"both",
"started",
"or",
"finished",
")",
"and",
"available",
"process",
"definitions"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L91-L138 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.getViewDataFromRequest | protected function getViewDataFromRequest()
{
$lookupParams = ['warning', 'error'];
$result = [];
foreach ($lookupParams as $lookupParam) {
if ($this->getRequest()->hasParameter($lookupParam) && !empty($this->getRequest()->getParameter($lookupParam))) {
$result[] ... | php | protected function getViewDataFromRequest()
{
$lookupParams = ['warning', 'error'];
$result = [];
foreach ($lookupParams as $lookupParam) {
if ($this->getRequest()->hasParameter($lookupParam) && !empty($this->getRequest()->getParameter($lookupParam))) {
$result[] ... | [
"protected",
"function",
"getViewDataFromRequest",
"(",
")",
"{",
"$",
"lookupParams",
"=",
"[",
"'warning'",
",",
"'error'",
"]",
";",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"lookupParams",
"as",
"$",
"lookupParam",
")",
"{",
"if",
"(",... | Get data from request to be passed to renderer
@return array | [
"Get",
"data",
"from",
"request",
"to",
"be",
"passed",
"to",
"renderer"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L144-L158 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer._initDeliveryExecution | protected function _initDeliveryExecution() {
$compiledDelivery = new \core_kernel_classes_Resource(\tao_helpers_Uri::decode($this->getRequestParameter('uri')));
$user = common_session_SessionManager::getSession()->getUser();
$assignmentService = $this->getServiceLocator()->get(As... | php | protected function _initDeliveryExecution() {
$compiledDelivery = new \core_kernel_classes_Resource(\tao_helpers_Uri::decode($this->getRequestParameter('uri')));
$user = common_session_SessionManager::getSession()->getUser();
$assignmentService = $this->getServiceLocator()->get(As... | [
"protected",
"function",
"_initDeliveryExecution",
"(",
")",
"{",
"$",
"compiledDelivery",
"=",
"new",
"\\",
"core_kernel_classes_Resource",
"(",
"\\",
"tao_helpers_Uri",
"::",
"decode",
"(",
"$",
"this",
"->",
"getRequestParameter",
"(",
"'uri'",
")",
")",
")",
... | Init a delivery execution from the current delivery.
@throws common_exception_Unauthorized
@return DeliveryExecution the selected execution
@throws \common_exception_Error | [
"Init",
"a",
"delivery",
"execution",
"from",
"the",
"current",
"delivery",
"."
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L167-L185 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.initDeliveryExecution | public function initDeliveryExecution() {
try {
$deliveryExecution = $this->_initDeliveryExecution();
//if authorized we can move to this URL.
$this->redirect(_url('runDeliveryExecution', null, null, array('deliveryExecution' => $deliveryExecution->getIdentifier())));
... | php | public function initDeliveryExecution() {
try {
$deliveryExecution = $this->_initDeliveryExecution();
//if authorized we can move to this URL.
$this->redirect(_url('runDeliveryExecution', null, null, array('deliveryExecution' => $deliveryExecution->getIdentifier())));
... | [
"public",
"function",
"initDeliveryExecution",
"(",
")",
"{",
"try",
"{",
"$",
"deliveryExecution",
"=",
"$",
"this",
"->",
"_initDeliveryExecution",
"(",
")",
";",
"//if authorized we can move to this URL.",
"$",
"this",
"->",
"redirect",
"(",
"_url",
"(",
"'runD... | Init the selected delivery execution and forward to the execution screen | [
"Init",
"the",
"selected",
"delivery",
"execution",
"and",
"forward",
"to",
"the",
"execution",
"screen"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L191-L204 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.runDeliveryExecution | public function runDeliveryExecution() {
$deliveryExecution = $this->getCurrentDeliveryExecution();
// Sets the deliveryId to session.
if (!$this->hasSessionAttribute(DeliveryExecution::getDeliveryIdSessionKey($deliveryExecution->getIdentifier()))) {
$this->setSessionAttribute(
... | php | public function runDeliveryExecution() {
$deliveryExecution = $this->getCurrentDeliveryExecution();
// Sets the deliveryId to session.
if (!$this->hasSessionAttribute(DeliveryExecution::getDeliveryIdSessionKey($deliveryExecution->getIdentifier()))) {
$this->setSessionAttribute(
... | [
"public",
"function",
"runDeliveryExecution",
"(",
")",
"{",
"$",
"deliveryExecution",
"=",
"$",
"this",
"->",
"getCurrentDeliveryExecution",
"(",
")",
";",
"// Sets the deliveryId to session.",
"if",
"(",
"!",
"$",
"this",
"->",
"hasSessionAttribute",
"(",
"Deliver... | Displays the execution screen
@throws \common_Exception
@throws common_exception_Error
@throws common_exception_NotFound
@throws common_exception_Unauthorized | [
"Displays",
"the",
"execution",
"screen"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L214-L275 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.finishDeliveryExecution | public function finishDeliveryExecution() {
$deliveryExecution = $this->getCurrentDeliveryExecution();
if ($deliveryExecution->getUserIdentifier() == common_session_SessionManager::getSession()->getUserUri()) {
$stateService = $this->getServiceManager()->get(StateServiceInterface::SERVICE_ID);
... | php | public function finishDeliveryExecution() {
$deliveryExecution = $this->getCurrentDeliveryExecution();
if ($deliveryExecution->getUserIdentifier() == common_session_SessionManager::getSession()->getUserUri()) {
$stateService = $this->getServiceManager()->get(StateServiceInterface::SERVICE_ID);
... | [
"public",
"function",
"finishDeliveryExecution",
"(",
")",
"{",
"$",
"deliveryExecution",
"=",
"$",
"this",
"->",
"getCurrentDeliveryExecution",
"(",
")",
";",
"if",
"(",
"$",
"deliveryExecution",
"->",
"getUserIdentifier",
"(",
")",
"==",
"common_session_SessionMan... | Finish the delivery execution
@throws common_exception_Error
@throws common_exception_NotFound | [
"Finish",
"the",
"delivery",
"execution"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L283-L292 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.initResultServer | protected function initResultServer($compiledDelivery, $executionIdentifier, $userUri)
{
$this->getDeliveryServer()->initResultServer($compiledDelivery, $executionIdentifier, $userUri);
} | php | protected function initResultServer($compiledDelivery, $executionIdentifier, $userUri)
{
$this->getDeliveryServer()->initResultServer($compiledDelivery, $executionIdentifier, $userUri);
} | [
"protected",
"function",
"initResultServer",
"(",
"$",
"compiledDelivery",
",",
"$",
"executionIdentifier",
",",
"$",
"userUri",
")",
"{",
"$",
"this",
"->",
"getDeliveryServer",
"(",
")",
"->",
"initResultServer",
"(",
"$",
"compiledDelivery",
",",
"$",
"execut... | Initialize the result server using the delivery configuration and for this results session submission
@param $compiledDelivery
@param $executionIdentifier
@param $userUri | [
"Initialize",
"the",
"result",
"server",
"using",
"the",
"delivery",
"configuration",
"and",
"for",
"this",
"results",
"session",
"submission"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L301-L304 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.getReturnUrl | protected function getReturnUrl()
{
if($this->getServiceLocator()->has(ReturnUrlService::SERVICE_ID)){
$deliveryExecution = $this->getCurrentDeliveryExecution();
return $this->getServiceLocator()->get(ReturnUrlService::SERVICE_ID)->getReturnUrl($deliveryExecution->getIdentifier());
... | php | protected function getReturnUrl()
{
if($this->getServiceLocator()->has(ReturnUrlService::SERVICE_ID)){
$deliveryExecution = $this->getCurrentDeliveryExecution();
return $this->getServiceLocator()->get(ReturnUrlService::SERVICE_ID)->getReturnUrl($deliveryExecution->getIdentifier());
... | [
"protected",
"function",
"getReturnUrl",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"has",
"(",
"ReturnUrlService",
"::",
"SERVICE_ID",
")",
")",
"{",
"$",
"deliveryExecution",
"=",
"$",
"this",
"->",
"getCurrentDeliver... | Defines the returning URL in the top-right corner action menu
@return string
@throws common_exception_NotFound | [
"Defines",
"the",
"returning",
"URL",
"in",
"the",
"top",
"-",
"right",
"corner",
"action",
"menu"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L322-L329 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.verifyDeliveryStartAuthorized | protected function verifyDeliveryStartAuthorized($deliveryId)
{
$user = common_session_SessionManager::getSession()->getUser();
$this->getAuthorizationProvider()->verifyStartAuthorization($deliveryId, $user);
} | php | protected function verifyDeliveryStartAuthorized($deliveryId)
{
$user = common_session_SessionManager::getSession()->getUser();
$this->getAuthorizationProvider()->verifyStartAuthorization($deliveryId, $user);
} | [
"protected",
"function",
"verifyDeliveryStartAuthorized",
"(",
"$",
"deliveryId",
")",
"{",
"$",
"user",
"=",
"common_session_SessionManager",
"::",
"getSession",
"(",
")",
"->",
"getUser",
"(",
")",
";",
"$",
"this",
"->",
"getAuthorizationProvider",
"(",
")",
... | Verify if the start of the delivery is allowed.
Throws an exception if not
@param string $deliveryId
@throws UnAuthorizedException
@throws \common_exception_Error
@throws \common_exception_Unauthorized | [
"Verify",
"if",
"the",
"start",
"of",
"the",
"delivery",
"is",
"allowed",
".",
"Throws",
"an",
"exception",
"if",
"not"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L362-L366 |
oat-sa/extension-tao-delivery | controller/DeliveryServer.php | DeliveryServer.verifyDeliveryExecutionAuthorized | protected function verifyDeliveryExecutionAuthorized(DeliveryExecution $deliveryExecution)
{
$user = common_session_SessionManager::getSession()->getUser();
$this->getAuthorizationProvider()->verifyResumeAuthorization($deliveryExecution, $user);
} | php | protected function verifyDeliveryExecutionAuthorized(DeliveryExecution $deliveryExecution)
{
$user = common_session_SessionManager::getSession()->getUser();
$this->getAuthorizationProvider()->verifyResumeAuthorization($deliveryExecution, $user);
} | [
"protected",
"function",
"verifyDeliveryExecutionAuthorized",
"(",
"DeliveryExecution",
"$",
"deliveryExecution",
")",
"{",
"$",
"user",
"=",
"common_session_SessionManager",
"::",
"getSession",
"(",
")",
"->",
"getUser",
"(",
")",
";",
"$",
"this",
"->",
"getAuthor... | Check wether the delivery execution is authorized to run
Throws an exception if not
@param DeliveryExecution $deliveryExecution
@return boolean
@throws \common_exception_Unauthorized
@throws \common_exception_Error
@throws UnAuthorizedException | [
"Check",
"wether",
"the",
"delivery",
"execution",
"is",
"authorized",
"to",
"run",
"Throws",
"an",
"exception",
"if",
"not"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/DeliveryServer.php#L378-L382 |
oat-sa/extension-tao-delivery | controller/RestExecution.php | RestExecution.unstop | public function unstop()
{
try {
if ($this->getRequestMethod() != \Request::HTTP_POST) {
throw new \common_exception_NotImplemented('Only POST method is accepted to request this service.');
}
if (!$this->hasRequestParameter('deliveryExecution')) {
... | php | public function unstop()
{
try {
if ($this->getRequestMethod() != \Request::HTTP_POST) {
throw new \common_exception_NotImplemented('Only POST method is accepted to request this service.');
}
if (!$this->hasRequestParameter('deliveryExecution')) {
... | [
"public",
"function",
"unstop",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"getRequestMethod",
"(",
")",
"!=",
"\\",
"Request",
"::",
"HTTP_POST",
")",
"{",
"throw",
"new",
"\\",
"common_exception_NotImplemented",
"(",
"'Only POST method is accep... | Allows to resume terminated/finished executions | [
"Allows",
"to",
"resume",
"terminated",
"/",
"finished",
"executions"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/controller/RestExecution.php#L36-L70 |
oat-sa/extension-tao-delivery | model/container/LegacyRuntime.php | LegacyRuntime.getDeliveryContainer | public function getDeliveryContainer($deliveryId)
{
$dService = $this->getServiceLocator()->get(DeliveryServerService::SERVICE_ID);
$containerClass = $dService->getOption('deliveryContainer');
switch ($containerClass) {
case 'oat\\taoDelivery\\helper\\container\\DeliveryServiceCo... | php | public function getDeliveryContainer($deliveryId)
{
$dService = $this->getServiceLocator()->get(DeliveryServerService::SERVICE_ID);
$containerClass = $dService->getOption('deliveryContainer');
switch ($containerClass) {
case 'oat\\taoDelivery\\helper\\container\\DeliveryServiceCo... | [
"public",
"function",
"getDeliveryContainer",
"(",
"$",
"deliveryId",
")",
"{",
"$",
"dService",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"DeliveryServerService",
"::",
"SERVICE_ID",
")",
";",
"$",
"containerClass",
"=",
"$",
... | (non-PHPdoc)
@see \oat\taoDelivery\model\RuntimeService::getDeliveryContainer()
@throws \Zend\ServiceManager\Exception\ServiceNotFoundException | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/container/LegacyRuntime.php#L38-L55 |
oat-sa/extension-tao-delivery | model/execution/DeliveryExecution.php | DeliveryExecution.getLabel | public function getLabel()
{
/** @var DeliveryFieldsService $deliveryFieldsService */
$deliveryFieldsService = $this->getServiceLocator()->get(DeliveryFieldsService::SERVICE_ID);
$label = $deliveryFieldsService->getLabel(
$this->getImplementation()->getDelivery(),
$th... | php | public function getLabel()
{
/** @var DeliveryFieldsService $deliveryFieldsService */
$deliveryFieldsService = $this->getServiceLocator()->get(DeliveryFieldsService::SERVICE_ID);
$label = $deliveryFieldsService->getLabel(
$this->getImplementation()->getDelivery(),
$th... | [
"public",
"function",
"getLabel",
"(",
")",
"{",
"/** @var DeliveryFieldsService $deliveryFieldsService */",
"$",
"deliveryFieldsService",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"DeliveryFieldsService",
"::",
"SERVICE_ID",
")",
";",
"... | Returns a human readable test representation of the delivery execution
Should respect the current user's language
@return string
@throws \common_exception_NotFound | [
"Returns",
"a",
"human",
"readable",
"test",
"representation",
"of",
"the",
"delivery",
"execution",
"Should",
"respect",
"the",
"current",
"user",
"s",
"language"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/DeliveryExecution.php#L70-L79 |
oat-sa/extension-tao-delivery | model/execution/StateService.php | StateService.legacyTransition | public function legacyTransition(DeliveryExecution $deliveryExecution, $state)
{
switch ($state) {
case DeliveryExecution::STATE_FINISHED:
$result = $this->finish($deliveryExecution);
break;
case DeliveryExecution::STATE_ACTIVE:
$result... | php | public function legacyTransition(DeliveryExecution $deliveryExecution, $state)
{
switch ($state) {
case DeliveryExecution::STATE_FINISHED:
$result = $this->finish($deliveryExecution);
break;
case DeliveryExecution::STATE_ACTIVE:
$result... | [
"public",
"function",
"legacyTransition",
"(",
"DeliveryExecution",
"$",
"deliveryExecution",
",",
"$",
"state",
")",
"{",
"switch",
"(",
"$",
"state",
")",
"{",
"case",
"DeliveryExecution",
"::",
"STATE_FINISHED",
":",
"$",
"result",
"=",
"$",
"this",
"->",
... | Legacy function to ensure all calls to setState use
the correct transition instead
@param DeliveryExecution $deliveryExecution
@param string $state
@return bool
@throws \common_exception_NotFound | [
"Legacy",
"function",
"to",
"ensure",
"all",
"calls",
"to",
"setState",
"use",
"the",
"correct",
"transition",
"instead"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/StateService.php#L88-L105 |
oat-sa/extension-tao-delivery | model/execution/AbstractStateService.php | AbstractStateService.createDeliveryExecution | public function createDeliveryExecution($deliveryId, User $user, $label)
{
$status = $this->getInitialStatus($deliveryId, $user);
$deliveryExecution = $this->getStorageEngine()->spawnDeliveryExecution($label, $deliveryId, $user->getIdentifier(), $status);
// trigger event
$event = ne... | php | public function createDeliveryExecution($deliveryId, User $user, $label)
{
$status = $this->getInitialStatus($deliveryId, $user);
$deliveryExecution = $this->getStorageEngine()->spawnDeliveryExecution($label, $deliveryId, $user->getIdentifier(), $status);
// trigger event
$event = ne... | [
"public",
"function",
"createDeliveryExecution",
"(",
"$",
"deliveryId",
",",
"User",
"$",
"user",
",",
"$",
"label",
")",
"{",
"$",
"status",
"=",
"$",
"this",
"->",
"getInitialStatus",
"(",
"$",
"deliveryId",
",",
"$",
"user",
")",
";",
"$",
"deliveryE... | (non-PHPdoc)
@see \oat\taoDelivery\model\execution\StateServiceInterface::createDeliveryExecution() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/AbstractStateService.php#L64-L72 |
oat-sa/extension-tao-delivery | model/execution/OntologyService.php | OntologyService.getExecutionsByDelivery | public function getExecutionsByDelivery(core_kernel_classes_Resource $compiled)
{
$executionClass = new core_kernel_classes_Class(OntologyDeliveryExecution::CLASS_URI);
$resources = $executionClass->searchInstances(array(
OntologyDeliveryExecution::PROPERTY_DELIVERY => $compiled->getUri(... | php | public function getExecutionsByDelivery(core_kernel_classes_Resource $compiled)
{
$executionClass = new core_kernel_classes_Class(OntologyDeliveryExecution::CLASS_URI);
$resources = $executionClass->searchInstances(array(
OntologyDeliveryExecution::PROPERTY_DELIVERY => $compiled->getUri(... | [
"public",
"function",
"getExecutionsByDelivery",
"(",
"core_kernel_classes_Resource",
"$",
"compiled",
")",
"{",
"$",
"executionClass",
"=",
"new",
"core_kernel_classes_Class",
"(",
"OntologyDeliveryExecution",
"::",
"CLASS_URI",
")",
";",
"$",
"resources",
"=",
"$",
... | (non-PHPdoc)
@see Service::getExecutionsByDelivery()
@param core_kernel_classes_Resource $compiled
@return DeliveryExecution[] | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyService.php#L47-L60 |
oat-sa/extension-tao-delivery | model/execution/OntologyService.php | OntologyService.getUserExecutions | public function getUserExecutions(core_kernel_classes_Resource $compiled, $userUri)
{
$executionClass = new core_kernel_classes_Class(OntologyDeliveryExecution::CLASS_URI);
$instances = $executionClass->searchInstances(array(
OntologyDeliveryExecution::PROPERTY_SUBJECT => $userUri,
... | php | public function getUserExecutions(core_kernel_classes_Resource $compiled, $userUri)
{
$executionClass = new core_kernel_classes_Class(OntologyDeliveryExecution::CLASS_URI);
$instances = $executionClass->searchInstances(array(
OntologyDeliveryExecution::PROPERTY_SUBJECT => $userUri,
... | [
"public",
"function",
"getUserExecutions",
"(",
"core_kernel_classes_Resource",
"$",
"compiled",
",",
"$",
"userUri",
")",
"{",
"$",
"executionClass",
"=",
"new",
"core_kernel_classes_Class",
"(",
"OntologyDeliveryExecution",
"::",
"CLASS_URI",
")",
";",
"$",
"instanc... | (non-PHPdoc)
@see Service::getUserExecutions() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyService.php#L81-L95 |
oat-sa/extension-tao-delivery | model/execution/OntologyService.php | OntologyService.spawnDeliveryExecution | public function spawnDeliveryExecution($label, $deliveryId, $userId, $status)
{
$executionClass = new core_kernel_classes_Class(OntologyDeliveryExecution::CLASS_URI);
$execution = $executionClass->createInstanceWithProperties(array(
OntologyRdfs::RDFS_LABEL => $label,
... | php | public function spawnDeliveryExecution($label, $deliveryId, $userId, $status)
{
$executionClass = new core_kernel_classes_Class(OntologyDeliveryExecution::CLASS_URI);
$execution = $executionClass->createInstanceWithProperties(array(
OntologyRdfs::RDFS_LABEL => $label,
... | [
"public",
"function",
"spawnDeliveryExecution",
"(",
"$",
"label",
",",
"$",
"deliveryId",
",",
"$",
"userId",
",",
"$",
"status",
")",
"{",
"$",
"executionClass",
"=",
"new",
"core_kernel_classes_Class",
"(",
"OntologyDeliveryExecution",
"::",
"CLASS_URI",
")",
... | Spawn a new Delivery Execution
@param string $label
@param string $deliveryId
@param string $userId
@param string $status
@return \oat\taoDelivery\model\execution\DeliveryExecution | [
"Spawn",
"a",
"new",
"Delivery",
"Execution"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyService.php#L122-L133 |
oat-sa/extension-tao-delivery | model/execution/DeliveryServerService.php | DeliveryServerService.getResumableDeliveries | public function getResumableDeliveries(User $user)
{
$deliveryExecutionService = ServiceProxy::singleton();
$resumable = array();
foreach ($this->getResumableStates() as $state) {
foreach ($deliveryExecutionService->getDeliveryExecutionsByStatus($user->getIdentifier(), $state) as... | php | public function getResumableDeliveries(User $user)
{
$deliveryExecutionService = ServiceProxy::singleton();
$resumable = array();
foreach ($this->getResumableStates() as $state) {
foreach ($deliveryExecutionService->getDeliveryExecutionsByStatus($user->getIdentifier(), $state) as... | [
"public",
"function",
"getResumableDeliveries",
"(",
"User",
"$",
"user",
")",
"{",
"$",
"deliveryExecutionService",
"=",
"ServiceProxy",
"::",
"singleton",
"(",
")",
";",
"$",
"resumable",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"g... | Get resumable (active) deliveries.
@param User $user User instance. If not given then all deliveries will be returned regardless of user URI.
@return \oat\taoDelivery\model\execution\DeliveryExecution [] | [
"Get",
"resumable",
"(",
"active",
")",
"deliveries",
"."
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/DeliveryServerService.php#L69-L82 |
oat-sa/extension-tao-delivery | model/execution/DeliveryServerService.php | DeliveryServerService.initResultServer | public function initResultServer($compiledDelivery, $executionIdentifier, $userUri) {
$this->getServiceManager()->get(\oat\taoResultServer\models\classes\ResultServerService::SERVICE_ID)
->initResultServer($compiledDelivery, $executionIdentifier, $userUri);
} | php | public function initResultServer($compiledDelivery, $executionIdentifier, $userUri) {
$this->getServiceManager()->get(\oat\taoResultServer\models\classes\ResultServerService::SERVICE_ID)
->initResultServer($compiledDelivery, $executionIdentifier, $userUri);
} | [
"public",
"function",
"initResultServer",
"(",
"$",
"compiledDelivery",
",",
"$",
"executionIdentifier",
",",
"$",
"userUri",
")",
"{",
"$",
"this",
"->",
"getServiceManager",
"(",
")",
"->",
"get",
"(",
"\\",
"oat",
"\\",
"taoResultServer",
"\\",
"models",
... | Initialize the result server for a given execution
@param $compiledDelivery
@param string $executionIdentifier | [
"Initialize",
"the",
"result",
"server",
"for",
"a",
"given",
"execution"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/DeliveryServerService.php#L90-L93 |
oat-sa/extension-tao-delivery | model/execution/DeliveryServerService.php | DeliveryServerService.getDeliveryContainer | public function getDeliveryContainer(DeliveryExecution $deliveryExecution)
{
$runtimeService = $this->getServiceLocator()->get(RuntimeService::SERVICE_ID);
$deliveryContainer = $runtimeService->getDeliveryContainer($deliveryExecution->getDelivery()->getUri());
return $deliveryContainer->getE... | php | public function getDeliveryContainer(DeliveryExecution $deliveryExecution)
{
$runtimeService = $this->getServiceLocator()->get(RuntimeService::SERVICE_ID);
$deliveryContainer = $runtimeService->getDeliveryContainer($deliveryExecution->getDelivery()->getUri());
return $deliveryContainer->getE... | [
"public",
"function",
"getDeliveryContainer",
"(",
"DeliveryExecution",
"$",
"deliveryExecution",
")",
"{",
"$",
"runtimeService",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(",
")",
"->",
"get",
"(",
"RuntimeService",
"::",
"SERVICE_ID",
")",
";",
"$",
"deli... | Returns the container for the delivery execution
@param DeliveryExecution $deliveryExecution
@return ExecutionContainer
@throws common_Exception | [
"Returns",
"the",
"container",
"for",
"the",
"delivery",
"execution"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/DeliveryServerService.php#L102-L107 |
oat-sa/extension-tao-delivery | model/execution/OntologyDeliveryExecution.php | OntologyDeliveryExecution.getStartTime | public function getStartTime() {
if (!isset($this->startTime)) {
$this->startTime = (string)$this->getData(OntologyDeliveryExecution::PROPERTY_TIME_START);
}
return $this->startTime;
} | php | public function getStartTime() {
if (!isset($this->startTime)) {
$this->startTime = (string)$this->getData(OntologyDeliveryExecution::PROPERTY_TIME_START);
}
return $this->startTime;
} | [
"public",
"function",
"getStartTime",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"startTime",
")",
")",
"{",
"$",
"this",
"->",
"startTime",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"getData",
"(",
"OntologyDeliveryExecution",
"... | (non-PHPdoc)
@see DeliveryExecution::getStartTime()
@throws \common_exception_NotFound | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyDeliveryExecution.php#L68-L73 |
oat-sa/extension-tao-delivery | model/execution/OntologyDeliveryExecution.php | OntologyDeliveryExecution.getFinishTime | public function getFinishTime() {
if (!isset($this->finishTime)) {
try {
$this->finishTime = (string)$this->getData(OntologyDeliveryExecution::PROPERTY_TIME_END);
} catch (common_exception_NotFound $missingException) {
$this->finishTime = null;
... | php | public function getFinishTime() {
if (!isset($this->finishTime)) {
try {
$this->finishTime = (string)$this->getData(OntologyDeliveryExecution::PROPERTY_TIME_END);
} catch (common_exception_NotFound $missingException) {
$this->finishTime = null;
... | [
"public",
"function",
"getFinishTime",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"finishTime",
")",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"finishTime",
"=",
"(",
"string",
")",
"$",
"this",
"->",
"getData",
"(",
"OntologyDeli... | (non-PHPdoc)
@see DeliveryExecution::getFinishTime() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyDeliveryExecution.php#L80-L89 |
oat-sa/extension-tao-delivery | model/execution/OntologyDeliveryExecution.php | OntologyDeliveryExecution.getState | public function getState() {
if (!isset($this->state)) {
$state = $this->getData(OntologyDeliveryExecution::PROPERTY_STATUS);
if (!$state instanceof core_kernel_classes_Resource) {
$state = $this->getResource((string)$state);
}
$this->state = $stat... | php | public function getState() {
if (!isset($this->state)) {
$state = $this->getData(OntologyDeliveryExecution::PROPERTY_STATUS);
if (!$state instanceof core_kernel_classes_Resource) {
$state = $this->getResource((string)$state);
}
$this->state = $stat... | [
"public",
"function",
"getState",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"state",
")",
")",
"{",
"$",
"state",
"=",
"$",
"this",
"->",
"getData",
"(",
"OntologyDeliveryExecution",
"::",
"PROPERTY_STATUS",
")",
";",
"if",
"(",
... | (non-PHPdoc)
@see DeliveryExecution::getState() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyDeliveryExecution.php#L95-L104 |
oat-sa/extension-tao-delivery | model/execution/OntologyDeliveryExecution.php | OntologyDeliveryExecution.getDelivery | public function getDelivery() {
if (!isset($this->delivery)) {
$this->delivery = $this->getData(OntologyDeliveryExecution::PROPERTY_DELIVERY);
}
return $this->delivery;
} | php | public function getDelivery() {
if (!isset($this->delivery)) {
$this->delivery = $this->getData(OntologyDeliveryExecution::PROPERTY_DELIVERY);
}
return $this->delivery;
} | [
"public",
"function",
"getDelivery",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"delivery",
")",
")",
"{",
"$",
"this",
"->",
"delivery",
"=",
"$",
"this",
"->",
"getData",
"(",
"OntologyDeliveryExecution",
"::",
"PROPERTY_DELIVERY",
... | (non-PHPdoc)
@see DeliveryExecution::getDelivery() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyDeliveryExecution.php#L110-L115 |
oat-sa/extension-tao-delivery | model/execution/OntologyDeliveryExecution.php | OntologyDeliveryExecution.getUserIdentifier | public function getUserIdentifier() {
if (!isset($this->userIdentifier)) {
$user = $this->getData(OntologyDeliveryExecution::PROPERTY_SUBJECT);
$this->userIdentifier = ($user instanceof core_kernel_classes_Resource) ? $user->getUri() : (string)$user;
}
return $this->user... | php | public function getUserIdentifier() {
if (!isset($this->userIdentifier)) {
$user = $this->getData(OntologyDeliveryExecution::PROPERTY_SUBJECT);
$this->userIdentifier = ($user instanceof core_kernel_classes_Resource) ? $user->getUri() : (string)$user;
}
return $this->user... | [
"public",
"function",
"getUserIdentifier",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"userIdentifier",
")",
")",
"{",
"$",
"user",
"=",
"$",
"this",
"->",
"getData",
"(",
"OntologyDeliveryExecution",
"::",
"PROPERTY_SUBJECT",
")",
";"... | (non-PHPdoc)
@see DeliveryExecution::getUserIdentifier() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyDeliveryExecution.php#L121-L127 |
oat-sa/extension-tao-delivery | model/execution/OntologyDeliveryExecution.php | OntologyDeliveryExecution.setState | public function setState($state) {
$statusProp = $this->getProperty(OntologyDeliveryExecution::PROPERTY_STATUS);
$state = $this->getResource($state);
$currentStatus = $this->getState();
if ($currentStatus->getUri() == $state->getUri()) {
common_Logger::w('Delivery execution '... | php | public function setState($state) {
$statusProp = $this->getProperty(OntologyDeliveryExecution::PROPERTY_STATUS);
$state = $this->getResource($state);
$currentStatus = $this->getState();
if ($currentStatus->getUri() == $state->getUri()) {
common_Logger::w('Delivery execution '... | [
"public",
"function",
"setState",
"(",
"$",
"state",
")",
"{",
"$",
"statusProp",
"=",
"$",
"this",
"->",
"getProperty",
"(",
"OntologyDeliveryExecution",
"::",
"PROPERTY_STATUS",
")",
";",
"$",
"state",
"=",
"$",
"this",
"->",
"getResource",
"(",
"$",
"st... | (non-PHPdoc)
@see DeliveryExecution::setState() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/OntologyDeliveryExecution.php#L133-L147 |
oat-sa/extension-tao-delivery | model/execution/Counter/DeliveryExecutionCounterService.php | DeliveryExecutionCounterService.count | public function count($statusUri)
{
$persistence = $this->getPersistence();
$key = $this->getStatusKey($statusUri);
return intval($persistence->get($key));
} | php | public function count($statusUri)
{
$persistence = $this->getPersistence();
$key = $this->getStatusKey($statusUri);
return intval($persistence->get($key));
} | [
"public",
"function",
"count",
"(",
"$",
"statusUri",
")",
"{",
"$",
"persistence",
"=",
"$",
"this",
"->",
"getPersistence",
"(",
")",
";",
"$",
"key",
"=",
"$",
"this",
"->",
"getStatusKey",
"(",
"$",
"statusUri",
")",
";",
"return",
"intval",
"(",
... | Get number of delivery executions of given status.
@param $statusUri
@return integer | [
"Get",
"number",
"of",
"delivery",
"executions",
"of",
"given",
"status",
"."
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/Counter/DeliveryExecutionCounterService.php#L43-L48 |
oat-sa/extension-tao-delivery | model/execution/KVDeliveryExecution.php | KVDeliveryExecution.getFinishTime | public function getFinishTime()
{
if ($this->hasData(OntologyDeliveryExecution::PROPERTY_TIME_END)) {
return $this->getData(OntologyDeliveryExecution::PROPERTY_TIME_END);
}
return null;
} | php | public function getFinishTime()
{
if ($this->hasData(OntologyDeliveryExecution::PROPERTY_TIME_END)) {
return $this->getData(OntologyDeliveryExecution::PROPERTY_TIME_END);
}
return null;
} | [
"public",
"function",
"getFinishTime",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasData",
"(",
"OntologyDeliveryExecution",
"::",
"PROPERTY_TIME_END",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getData",
"(",
"OntologyDeliveryExecution",
"::",
"PROPERTY_T... | (non-PHPdoc)
@see DeliveryExecutionInterface::getFinishTime() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/KVDeliveryExecution.php#L82-L88 |
oat-sa/extension-tao-delivery | model/execution/KVDeliveryExecution.php | KVDeliveryExecution.setState | public function setState($state)
{
$oldState = $this->getState()->getUri();
if ($oldState == $state) {
common_Logger::w('Delivery execution ' . $this->getIdentifier() . ' already in state ' . $state);
return false;
}
$this->setData(OntologyDeliveryExecution::P... | php | public function setState($state)
{
$oldState = $this->getState()->getUri();
if ($oldState == $state) {
common_Logger::w('Delivery execution ' . $this->getIdentifier() . ' already in state ' . $state);
return false;
}
$this->setData(OntologyDeliveryExecution::P... | [
"public",
"function",
"setState",
"(",
"$",
"state",
")",
"{",
"$",
"oldState",
"=",
"$",
"this",
"->",
"getState",
"(",
")",
"->",
"getUri",
"(",
")",
";",
"if",
"(",
"$",
"oldState",
"==",
"$",
"state",
")",
"{",
"common_Logger",
"::",
"w",
"(",
... | (non-PHPdoc)
@see DeliveryExecutionInterface::setState() | [
"(",
"non",
"-",
"PHPdoc",
")"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/KVDeliveryExecution.php#L134-L146 |
oat-sa/extension-tao-delivery | model/Assignment.php | Assignment.getLabel | public function getLabel()
{
/** @var DeliveryFieldsService $deliveryFieldsService */
$deliveryFieldsService = ServiceManager::getServiceManager()->get(DeliveryFieldsService::SERVICE_ID);
$delivery = $this->getResource($this->getDeliveryId());
$label = $deliveryFieldsService->getLabe... | php | public function getLabel()
{
/** @var DeliveryFieldsService $deliveryFieldsService */
$deliveryFieldsService = ServiceManager::getServiceManager()->get(DeliveryFieldsService::SERVICE_ID);
$delivery = $this->getResource($this->getDeliveryId());
$label = $deliveryFieldsService->getLabe... | [
"public",
"function",
"getLabel",
"(",
")",
"{",
"/** @var DeliveryFieldsService $deliveryFieldsService */",
"$",
"deliveryFieldsService",
"=",
"ServiceManager",
"::",
"getServiceManager",
"(",
")",
"->",
"get",
"(",
"DeliveryFieldsService",
"::",
"SERVICE_ID",
")",
";",
... | Returns the label of the asignment, which will often correspond
to the label of the delivery
@return string | [
"Returns",
"the",
"label",
"of",
"the",
"asignment",
"which",
"will",
"often",
"correspond",
"to",
"the",
"label",
"of",
"the",
"delivery"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/Assignment.php#L81-L91 |
oat-sa/extension-tao-delivery | model/fields/DeliveryFieldsService.php | DeliveryFieldsService.getLabel | public function getLabel(\core_kernel_classes_Resource $delivery, $label = '')
{
$user = \common_session_SessionManager::getSession()->getUser();
$customLabelRoles = $this->getOption(self::PROPERTY_CUSTOM_LABEL);
if (array_intersect($customLabelRoles, $user->getRoles())) {
$... | php | public function getLabel(\core_kernel_classes_Resource $delivery, $label = '')
{
$user = \common_session_SessionManager::getSession()->getUser();
$customLabelRoles = $this->getOption(self::PROPERTY_CUSTOM_LABEL);
if (array_intersect($customLabelRoles, $user->getRoles())) {
$... | [
"public",
"function",
"getLabel",
"(",
"\\",
"core_kernel_classes_Resource",
"$",
"delivery",
",",
"$",
"label",
"=",
"''",
")",
"{",
"$",
"user",
"=",
"\\",
"common_session_SessionManager",
"::",
"getSession",
"(",
")",
"->",
"getUser",
"(",
")",
";",
"$",
... | Getting custom label from Delivery
@param \core_kernel_classes_Resource $delivery
@param string $label
@return string | [
"Getting",
"custom",
"label",
"from",
"Delivery"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/fields/DeliveryFieldsService.php#L49-L60 |
oat-sa/extension-tao-delivery | models/classes/ReturnUrlService.php | ReturnUrlService.getReturnUrl | public function getReturnUrl($deliveryExecutionUri = '')
{
$ext = ($this->hasOption(self::EXTENSION_OPTION))? $this->getOption(self::EXTENSION_OPTION) : 'taoDelivery';
$ctrl = ($this->hasOption(self::CONTROLLER_OPTION))? $this->getOption(self::CONTROLLER_OPTION) : 'DeliveryServer';
$metho... | php | public function getReturnUrl($deliveryExecutionUri = '')
{
$ext = ($this->hasOption(self::EXTENSION_OPTION))? $this->getOption(self::EXTENSION_OPTION) : 'taoDelivery';
$ctrl = ($this->hasOption(self::CONTROLLER_OPTION))? $this->getOption(self::CONTROLLER_OPTION) : 'DeliveryServer';
$metho... | [
"public",
"function",
"getReturnUrl",
"(",
"$",
"deliveryExecutionUri",
"=",
"''",
")",
"{",
"$",
"ext",
"=",
"(",
"$",
"this",
"->",
"hasOption",
"(",
"self",
"::",
"EXTENSION_OPTION",
")",
")",
"?",
"$",
"this",
"->",
"getOption",
"(",
"self",
"::",
... | Get the full url to go at the end of a test
@param string $deliveryExecutionUri in case we need it in the params
@return string the full url | [
"Get",
"the",
"full",
"url",
"to",
"go",
"at",
"the",
"end",
"of",
"a",
"test"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/models/classes/ReturnUrlService.php#L40-L51 |
oat-sa/extension-tao-delivery | model/authorization/strategy/AuthorizationAggregator.php | AuthorizationAggregator.verifyStartAuthorization | public function verifyStartAuthorization($deliveryId, User $user)
{
foreach ($this->getProviders() as $provider) {
$provider->verifyStartAuthorization($deliveryId, $user);
}
} | php | public function verifyStartAuthorization($deliveryId, User $user)
{
foreach ($this->getProviders() as $provider) {
$provider->verifyStartAuthorization($deliveryId, $user);
}
} | [
"public",
"function",
"verifyStartAuthorization",
"(",
"$",
"deliveryId",
",",
"User",
"$",
"user",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getProviders",
"(",
")",
"as",
"$",
"provider",
")",
"{",
"$",
"provider",
"->",
"verifyStartAuthorization",
"("... | Verify that a given delivery is allowed to be started
@param string $deliveryId
@throws \common_exception_Unauthorized | [
"Verify",
"that",
"a",
"given",
"delivery",
"is",
"allowed",
"to",
"be",
"started"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/authorization/strategy/AuthorizationAggregator.php#L57-L62 |
oat-sa/extension-tao-delivery | model/authorization/strategy/AuthorizationAggregator.php | AuthorizationAggregator.verifyResumeAuthorization | public function verifyResumeAuthorization(DeliveryExecutionInterface $deliveryExecution, User $user)
{
foreach ($this->getProviders() as $provider) {
$provider->verifyResumeAuthorization($deliveryExecution, $user);
}
$this->getServiceManager()->get(EventManager::SERVICE_ID)->trig... | php | public function verifyResumeAuthorization(DeliveryExecutionInterface $deliveryExecution, User $user)
{
foreach ($this->getProviders() as $provider) {
$provider->verifyResumeAuthorization($deliveryExecution, $user);
}
$this->getServiceManager()->get(EventManager::SERVICE_ID)->trig... | [
"public",
"function",
"verifyResumeAuthorization",
"(",
"DeliveryExecutionInterface",
"$",
"deliveryExecution",
",",
"User",
"$",
"user",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getProviders",
"(",
")",
"as",
"$",
"provider",
")",
"{",
"$",
"provider",
"... | Verify that a given delivery execution is allowed to be executed
@param DeliveryExecutionInterface $deliveryExecution
@param User $user | [
"Verify",
"that",
"a",
"given",
"delivery",
"execution",
"is",
"allowed",
"to",
"be",
"executed"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/authorization/strategy/AuthorizationAggregator.php#L70-L76 |
oat-sa/extension-tao-delivery | model/authorization/strategy/AuthorizationAggregator.php | AuthorizationAggregator.getProviders | protected function getProviders()
{
if (is_null($this->providers)) {
$this->providers = array();
if ($this->hasOption(self::OPTION_PROVIDERS)) {
foreach ($this->getOption(self::OPTION_PROVIDERS) as $provider) {
if ($provider instanceof ServiceLocat... | php | protected function getProviders()
{
if (is_null($this->providers)) {
$this->providers = array();
if ($this->hasOption(self::OPTION_PROVIDERS)) {
foreach ($this->getOption(self::OPTION_PROVIDERS) as $provider) {
if ($provider instanceof ServiceLocat... | [
"protected",
"function",
"getProviders",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"providers",
")",
")",
"{",
"$",
"this",
"->",
"providers",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasOption",
"(",
"self",
"... | Returns a list of providers that need to be verified
@return AuthorizationProvider[] | [
"Returns",
"a",
"list",
"of",
"providers",
"that",
"need",
"to",
"be",
"verified"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/authorization/strategy/AuthorizationAggregator.php#L83-L97 |
oat-sa/extension-tao-delivery | model/authorization/strategy/AuthorizationAggregator.php | AuthorizationAggregator.addProvider | public function addProvider(AuthorizationProvider $provider)
{
$providers = $this->getOption(self::OPTION_PROVIDERS);
$providers[] = $provider;
$this->setOption(self::OPTION_PROVIDERS, $providers);
} | php | public function addProvider(AuthorizationProvider $provider)
{
$providers = $this->getOption(self::OPTION_PROVIDERS);
$providers[] = $provider;
$this->setOption(self::OPTION_PROVIDERS, $providers);
} | [
"public",
"function",
"addProvider",
"(",
"AuthorizationProvider",
"$",
"provider",
")",
"{",
"$",
"providers",
"=",
"$",
"this",
"->",
"getOption",
"(",
"self",
"::",
"OPTION_PROVIDERS",
")",
";",
"$",
"providers",
"[",
"]",
"=",
"$",
"provider",
";",
"$"... | Add an additional authorization provider that needs
to be satisfied as well
@param AuthorizationProvider $provider | [
"Add",
"an",
"additional",
"authorization",
"provider",
"that",
"needs",
"to",
"be",
"satisfied",
"as",
"well"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/authorization/strategy/AuthorizationAggregator.php#L105-L110 |
oat-sa/extension-tao-delivery | model/authorization/strategy/AuthorizationAggregator.php | AuthorizationAggregator.unregister | public function unregister($providerClass)
{
$providers = $this->getOption(self::OPTION_PROVIDERS);
foreach ($providers as $key => $provider) {
if (get_class($provider) == $providerClass) {
unset($providers[$key]);
}
}
$this->setOption(self::OP... | php | public function unregister($providerClass)
{
$providers = $this->getOption(self::OPTION_PROVIDERS);
foreach ($providers as $key => $provider) {
if (get_class($provider) == $providerClass) {
unset($providers[$key]);
}
}
$this->setOption(self::OP... | [
"public",
"function",
"unregister",
"(",
"$",
"providerClass",
")",
"{",
"$",
"providers",
"=",
"$",
"this",
"->",
"getOption",
"(",
"self",
"::",
"OPTION_PROVIDERS",
")",
";",
"foreach",
"(",
"$",
"providers",
"as",
"$",
"key",
"=>",
"$",
"provider",
")... | Remove an existing authorization provider, identified by
exact class
@param $providerClass
@internal param AuthorizationProvider $provider | [
"Remove",
"an",
"existing",
"authorization",
"provider",
"identified",
"by",
"exact",
"class"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/authorization/strategy/AuthorizationAggregator.php#L119-L128 |
oat-sa/extension-tao-delivery | model/execution/rds/RdsDeliveryExecutionService.php | RdsDeliveryExecutionService.getExecutionsByDelivery | public function getExecutionsByDelivery(core_kernel_classes_Resource $compiled)
{
$query = $this->getQueryBuilder()
->select("*")
->from(self::TABLE_NAME)
->where(self::COLUMN_DELIVERY_ID . " = :deliveryId")
->setParameter("deliveryId", $compiled->getUri())
... | php | public function getExecutionsByDelivery(core_kernel_classes_Resource $compiled)
{
$query = $this->getQueryBuilder()
->select("*")
->from(self::TABLE_NAME)
->where(self::COLUMN_DELIVERY_ID . " = :deliveryId")
->setParameter("deliveryId", $compiled->getUri())
... | [
"public",
"function",
"getExecutionsByDelivery",
"(",
"core_kernel_classes_Resource",
"$",
"compiled",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"select",
"(",
"\"*\"",
")",
"->",
"from",
"(",
"self",
"::",
"TABLE_NAME"... | Returns the delivery executions for a compiled directory
@param core_kernel_classes_Resource $compiled
@return DeliveryExecution[] | [
"Returns",
"the",
"delivery",
"executions",
"for",
"a",
"compiled",
"directory"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/rds/RdsDeliveryExecutionService.php#L72-L84 |
oat-sa/extension-tao-delivery | model/execution/rds/RdsDeliveryExecutionService.php | RdsDeliveryExecutionService.getUserExecutions | public function getUserExecutions(core_kernel_classes_Resource $assembly, $userUri)
{
$query = $this->getQueryBuilder()
->select("*")
->from(self::TABLE_NAME)
->where(self::COLUMN_DELIVERY_ID . " = :deliveryId")
->andWhere(self::COLUMN_USER_ID . " = :userId")
... | php | public function getUserExecutions(core_kernel_classes_Resource $assembly, $userUri)
{
$query = $this->getQueryBuilder()
->select("*")
->from(self::TABLE_NAME)
->where(self::COLUMN_DELIVERY_ID . " = :deliveryId")
->andWhere(self::COLUMN_USER_ID . " = :userId")
... | [
"public",
"function",
"getUserExecutions",
"(",
"core_kernel_classes_Resource",
"$",
"assembly",
",",
"$",
"userUri",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"select",
"(",
"\"*\"",
")",
"->",
"from",
"(",
"self",
... | Returns the executions the user has of a specified assembly
@param core_kernel_classes_Resource $assembly
@param string $userUri
@return DeliveryExecution[] | [
"Returns",
"the",
"executions",
"the",
"user",
"has",
"of",
"a",
"specified",
"assembly"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/rds/RdsDeliveryExecutionService.php#L93-L107 |
oat-sa/extension-tao-delivery | model/execution/rds/RdsDeliveryExecutionService.php | RdsDeliveryExecutionService.getDeliveryExecutionsByStatus | public function getDeliveryExecutionsByStatus($userUri, $status)
{
$query = $this->getQueryBuilder()
->select("*")
->from(self::TABLE_NAME)
->where(self::COLUMN_USER_ID . " = :userId")
->andWhere(self::COLUMN_STATUS . " = :status")
->setParameter("... | php | public function getDeliveryExecutionsByStatus($userUri, $status)
{
$query = $this->getQueryBuilder()
->select("*")
->from(self::TABLE_NAME)
->where(self::COLUMN_USER_ID . " = :userId")
->andWhere(self::COLUMN_STATUS . " = :status")
->setParameter("... | [
"public",
"function",
"getDeliveryExecutionsByStatus",
"(",
"$",
"userUri",
",",
"$",
"status",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"select",
"(",
"\"*\"",
")",
"->",
"from",
"(",
"self",
"::",
"TABLE_NAME",
... | Returns all Delivery Executions of a User with a specific status
@param string $userUri
@param string $status
@return array | [
"Returns",
"all",
"Delivery",
"Executions",
"of",
"a",
"User",
"with",
"a",
"specific",
"status"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/rds/RdsDeliveryExecutionService.php#L116-L130 |
oat-sa/extension-tao-delivery | model/execution/rds/RdsDeliveryExecutionService.php | RdsDeliveryExecutionService.initDeliveryExecution | public function initDeliveryExecution(core_kernel_classes_Resource $assembly, $user)
{
return $this->spawnDeliveryExecution(
$assembly->getLabel(),
$assembly->getUri(),
$user,
DeliveryExecution::STATE_ACTIVE
);
} | php | public function initDeliveryExecution(core_kernel_classes_Resource $assembly, $user)
{
return $this->spawnDeliveryExecution(
$assembly->getLabel(),
$assembly->getUri(),
$user,
DeliveryExecution::STATE_ACTIVE
);
} | [
"public",
"function",
"initDeliveryExecution",
"(",
"core_kernel_classes_Resource",
"$",
"assembly",
",",
"$",
"user",
")",
"{",
"return",
"$",
"this",
"->",
"spawnDeliveryExecution",
"(",
"$",
"assembly",
"->",
"getLabel",
"(",
")",
",",
"$",
"assembly",
"->",
... | Generate a new delivery execution
@deprecated
@param core_kernel_classes_Resource $assembly
@param User $user
@return DeliveryExecution the delivery execution
@throws \common_exception_Error | [
"Generate",
"a",
"new",
"delivery",
"execution"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/rds/RdsDeliveryExecutionService.php#L165-L173 |
oat-sa/extension-tao-delivery | model/execution/rds/RdsDeliveryExecutionService.php | RdsDeliveryExecutionService.getDeliveryExecution | public function getDeliveryExecution($identifier)
{
$query = $this->getQueryBuilder()
->select("*")
->from(self::TABLE_NAME)
->where(self::COLUMN_ID . " = :id")
->setParameter("id", $identifier)
;
$result = $query->execute()->fetch();
... | php | public function getDeliveryExecution($identifier)
{
$query = $this->getQueryBuilder()
->select("*")
->from(self::TABLE_NAME)
->where(self::COLUMN_ID . " = :id")
->setParameter("id", $identifier)
;
$result = $query->execute()->fetch();
... | [
"public",
"function",
"getDeliveryExecution",
"(",
"$",
"identifier",
")",
"{",
"$",
"query",
"=",
"$",
"this",
"->",
"getQueryBuilder",
"(",
")",
"->",
"select",
"(",
"\"*\"",
")",
"->",
"from",
"(",
"self",
"::",
"TABLE_NAME",
")",
"->",
"where",
"(",
... | Returns the delivery execution instance associated to the implementation
@param string $identifier
@return DeliveryExecution
@throws \common_exception_Error | [
"Returns",
"the",
"delivery",
"execution",
"instance",
"associated",
"to",
"the",
"implementation"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/rds/RdsDeliveryExecutionService.php#L182-L198 |
oat-sa/extension-tao-delivery | model/execution/rds/RdsDeliveryExecutionService.php | RdsDeliveryExecutionService.updateDeliveryExecutionState | public function updateDeliveryExecutionState($identifier, $fromState, $toState)
{
try {
if ($fromState === $toState) {
// do nothing, when the state didn't change
return true;
}
$query = $this->getQueryBuilder()
->update(se... | php | public function updateDeliveryExecutionState($identifier, $fromState, $toState)
{
try {
if ($fromState === $toState) {
// do nothing, when the state didn't change
return true;
}
$query = $this->getQueryBuilder()
->update(se... | [
"public",
"function",
"updateDeliveryExecutionState",
"(",
"$",
"identifier",
",",
"$",
"fromState",
",",
"$",
"toState",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"fromState",
"===",
"$",
"toState",
")",
"{",
"// do nothing, when the state didn't change",
"return",
... | Updates the state of the given deliveryexecution
@param string $identifier the ID of the delivery execution
@param core_kernel_classes_Resource $fromState the original state
@param string $toState the desired state
@return bool ... | [
"Updates",
"the",
"state",
"of",
"the",
"given",
"deliveryexecution"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/rds/RdsDeliveryExecutionService.php#L208-L236 |
oat-sa/extension-tao-delivery | model/execution/rds/RdsDeliveryExecutionService.php | RdsDeliveryExecutionService.parseQueryResult | private function parseQueryResult($result = [])
{
$rdsDeliveryExecution = new RdsDeliveryExecution($this);
if (array_key_exists(self::COLUMN_ID, $result)) {
$rdsDeliveryExecution->setIdentifier($result[self::COLUMN_ID]);
}
if (array_key_exists(self::COLUMN_LABEL, $resul... | php | private function parseQueryResult($result = [])
{
$rdsDeliveryExecution = new RdsDeliveryExecution($this);
if (array_key_exists(self::COLUMN_ID, $result)) {
$rdsDeliveryExecution->setIdentifier($result[self::COLUMN_ID]);
}
if (array_key_exists(self::COLUMN_LABEL, $resul... | [
"private",
"function",
"parseQueryResult",
"(",
"$",
"result",
"=",
"[",
"]",
")",
"{",
"$",
"rdsDeliveryExecution",
"=",
"new",
"RdsDeliveryExecution",
"(",
"$",
"this",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"self",
"::",
"COLUMN_ID",
",",
"$",
"r... | Parses the query result array and constructs a new DeliveryExecution object from it
@param array $result
@return DeliveryExecution
@throws \common_exception_Error | [
"Parses",
"the",
"query",
"result",
"array",
"and",
"constructs",
"a",
"new",
"DeliveryExecution",
"object",
"from",
"it"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/execution/rds/RdsDeliveryExecutionService.php#L277-L310 |
oat-sa/extension-tao-delivery | models/classes/theme/DeliveryThemeDetailsProvider.php | DeliveryThemeDetailsProvider.getDeliveryIdFromSession | public function getDeliveryIdFromSession($deliveryExecutionId)
{
if (\PHPSession::singleton()->hasAttribute(static::getDeliveryIdSessionKey($deliveryExecutionId))){
return \PHPSession::singleton()->getAttribute(static::getDeliveryIdSessionKey($deliveryExecutionId));
}
return fal... | php | public function getDeliveryIdFromSession($deliveryExecutionId)
{
if (\PHPSession::singleton()->hasAttribute(static::getDeliveryIdSessionKey($deliveryExecutionId))){
return \PHPSession::singleton()->getAttribute(static::getDeliveryIdSessionKey($deliveryExecutionId));
}
return fal... | [
"public",
"function",
"getDeliveryIdFromSession",
"(",
"$",
"deliveryExecutionId",
")",
"{",
"if",
"(",
"\\",
"PHPSession",
"::",
"singleton",
"(",
")",
"->",
"hasAttribute",
"(",
"static",
"::",
"getDeliveryIdSessionKey",
"(",
"$",
"deliveryExecutionId",
")",
")"... | Returns the deliveryId from session.
@param $deliveryExecutionId
@return mixed | [
"Returns",
"the",
"deliveryId",
"from",
"session",
"."
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/models/classes/theme/DeliveryThemeDetailsProvider.php#L82-L89 |
oat-sa/extension-tao-delivery | models/classes/theme/DeliveryThemeDetailsProvider.php | DeliveryThemeDetailsProvider.getDeliveryThemeId | public function getDeliveryThemeId($deliveryId)
{
$themeId = $this->getDeliveryThemeIdFromCache($deliveryId);
if ($themeId === false) {
$themeId = $this->getDeliveryThemeIdFromDb($deliveryId);
$this->storeDeliveryThemeIdToCache($deliveryId, $themeId);
}
retur... | php | public function getDeliveryThemeId($deliveryId)
{
$themeId = $this->getDeliveryThemeIdFromCache($deliveryId);
if ($themeId === false) {
$themeId = $this->getDeliveryThemeIdFromDb($deliveryId);
$this->storeDeliveryThemeIdToCache($deliveryId, $themeId);
}
retur... | [
"public",
"function",
"getDeliveryThemeId",
"(",
"$",
"deliveryId",
")",
"{",
"$",
"themeId",
"=",
"$",
"this",
"->",
"getDeliveryThemeIdFromCache",
"(",
"$",
"deliveryId",
")",
";",
"if",
"(",
"$",
"themeId",
"===",
"false",
")",
"{",
"$",
"themeId",
"=",... | Returns the delivery theme id.
@param $deliveryId
@return string | [
"Returns",
"the",
"delivery",
"theme",
"id",
"."
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/models/classes/theme/DeliveryThemeDetailsProvider.php#L98-L107 |
oat-sa/extension-tao-delivery | models/classes/theme/DeliveryThemeDetailsProvider.php | DeliveryThemeDetailsProvider.getDeliveryThemeIdFromCache | public function getDeliveryThemeIdFromCache($deliveryId)
{
$cache = $this->getCache();
$cacheKey = $this->getCacheKey($deliveryId);
if ($cache->has($cacheKey)) {
return $cache->get($cacheKey);
}
return false;
} | php | public function getDeliveryThemeIdFromCache($deliveryId)
{
$cache = $this->getCache();
$cacheKey = $this->getCacheKey($deliveryId);
if ($cache->has($cacheKey)) {
return $cache->get($cacheKey);
}
return false;
} | [
"public",
"function",
"getDeliveryThemeIdFromCache",
"(",
"$",
"deliveryId",
")",
"{",
"$",
"cache",
"=",
"$",
"this",
"->",
"getCache",
"(",
")",
";",
"$",
"cacheKey",
"=",
"$",
"this",
"->",
"getCacheKey",
"(",
"$",
"deliveryId",
")",
";",
"if",
"(",
... | Returns the delivery theme id from cache or FALSE when it does not exist.
@param $deliveryId
@return bool|\common_Serializable | [
"Returns",
"the",
"delivery",
"theme",
"id",
"from",
"cache",
"or",
"FALSE",
"when",
"it",
"does",
"not",
"exist",
"."
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/models/classes/theme/DeliveryThemeDetailsProvider.php#L116-L125 |
oat-sa/extension-tao-delivery | models/classes/theme/DeliveryThemeDetailsProvider.php | DeliveryThemeDetailsProvider.storeDeliveryThemeIdToCache | public function storeDeliveryThemeIdToCache($deliveryId, $themeId)
{
try {
return $this->getCache()->put($themeId, $this->getCacheKey($deliveryId), 60);
}
catch (\common_exception_NotImplemented $e) {
return false;
}
} | php | public function storeDeliveryThemeIdToCache($deliveryId, $themeId)
{
try {
return $this->getCache()->put($themeId, $this->getCacheKey($deliveryId), 60);
}
catch (\common_exception_NotImplemented $e) {
return false;
}
} | [
"public",
"function",
"storeDeliveryThemeIdToCache",
"(",
"$",
"deliveryId",
",",
"$",
"themeId",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getCache",
"(",
")",
"->",
"put",
"(",
"$",
"themeId",
",",
"$",
"this",
"->",
"getCacheKey",
"(",
"$",
... | Stores the delivery theme id to cache.
@param $deliveryId
@param $themeId
@return bool | [
"Stores",
"the",
"delivery",
"theme",
"id",
"to",
"cache",
"."
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/models/classes/theme/DeliveryThemeDetailsProvider.php#L157-L165 |
oat-sa/extension-tao-delivery | scripts/update/Updater.php | Updater.update | public function update($initialVersion)
{
$currentVersion = $initialVersion;
//migrate from 2.6 to 2.6.1
if ($currentVersion == '2.6') {
//data upgrade
OntologyUpdater::syncModels();
$currentVersion = '2.6.1';
}
if ($currentVersion == '2.... | php | public function update($initialVersion)
{
$currentVersion = $initialVersion;
//migrate from 2.6 to 2.6.1
if ($currentVersion == '2.6') {
//data upgrade
OntologyUpdater::syncModels();
$currentVersion = '2.6.1';
}
if ($currentVersion == '2.... | [
"public",
"function",
"update",
"(",
"$",
"initialVersion",
")",
"{",
"$",
"currentVersion",
"=",
"$",
"initialVersion",
";",
"//migrate from 2.6 to 2.6.1",
"if",
"(",
"$",
"currentVersion",
"==",
"'2.6'",
")",
"{",
"//data upgrade",
"OntologyUpdater",
"::",
"sync... | @param $initialVersion
@return string $versionUpdatedTo
@throws common_Exception
@throws common_exception_Error
@throws common_exception_InconsistentData
@throws common_ext_ExtensionException
@throws common_ext_InstallationException
@throws InvalidServiceManagerException | [
"@param",
"$initialVersion"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/scripts/update/Updater.php#L76-L401 |
oat-sa/extension-tao-delivery | model/container/delivery/LegacyClientContainer.php | LegacyClientContainer.getExecutionContainer | public function getExecutionContainer(DeliveryExecution $execution)
{
$container = new ExecutionClientContainer($execution);
$containerService = $this->getServiceLocator()->get(DeliveryContainerService::SERVICE_ID);
// set the test parameters
$container->setData('testDefinition', $t... | php | public function getExecutionContainer(DeliveryExecution $execution)
{
$container = new ExecutionClientContainer($execution);
$containerService = $this->getServiceLocator()->get(DeliveryContainerService::SERVICE_ID);
// set the test parameters
$container->setData('testDefinition', $t... | [
"public",
"function",
"getExecutionContainer",
"(",
"DeliveryExecution",
"$",
"execution",
")",
"{",
"$",
"container",
"=",
"new",
"ExecutionClientContainer",
"(",
"$",
"execution",
")",
";",
"$",
"containerService",
"=",
"$",
"this",
"->",
"getServiceLocator",
"(... | {@inheritDoc}
@see \oat\taoDelivery\model\container\delivery\AbstractContainer::getExecutionContainer() | [
"{"
] | train | https://github.com/oat-sa/extension-tao-delivery/blob/666849ce8d21442dfc2805d68e4beaedb4013d83/model/container/delivery/LegacyClientContainer.php#L78-L93 |
reactphp/filesystem | src/Stream/GenericStreamTrait.php | GenericStreamTrait.close | public function close()
{
if ($this->closed) {
return;
}
$this->closed = true;
$this->filesystem->close($this->fileDescriptor)->then(function () {
$this->emit('close', [$this]);
$this->removeAllListeners();
});
} | php | public function close()
{
if ($this->closed) {
return;
}
$this->closed = true;
$this->filesystem->close($this->fileDescriptor)->then(function () {
$this->emit('close', [$this]);
$this->removeAllListeners();
});
} | [
"public",
"function",
"close",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"closed",
")",
"{",
"return",
";",
"}",
"$",
"this",
"->",
"closed",
"=",
"true",
";",
"$",
"this",
"->",
"filesystem",
"->",
"close",
"(",
"$",
"this",
"->",
"fileDescript... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Stream/GenericStreamTrait.php#L85-L97 |
reactphp/filesystem | src/PermissionFlagResolver.php | PermissionFlagResolver.resolve | public function resolve($flag, $flags = null, $mapping = null)
{
$resultFlags = 0;
$start = 0;
foreach ([
'universe',
'group',
'user',
] as $scope) {
$this->currentScope = $scope;
$start -= 3;
$chunk = substr($f... | php | public function resolve($flag, $flags = null, $mapping = null)
{
$resultFlags = 0;
$start = 0;
foreach ([
'universe',
'group',
'user',
] as $scope) {
$this->currentScope = $scope;
$start -= 3;
$chunk = substr($f... | [
"public",
"function",
"resolve",
"(",
"$",
"flag",
",",
"$",
"flags",
"=",
"null",
",",
"$",
"mapping",
"=",
"null",
")",
"{",
"$",
"resultFlags",
"=",
"0",
";",
"$",
"start",
"=",
"0",
";",
"foreach",
"(",
"[",
"'universe'",
",",
"'group'",
",",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/PermissionFlagResolver.php#L48-L65 |
reactphp/filesystem | src/Stream/WritableStreamTrait.php | WritableStreamTrait.write | public function write($data)
{
$length = strlen($data);
$offset = $this->writeCursor;
$this->writeCursor += $length;
return $this->getFilesystem()->write($this->getFileDescriptor(), $data, $length, $offset);
} | php | public function write($data)
{
$length = strlen($data);
$offset = $this->writeCursor;
$this->writeCursor += $length;
return $this->getFilesystem()->write($this->getFileDescriptor(), $data, $length, $offset);
} | [
"public",
"function",
"write",
"(",
"$",
"data",
")",
"{",
"$",
"length",
"=",
"strlen",
"(",
"$",
"data",
")",
";",
"$",
"offset",
"=",
"$",
"this",
"->",
"writeCursor",
";",
"$",
"this",
"->",
"writeCursor",
"+=",
"$",
"length",
";",
"return",
"$... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Stream/WritableStreamTrait.php#L12-L19 |
reactphp/filesystem | src/Stream/WritableStreamTrait.php | WritableStreamTrait.end | public function end($data = null)
{
if (null !== $data) {
$this->write($data);
}
$this->close();
} | php | public function end($data = null)
{
if (null !== $data) {
$this->write($data);
}
$this->close();
} | [
"public",
"function",
"end",
"(",
"$",
"data",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"write",
"(",
"$",
"data",
")",
";",
"}",
"$",
"this",
"->",
"close",
"(",
")",
";",
"}"
] | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/Stream/WritableStreamTrait.php#L24-L31 |
reactphp/filesystem | src/ChildProcess/Adapter.php | Adapter.setFilesystem | public function setFilesystem(FilesystemInterface $filesystem)
{
$this->filesystem = $filesystem;
$this->typeDetectors = [
MappedTypeDetector::createDefault($this->filesystem),
new ModeTypeDetector($this->filesystem),
];
} | php | public function setFilesystem(FilesystemInterface $filesystem)
{
$this->filesystem = $filesystem;
$this->typeDetectors = [
MappedTypeDetector::createDefault($this->filesystem),
new ModeTypeDetector($this->filesystem),
];
} | [
"public",
"function",
"setFilesystem",
"(",
"FilesystemInterface",
"$",
"filesystem",
")",
"{",
"$",
"this",
"->",
"filesystem",
"=",
"$",
"filesystem",
";",
"$",
"this",
"->",
"typeDetectors",
"=",
"[",
"MappedTypeDetector",
"::",
"createDefault",
"(",
"$",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/ChildProcess/Adapter.php#L147-L155 |
reactphp/filesystem | src/ChildProcess/Adapter.php | Adapter.getContents | public function getContents($path, $offset = 0, $length = null)
{
return $this->invoker->invokeCall('getContents', [
'path' => $path,
'offset' => $offset,
'maxlen' => $length,
])->then(function ($payload) {
return \React\Promise\resolve(base64_decode($... | php | public function getContents($path, $offset = 0, $length = null)
{
return $this->invoker->invokeCall('getContents', [
'path' => $path,
'offset' => $offset,
'maxlen' => $length,
])->then(function ($payload) {
return \React\Promise\resolve(base64_decode($... | [
"public",
"function",
"getContents",
"(",
"$",
"path",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"length",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"invoker",
"->",
"invokeCall",
"(",
"'getContents'",
",",
"[",
"'path'",
"=>",
"$",
"path",
"... | Reads the entire file.
This is an optimization for adapters which can optimize
the open -> (seek ->) read -> close sequence into one call.
@param string $path
@param int $offset
@param int|null $length
@return PromiseInterface | [
"Reads",
"the",
"entire",
"file",
"."
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/ChildProcess/Adapter.php#L300-L309 |
reactphp/filesystem | src/ChildProcess/Adapter.php | Adapter.putContents | public function putContents($path, $content)
{
return $this->invoker->invokeCall('putContents', [
'path' => $path,
'chunk' => base64_encode($content),
'flags' => 0,
])->then(function ($payload) {
return \React\Promise\resolve($payload['written']);
... | php | public function putContents($path, $content)
{
return $this->invoker->invokeCall('putContents', [
'path' => $path,
'chunk' => base64_encode($content),
'flags' => 0,
])->then(function ($payload) {
return \React\Promise\resolve($payload['written']);
... | [
"public",
"function",
"putContents",
"(",
"$",
"path",
",",
"$",
"content",
")",
"{",
"return",
"$",
"this",
"->",
"invoker",
"->",
"invokeCall",
"(",
"'putContents'",
",",
"[",
"'path'",
"=>",
"$",
"path",
",",
"'chunk'",
"=>",
"base64_encode",
"(",
"$"... | Writes the given content to the specified file.
If the file exists, the file is truncated.
If the file does not exist, the file will be created.
This is an optimization for adapters which can optimize
the open -> write -> close sequence into one call.
@param string $path
@param string $content
@return PromiseInterfac... | [
"Writes",
"the",
"given",
"content",
"to",
"the",
"specified",
"file",
".",
"If",
"the",
"file",
"exists",
"the",
"file",
"is",
"truncated",
".",
"If",
"the",
"file",
"does",
"not",
"exist",
"the",
"file",
"will",
"be",
"created",
"."
] | train | https://github.com/reactphp/filesystem/blob/1975bc8b67e8989661d9bbe89f4fd0237869e712/src/ChildProcess/Adapter.php#L324-L333 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.