id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
191,700 | backbee/backbee-php | Stream/ClassWrapper/Adapter/Yaml.php | Yaml.resolveFilePath | private function resolveFilePath($path)
{
$path = str_replace(array($this->_protocol.'://', '/'), array('', DIRECTORY_SEPARATOR), $path);
foreach ($this->_includeExtensions as $ext) {
$filename = $path.$ext;
File::resolveFilepath($filename, null, array('include_path' => $thi... | php | private function resolveFilePath($path)
{
$path = str_replace(array($this->_protocol.'://', '/'), array('', DIRECTORY_SEPARATOR), $path);
foreach ($this->_includeExtensions as $ext) {
$filename = $path.$ext;
File::resolveFilepath($filename, null, array('include_path' => $thi... | [
"private",
"function",
"resolveFilePath",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"array",
"(",
"$",
"this",
"->",
"_protocol",
".",
"'://'",
",",
"'/'",
")",
",",
"array",
"(",
"''",
",",
"DIRECTORY_SEPARATOR",
")",
",",
"$",... | Return the real yaml file path of the loading class.
@param string $path
@return string The real path if found | [
"Return",
"the",
"real",
"yaml",
"file",
"path",
"of",
"the",
"loading",
"class",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Stream/ClassWrapper/Adapter/Yaml.php#L279-L292 |
191,701 | backbee/backbee-php | Stream/ClassWrapper/Adapter/Yaml.php | Yaml.stream_open | public function stream_open($path, $mode, $options, &$opened_path)
{
$path = str_replace(array($this->_protocol.'://', '/'), array('', DIRECTORY_SEPARATOR), $path);
$this->classname = basename($path);
if (dirname($path) && dirname($path) != DIRECTORY_SEPARATOR) {
$this->namespac... | php | public function stream_open($path, $mode, $options, &$opened_path)
{
$path = str_replace(array($this->_protocol.'://', '/'), array('', DIRECTORY_SEPARATOR), $path);
$this->classname = basename($path);
if (dirname($path) && dirname($path) != DIRECTORY_SEPARATOR) {
$this->namespac... | [
"public",
"function",
"stream_open",
"(",
"$",
"path",
",",
"$",
"mode",
",",
"$",
"options",
",",
"&",
"$",
"opened_path",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"array",
"(",
"$",
"this",
"->",
"_protocol",
".",
"'://'",
",",
"'/'",
")",
... | Opens a stream content for a yaml file.
@see BackBee\Stream\ClassWrapper.IClassWrapper::stream_open()
@throws BBException Occurs when none yamel files were found
@throws ClassWrapperException Occurs when yaml file is not a valid class content description | [
"Opens",
"a",
"stream",
"content",
"for",
"a",
"yaml",
"file",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Stream/ClassWrapper/Adapter/Yaml.php#L334-L404 |
191,702 | backbee/backbee-php | Stream/ClassWrapper/Adapter/Yaml.php | Yaml.url_stat | public function url_stat($path, $flag)
{
$path = str_replace(array($this->_protocol.'://', '/'), array('', DIRECTORY_SEPARATOR), $path);
$this->_path = $this->resolveFilePath($path);
if (is_file($this->_path) && is_readable($this->_path)) {
$fd = fopen($this->_path, 'rb');
... | php | public function url_stat($path, $flag)
{
$path = str_replace(array($this->_protocol.'://', '/'), array('', DIRECTORY_SEPARATOR), $path);
$this->_path = $this->resolveFilePath($path);
if (is_file($this->_path) && is_readable($this->_path)) {
$fd = fopen($this->_path, 'rb');
... | [
"public",
"function",
"url_stat",
"(",
"$",
"path",
",",
"$",
"flag",
")",
"{",
"$",
"path",
"=",
"str_replace",
"(",
"array",
"(",
"$",
"this",
"->",
"_protocol",
".",
"'://'",
",",
"'/'",
")",
",",
"array",
"(",
"''",
",",
"DIRECTORY_SEPARATOR",
")... | Retrieve information about a yaml file.
@see BackBee\Stream\ClassWrapper.AbstractClassWrapper::url_stat() | [
"Retrieve",
"information",
"about",
"a",
"yaml",
"file",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Stream/ClassWrapper/Adapter/Yaml.php#L411-L425 |
191,703 | Fakerino/Fakerino | src/Fakerino/Core/OutPutFactory.php | OutPutFactory.getOutput | public static function getOutput($class, $options = null)
{
$fakeClass = new $class($options);
$generatorName = $fakeClass->generatedBy();
$generator = new $generatorName();
$generator->setCaller($fakeClass);
return $generator->generate();
} | php | public static function getOutput($class, $options = null)
{
$fakeClass = new $class($options);
$generatorName = $fakeClass->generatedBy();
$generator = new $generatorName();
$generator->setCaller($fakeClass);
return $generator->generate();
} | [
"public",
"static",
"function",
"getOutput",
"(",
"$",
"class",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"fakeClass",
"=",
"new",
"$",
"class",
"(",
"$",
"options",
")",
";",
"$",
"generatorName",
"=",
"$",
"fakeClass",
"->",
"generatedBy",
"("... | Returns a string output.
@param string $class
@param string|array|null $options
@return string|array | [
"Returns",
"a",
"string",
"output",
"."
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Core/OutPutFactory.php#L30-L38 |
191,704 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.update | public function update(AbstractClassContent $content, array $data)
{
if (!isset($data['parameters']) && !isset($data['elements'])) {
throw new \InvalidArgumentException('Provided data are not valids for ClassContentManager::update.');
}
if (isset($data['parameters'])) {
... | php | public function update(AbstractClassContent $content, array $data)
{
if (!isset($data['parameters']) && !isset($data['elements'])) {
throw new \InvalidArgumentException('Provided data are not valids for ClassContentManager::update.');
}
if (isset($data['parameters'])) {
... | [
"public",
"function",
"update",
"(",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"data",
"[",
"'parameters'",
"]",
")",
"&&",
"!",
"isset",
"(",
"$",
"data",
"[",
"'elements'",
"]",
... | Updates the content whith provided data.
@param AbstractClassContent $content The content to be updated.
@param array $data Array of data that must contains parameters and/or elements key.
@return ClassContentManager
@throws \InvalidArgumentException Raises if provided data doesn't have param... | [
"Updates",
"the",
"content",
"whith",
"provided",
"data",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L123-L138 |
191,705 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.isMainZone | public function isMainZone($content)
{
if ($content instanceof ContentSet) {
$pages = $this->entityManager->getRepository('BackBee\ClassContent\ContentSet')->findPagesByContent($content);
if (count($pages) > 0) {
foreach($pages as $page) {
if ($pa... | php | public function isMainZone($content)
{
if ($content instanceof ContentSet) {
$pages = $this->entityManager->getRepository('BackBee\ClassContent\ContentSet')->findPagesByContent($content);
if (count($pages) > 0) {
foreach($pages as $page) {
if ($pa... | [
"public",
"function",
"isMainZone",
"(",
"$",
"content",
")",
"{",
"if",
"(",
"$",
"content",
"instanceof",
"ContentSet",
")",
"{",
"$",
"pages",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"getRepository",
"(",
"'BackBee\\ClassContent\\ContentSet'",
")",
"... | Check if a contentset is a main zone on a page
@param AbstractClassContent $content The content to be updated. | [
"Check",
"if",
"a",
"contentset",
"is",
"a",
"main",
"zone",
"on",
"a",
"page"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L146-L166 |
191,706 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.getAllClassContentClassnames | public function getAllClassContentClassnames()
{
if (null === $this->contentClassnames) {
$cacheId = md5('all_classcontents_classnames_'.$this->app->getContext().'_'.$this->app->getEnvironment());
if (!$this->app->isDebugMode() && false !== $value = $this->cache->load($cacheId)) {
... | php | public function getAllClassContentClassnames()
{
if (null === $this->contentClassnames) {
$cacheId = md5('all_classcontents_classnames_'.$this->app->getContext().'_'.$this->app->getEnvironment());
if (!$this->app->isDebugMode() && false !== $value = $this->cache->load($cacheId)) {
... | [
"public",
"function",
"getAllClassContentClassnames",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"contentClassnames",
")",
"{",
"$",
"cacheId",
"=",
"md5",
"(",
"'all_classcontents_classnames_'",
".",
"$",
"this",
"->",
"app",
"->",
"getContex... | Returns all classcontents classnames
@return string[] An array that contains all classcontents classnames | [
"Returns",
"all",
"classcontents",
"classnames"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L236-L256 |
191,707 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.getAllElementClassContentClassnames | public function getAllElementClassContentClassnames()
{
$classnames = array_filter(
$this->getAllClassContentClassnames(),
function ($classname) {
return false !== strpos(
$classname,
AbstractClassContent::CLASSCONTENT_BASE_NAME... | php | public function getAllElementClassContentClassnames()
{
$classnames = array_filter(
$this->getAllClassContentClassnames(),
function ($classname) {
return false !== strpos(
$classname,
AbstractClassContent::CLASSCONTENT_BASE_NAME... | [
"public",
"function",
"getAllElementClassContentClassnames",
"(",
")",
"{",
"$",
"classnames",
"=",
"array_filter",
"(",
"$",
"this",
"->",
"getAllClassContentClassnames",
"(",
")",
",",
"function",
"(",
"$",
"classname",
")",
"{",
"return",
"false",
"!==",
"str... | Returns classnames of all classcontents element
@return string[] Contains every BackBee's element classcontent classnames | [
"Returns",
"classnames",
"of",
"all",
"classcontents",
"element"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L263-L278 |
191,708 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.commit | public function commit(AbstractClassContent $content, array $data = [])
{
foreach ($this->getAllClassContentClassnames() as $classname) {
class_exists($classname);
}
if (null === $draft = $this->getDraft($content)) {
throw new InvalidArgumentException(sprintf(
... | php | public function commit(AbstractClassContent $content, array $data = [])
{
foreach ($this->getAllClassContentClassnames() as $classname) {
class_exists($classname);
}
if (null === $draft = $this->getDraft($content)) {
throw new InvalidArgumentException(sprintf(
... | [
"public",
"function",
"commit",
"(",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getAllClassContentClassnames",
"(",
")",
"as",
"$",
"classname",
")",
"{",
"class_exists",
... | Computes provided data to define what to commit from given content.
@param AbstractClassContent $content
@param array $data
@return ClassContentManager | [
"Computes",
"provided",
"data",
"to",
"define",
"what",
"to",
"commit",
"from",
"given",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L305-L329 |
191,709 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.revert | public function revert(AbstractClassContent $content, array $data = [])
{
if (0 === count($data)) {
$data['parameters'] = array_keys($content->getAllParams());
if ($content instanceof ContentSet) {
$data['elements'] = true;
} else {
$data['... | php | public function revert(AbstractClassContent $content, array $data = [])
{
if (0 === count($data)) {
$data['parameters'] = array_keys($content->getAllParams());
if ($content instanceof ContentSet) {
$data['elements'] = true;
} else {
$data['... | [
"public",
"function",
"revert",
"(",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"[",
"'parameters'",
"]",
"=",
"array_keys"... | Computes provided data to define what to revert from given content.
@param AbstractClassContent $content
@param array $data
@return ClassContentManager | [
"Computes",
"provided",
"data",
"to",
"define",
"what",
"to",
"revert",
"from",
"given",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L339-L366 |
191,710 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.revertToRevision | public function revertToRevision(AbstractClassContent $content, $revision)
{
// First remove existing draft for user
if (null !== $draft = $this->getDraft($content)) {
$this->entityManager->remove($draft);
}
// If asked $revision is the last one, all is done.
if ... | php | public function revertToRevision(AbstractClassContent $content, $revision)
{
// First remove existing draft for user
if (null !== $draft = $this->getDraft($content)) {
$this->entityManager->remove($draft);
}
// If asked $revision is the last one, all is done.
if ... | [
"public",
"function",
"revertToRevision",
"(",
"AbstractClassContent",
"$",
"content",
",",
"$",
"revision",
")",
"{",
"// First remove existing draft for user",
"if",
"(",
"null",
"!==",
"$",
"draft",
"=",
"$",
"this",
"->",
"getDraft",
"(",
"$",
"content",
")"... | Reverts a content to a specific revision.
@param AbstractClassContent $content The content to revert.
@param integer $revision The revision number.
@return ClassContentManager The current class content manager. | [
"Reverts",
"a",
"content",
"to",
"a",
"specific",
"revision",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L376-L410 |
191,711 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.updateElements | private function updateElements(AbstractClassContent $content, array $elementsData)
{
if ($content instanceof ContentSet) {
$elements = $this->prepareElements($elementsData, false);
$page = $this->isMainZone($content);
$this->updateContentSetElements($content, $elements, ... | php | private function updateElements(AbstractClassContent $content, array $elementsData)
{
if ($content instanceof ContentSet) {
$elements = $this->prepareElements($elementsData, false);
$page = $this->isMainZone($content);
$this->updateContentSetElements($content, $elements, ... | [
"private",
"function",
"updateElements",
"(",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"elementsData",
")",
"{",
"if",
"(",
"$",
"content",
"instanceof",
"ContentSet",
")",
"{",
"$",
"elements",
"=",
"$",
"this",
"->",
"prepareElements",
"(",... | Updates provided content's elements with data
@param AbstractClassContent $content
@param array $elementsData
@return ClassContentManager | [
"Updates",
"provided",
"content",
"s",
"elements",
"with",
"data"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L443-L455 |
191,712 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.updateContentSetElements | private function updateContentSetElements(ContentSet $content, array $elementsData, Page $page = null)
{
$content->clear();
foreach ($elementsData as $data) {
if ($data instanceof AbstractClassContent) {
if (null !== $page && null === $data->getMainNode()) {
... | php | private function updateContentSetElements(ContentSet $content, array $elementsData, Page $page = null)
{
$content->clear();
foreach ($elementsData as $data) {
if ($data instanceof AbstractClassContent) {
if (null !== $page && null === $data->getMainNode()) {
... | [
"private",
"function",
"updateContentSetElements",
"(",
"ContentSet",
"$",
"content",
",",
"array",
"$",
"elementsData",
",",
"Page",
"$",
"page",
"=",
"null",
")",
"{",
"$",
"content",
"->",
"clear",
"(",
")",
";",
"foreach",
"(",
"$",
"elementsData",
"as... | Updates provided contentset's elements with data.
@param ContentSet $content
@param array $elementsData
@return ClassContentManager | [
"Updates",
"provided",
"contentset",
"s",
"elements",
"with",
"data",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L465-L478 |
191,713 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.updateContentElements | private function updateContentElements(AbstractClassContent $content, array $elementsData)
{
foreach ($elementsData as $key => $data) {
if (in_array('Element\Keyword', $content->getAccept()[$key])) {
$this->entityManager
->getRepository('BackBee\ClassConte... | php | private function updateContentElements(AbstractClassContent $content, array $elementsData)
{
foreach ($elementsData as $key => $data) {
if (in_array('Element\Keyword', $content->getAccept()[$key])) {
$this->entityManager
->getRepository('BackBee\ClassConte... | [
"private",
"function",
"updateContentElements",
"(",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"elementsData",
")",
"{",
"foreach",
"(",
"$",
"elementsData",
"as",
"$",
"key",
"=>",
"$",
"data",
")",
"{",
"if",
"(",
"in_array",
"(",
"'Elemen... | Updates provided content's elements with data.
@param AbstractClassContent $content
@param array $elementsData
@return ClassContentManager | [
"Updates",
"provided",
"content",
"s",
"elements",
"with",
"data",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L488-L500 |
191,714 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.prepareElements | private function prepareElements(array $elementsData, $acceptScalar = true)
{
$elements = [];
foreach ($elementsData as $key => $data) {
if (true === $acceptScalar && is_scalar($data)) {
$elements[$key] = $data;
continue;
}
if (!is... | php | private function prepareElements(array $elementsData, $acceptScalar = true)
{
$elements = [];
foreach ($elementsData as $key => $data) {
if (true === $acceptScalar && is_scalar($data)) {
$elements[$key] = $data;
continue;
}
if (!is... | [
"private",
"function",
"prepareElements",
"(",
"array",
"$",
"elementsData",
",",
"$",
"acceptScalar",
"=",
"true",
")",
"{",
"$",
"elements",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"elementsData",
"as",
"$",
"key",
"=>",
"$",
"data",
")",
"{",
"if",... | Prepare elements to be setted.
@param array $elementsData The elements to be setted.
@param boolean $acceptScalar If true, scalar value will be accepted.
@return array | [
"Prepare",
"elements",
"to",
"be",
"setted",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L510-L544 |
191,715 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.updateParameters | private function updateParameters(AbstractClassContent $content, array $paramsData)
{
foreach ($paramsData as $key => $param) {
$content->setParam($key, $param);
}
return $this;
} | php | private function updateParameters(AbstractClassContent $content, array $paramsData)
{
foreach ($paramsData as $key => $param) {
$content->setParam($key, $param);
}
return $this;
} | [
"private",
"function",
"updateParameters",
"(",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"paramsData",
")",
"{",
"foreach",
"(",
"$",
"paramsData",
"as",
"$",
"key",
"=>",
"$",
"param",
")",
"{",
"$",
"content",
"->",
"setParam",
"(",
"$"... | Updates provided content's parameters.
@param AbstractClassContent $content
@param array $paramsData
@return ClassContentManager | [
"Updates",
"provided",
"content",
"s",
"parameters",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L554-L561 |
191,716 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.prepareDraftForCommit | private function prepareDraftForCommit(AbstractClassContent $content, Revision $draft, array $data)
{
if ($content instanceof ContentSet) {
if (!isset($data['elements']) || false === $data['elements']) {
$draft->clear();
foreach ($content->getData() as $element) {... | php | private function prepareDraftForCommit(AbstractClassContent $content, Revision $draft, array $data)
{
if ($content instanceof ContentSet) {
if (!isset($data['elements']) || false === $data['elements']) {
$draft->clear();
foreach ($content->getData() as $element) {... | [
"private",
"function",
"prepareDraftForCommit",
"(",
"AbstractClassContent",
"$",
"content",
",",
"Revision",
"$",
"draft",
",",
"array",
"$",
"data",
")",
"{",
"if",
"(",
"$",
"content",
"instanceof",
"ContentSet",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
... | Prepares draft for commit.
@param AbstractClassContent $content
@param Revision $draft
@param array $data
@return ClassContentManager | [
"Prepares",
"draft",
"for",
"commit",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L572-L602 |
191,717 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.executeCommit | private function executeCommit(AbstractClassContent $content, Revision $draft)
{
$content->setDraft(null);
if ($content instanceof ContentSet) {
$content->clear();
while ($subcontent = $draft->next()) {
if ($subcontent instanceof AbstractClassContent) {
... | php | private function executeCommit(AbstractClassContent $content, Revision $draft)
{
$content->setDraft(null);
if ($content instanceof ContentSet) {
$content->clear();
while ($subcontent = $draft->next()) {
if ($subcontent instanceof AbstractClassContent) {
... | [
"private",
"function",
"executeCommit",
"(",
"AbstractClassContent",
"$",
"content",
",",
"Revision",
"$",
"draft",
")",
"{",
"$",
"content",
"->",
"setDraft",
"(",
"null",
")",
";",
"if",
"(",
"$",
"content",
"instanceof",
"ContentSet",
")",
"{",
"$",
"co... | Executes commit action on content and its draft.
@param AbstractClassContent $content
@param Revision $draft
@return ClassContentManager | [
"Executes",
"commit",
"action",
"on",
"content",
"and",
"its",
"draft",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L612-L661 |
191,718 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.commitPostProcess | private function commitPostProcess(AbstractClassContent $content, Revision $draft)
{
$data = $draft->jsonSerialize();
if (0 !== count($data['parameters']) && 0 !== count($data['elements'])) {
$draft->setRevision($content->getRevision());
$draft->setState(Revision::STATE_MODIF... | php | private function commitPostProcess(AbstractClassContent $content, Revision $draft)
{
$data = $draft->jsonSerialize();
if (0 !== count($data['parameters']) && 0 !== count($data['elements'])) {
$draft->setRevision($content->getRevision());
$draft->setState(Revision::STATE_MODIF... | [
"private",
"function",
"commitPostProcess",
"(",
"AbstractClassContent",
"$",
"content",
",",
"Revision",
"$",
"draft",
")",
"{",
"$",
"data",
"=",
"$",
"draft",
"->",
"jsonSerialize",
"(",
")",
";",
"if",
"(",
"0",
"!==",
"count",
"(",
"$",
"data",
"[",... | Runs process of post commit.
@param AbstractClassContent $content
@param Revision $draft
@return ClassContentManager | [
"Runs",
"process",
"of",
"post",
"commit",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L671-L681 |
191,719 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.executeRevert | private function executeRevert(AbstractClassContent $content, Revision $draft, array $data)
{
$content->setDraft(null);
if ($content instanceof ContentSet) {
if (isset($data['elements']) && true === $data['elements']) {
$draft->clear();
foreach ($content->... | php | private function executeRevert(AbstractClassContent $content, Revision $draft, array $data)
{
$content->setDraft(null);
if ($content instanceof ContentSet) {
if (isset($data['elements']) && true === $data['elements']) {
$draft->clear();
foreach ($content->... | [
"private",
"function",
"executeRevert",
"(",
"AbstractClassContent",
"$",
"content",
",",
"Revision",
"$",
"draft",
",",
"array",
"$",
"data",
")",
"{",
"$",
"content",
"->",
"setDraft",
"(",
"null",
")",
";",
"if",
"(",
"$",
"content",
"instanceof",
"Cont... | Executes revert action on content and its draft.
@param AbstractClassContent $content
@param Revision $draft
@param array $data
@return ClassContentManager | [
"Executes",
"revert",
"action",
"on",
"content",
"and",
"its",
"draft",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L692-L727 |
191,720 | backbee/backbee-php | ClassContent/ClassContentManager.php | ClassContentManager.revertPostProcess | private function revertPostProcess(AbstractClassContent $content, Revision $draft)
{
$data = $draft->jsonSerialize();
if (
0 === count($data['parameters'])
&& (
0 === count($data['elements'])
|| (
$content instanceof Conten... | php | private function revertPostProcess(AbstractClassContent $content, Revision $draft)
{
$data = $draft->jsonSerialize();
if (
0 === count($data['parameters'])
&& (
0 === count($data['elements'])
|| (
$content instanceof Conten... | [
"private",
"function",
"revertPostProcess",
"(",
"AbstractClassContent",
"$",
"content",
",",
"Revision",
"$",
"draft",
")",
"{",
"$",
"data",
"=",
"$",
"draft",
"->",
"jsonSerialize",
"(",
")",
";",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"data",
"[",... | Runs revert post action on content and its draft.
@param AbstractClassContent $content
@param Revision $draft
@return ClassContentManager | [
"Runs",
"revert",
"post",
"action",
"on",
"content",
"and",
"its",
"draft",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ClassContentManager.php#L737-L764 |
191,721 | backbee/backbee-php | ClassContent/Repository/Element/FileRepository.php | FileRepository.commitFile | public function commitFile(ElementFile $file)
{
$filename = $file->path;
$currentname = Media::getPathFromContent($file);
File::resolveFilepath($currentname, null, array('base_dir' => $this->_mediadir));
try {
if (!is_dir(dirname($currentname))) {
mkdir(... | php | public function commitFile(ElementFile $file)
{
$filename = $file->path;
$currentname = Media::getPathFromContent($file);
File::resolveFilepath($currentname, null, array('base_dir' => $this->_mediadir));
try {
if (!is_dir(dirname($currentname))) {
mkdir(... | [
"public",
"function",
"commitFile",
"(",
"ElementFile",
"$",
"file",
")",
"{",
"$",
"filename",
"=",
"$",
"file",
"->",
"path",
";",
"$",
"currentname",
"=",
"Media",
"::",
"getPathFromContent",
"(",
"$",
"file",
")",
";",
"File",
"::",
"resolveFilepath",
... | Move an temporary uploaded file to either media library or storage directory.
@param \BackBee\ClassContent\Element\File $file
@return boolean | [
"Move",
"an",
"temporary",
"uploaded",
"file",
"to",
"either",
"media",
"library",
"or",
"storage",
"directory",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/Element/FileRepository.php#L79-L98 |
191,722 | backbee/backbee-php | ClassContent/Repository/Element/FileRepository.php | FileRepository.updateFile | public function updateFile(AbstractClassContent $file, $newfilename, $originalname = null, $src = null)
{
if (false === ($file instanceof ElementFile)) {
throw new ClassContentException('Invalid content type');
}
if (null === $originalname) {
$originalname = $file->o... | php | public function updateFile(AbstractClassContent $file, $newfilename, $originalname = null, $src = null)
{
if (false === ($file instanceof ElementFile)) {
throw new ClassContentException('Invalid content type');
}
if (null === $originalname) {
$originalname = $file->o... | [
"public",
"function",
"updateFile",
"(",
"AbstractClassContent",
"$",
"file",
",",
"$",
"newfilename",
",",
"$",
"originalname",
"=",
"null",
",",
"$",
"src",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"$",
"file",
"instanceof",
"ElementFile",
... | Move an uploaded file to the temporary directory and update file content.
@param \BackBee\ClassContent\AbstractClassContent $file
@param string $newfilename
@param string $originalname
@return boolean|string
@t... | [
"Move",
"an",
"uploaded",
"file",
"to",
"the",
"temporary",
"directory",
"and",
"update",
"file",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/Element/FileRepository.php#L110-L150 |
191,723 | backbee/backbee-php | ClassContent/Repository/Element/FileRepository.php | FileRepository.isInMediaLibrary | public function isInMediaLibrary(ElementFile $file)
{
$parent_ids = $this->getParentContentUid($file);
if (0 === count($parent_ids)) {
return false;
}
$q = $this->_em->getConnection()
->createQueryBuilder()
->select('m.id')
... | php | public function isInMediaLibrary(ElementFile $file)
{
$parent_ids = $this->getParentContentUid($file);
if (0 === count($parent_ids)) {
return false;
}
$q = $this->_em->getConnection()
->createQueryBuilder()
->select('m.id')
... | [
"public",
"function",
"isInMediaLibrary",
"(",
"ElementFile",
"$",
"file",
")",
"{",
"$",
"parent_ids",
"=",
"$",
"this",
"->",
"getParentContentUid",
"(",
"$",
"file",
")",
";",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"parent_ids",
")",
")",
"{",
"r... | Return true if file is in media libray false otherwise.
@param \BackBee\ClassContent\Element\File $file
@return boolean | [
"Return",
"true",
"if",
"file",
"is",
"in",
"media",
"libray",
"false",
"otherwise",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/Element/FileRepository.php#L159-L175 |
191,724 | backbee/backbee-php | ClassContent/Repository/Element/FileRepository.php | FileRepository.setDirectories | public function setDirectories(BBApplication $application = null)
{
if (null !== $application) {
$this->_application = $application;
$this->setTemporaryDir($application->getTemporaryDir())
->setStorageDir($application->getStorageDir())
->setMe... | php | public function setDirectories(BBApplication $application = null)
{
if (null !== $application) {
$this->_application = $application;
$this->setTemporaryDir($application->getTemporaryDir())
->setStorageDir($application->getStorageDir())
->setMe... | [
"public",
"function",
"setDirectories",
"(",
"BBApplication",
"$",
"application",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"application",
")",
"{",
"$",
"this",
"->",
"_application",
"=",
"$",
"application",
";",
"$",
"this",
"->",
"setTempora... | Set the storage directories define by the BB5 application.
@param \BackBee\BBApplication $application
@return \BackBee\ClassContent\Repository\Element\fileRepository | [
"Set",
"the",
"storage",
"directories",
"define",
"by",
"the",
"BB5",
"application",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/Element/FileRepository.php#L210-L221 |
191,725 | backbee/backbee-php | ClassContent/Repository/Element/FileRepository.php | FileRepository.dispatchPostUploadEvent | private function dispatchPostUploadEvent($sourcefile, $targetfile)
{
if (null !== $this->_application &&
null !== $this->_application->getEventDispatcher()) {
$event = new \BackBee\Event\PostUploadEvent($sourcefile, $targetfile);
$this->_application->getEventDispatche... | php | private function dispatchPostUploadEvent($sourcefile, $targetfile)
{
if (null !== $this->_application &&
null !== $this->_application->getEventDispatcher()) {
$event = new \BackBee\Event\PostUploadEvent($sourcefile, $targetfile);
$this->_application->getEventDispatche... | [
"private",
"function",
"dispatchPostUploadEvent",
"(",
"$",
"sourcefile",
",",
"$",
"targetfile",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"_application",
"&&",
"null",
"!==",
"$",
"this",
"->",
"_application",
"->",
"getEventDispatcher",
"(",
... | Dispatch postupload event.
@param string $sourcefile
@param string $targetfile | [
"Dispatch",
"postupload",
"event",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/Element/FileRepository.php#L271-L278 |
191,726 | backbee/backbee-php | Controller/ResourceController.php | ResourceController.resourcesAction | public function resourcesAction($filename, $base_dir = null)
{
if (null === $base_dir) {
File::resolveFilepath($filename, null, array('include_path' => $this->application->getResourceDir()));
} else {
File::resolveFilepath($filename, null, array('base_dir' => $base_dir));
... | php | public function resourcesAction($filename, $base_dir = null)
{
if (null === $base_dir) {
File::resolveFilepath($filename, null, array('include_path' => $this->application->getResourceDir()));
} else {
File::resolveFilepath($filename, null, array('base_dir' => $base_dir));
... | [
"public",
"function",
"resourcesAction",
"(",
"$",
"filename",
",",
"$",
"base_dir",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"base_dir",
")",
"{",
"File",
"::",
"resolveFilepath",
"(",
"$",
"filename",
",",
"null",
",",
"array",
"(",
"'in... | Handles a resource file request.
@param string $filename The resource file to provide
@throws FrontControllerException
@return Response | [
"Handles",
"a",
"resource",
"file",
"request",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Controller/ResourceController.php#L68-L89 |
191,727 | backbee/backbee-php | Controller/ResourceController.php | ResourceController.getClassContentThumbnailAction | public function getClassContentThumbnailAction($filename)
{
$base_folder = $this->application->getContainer()->getParameter('classcontent_thumbnail.base_folder');
$base_directories = array_map(function ($directory) use ($base_folder) {
return str_replace(
DIRECTORY_SEPARA... | php | public function getClassContentThumbnailAction($filename)
{
$base_folder = $this->application->getContainer()->getParameter('classcontent_thumbnail.base_folder');
$base_directories = array_map(function ($directory) use ($base_folder) {
return str_replace(
DIRECTORY_SEPARA... | [
"public",
"function",
"getClassContentThumbnailAction",
"(",
"$",
"filename",
")",
"{",
"$",
"base_folder",
"=",
"$",
"this",
"->",
"application",
"->",
"getContainer",
"(",
")",
"->",
"getParameter",
"(",
"'classcontent_thumbnail.base_folder'",
")",
";",
"$",
"ba... | Hdandles classcontent thumbnail request, returns the right thumbnail if it exists, else the default one.
@param string $filename
@return Response | [
"Hdandles",
"classcontent",
"thumbnail",
"request",
"returns",
"the",
"right",
"thumbnail",
"if",
"it",
"exists",
"else",
"the",
"default",
"one",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Controller/ResourceController.php#L98-L126 |
191,728 | backbee/backbee-php | Controller/ResourceController.php | ResourceController.createResourceResponse | private function createResourceResponse($filename)
{
$response = new Response();
$filestats = stat($filename);
$response->headers->set('Content-Type', MimeType::getInstance()->guess($filename));
$response->headers->set('Content-Length', $filestats['size']);
$response->setC... | php | private function createResourceResponse($filename)
{
$response = new Response();
$filestats = stat($filename);
$response->headers->set('Content-Type', MimeType::getInstance()->guess($filename));
$response->headers->set('Content-Length', $filestats['size']);
$response->setC... | [
"private",
"function",
"createResourceResponse",
"(",
"$",
"filename",
")",
"{",
"$",
"response",
"=",
"new",
"Response",
"(",
")",
";",
"$",
"filestats",
"=",
"stat",
"(",
"$",
"filename",
")",
";",
"$",
"response",
"->",
"headers",
"->",
"set",
"(",
... | Create Response object for resource.
@param string $filename valid filepath (file exists and readable)
@return Response | [
"Create",
"Response",
"object",
"for",
"resource",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Controller/ResourceController.php#L150-L168 |
191,729 | backbee/backbee-php | Util/Buffer.php | Buffer.dump | public static function dump($string, $color = null, $debug = true)
{
if ($debug) {
print self::formatOutput($string, $color);
static::flush();
}
} | php | public static function dump($string, $color = null, $debug = true)
{
if ($debug) {
print self::formatOutput($string, $color);
static::flush();
}
} | [
"public",
"static",
"function",
"dump",
"(",
"$",
"string",
",",
"$",
"color",
"=",
"null",
",",
"$",
"debug",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"debug",
")",
"{",
"print",
"self",
"::",
"formatOutput",
"(",
"$",
"string",
",",
"$",
"color",
... | pring the string value directly.
@param string $string
@codeCoverageIgnore | [
"pring",
"the",
"string",
"value",
"directly",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Buffer.php#L69-L75 |
191,730 | backbee/backbee-php | Site/Repository/SiteRepository.php | SiteRepository.findByCustomServerName | public function findByCustomServerName($server_name, array $sites_config)
{
$site_label = null;
foreach ($sites_config as $key => $data) {
if ($server_name === $data['domain']) {
$site_label = $key;
break;
}
}
$site = null;
... | php | public function findByCustomServerName($server_name, array $sites_config)
{
$site_label = null;
foreach ($sites_config as $key => $data) {
if ($server_name === $data['domain']) {
$site_label = $key;
break;
}
}
$site = null;
... | [
"public",
"function",
"findByCustomServerName",
"(",
"$",
"server_name",
",",
"array",
"$",
"sites_config",
")",
"{",
"$",
"site_label",
"=",
"null",
";",
"foreach",
"(",
"$",
"sites_config",
"as",
"$",
"key",
"=>",
"$",
"data",
")",
"{",
"if",
"(",
"$",... | Returns site entity according to custom server_name if it exists in sites_config.
@param string $server_name
@param array $sites_config
@return null|BackBee\Site\Site | [
"Returns",
"site",
"entity",
"according",
"to",
"custom",
"server_name",
"if",
"it",
"exists",
"in",
"sites_config",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Repository/SiteRepository.php#L56-L74 |
191,731 | backbee/backbee-php | ClassContent/CategoryManager.php | CategoryManager.getCategory | public function getCategory($v)
{
$v = $this->buildCategoryId($v);
return isset($this->categories[$v]) ? $this->categories[$v] : null;
} | php | public function getCategory($v)
{
$v = $this->buildCategoryId($v);
return isset($this->categories[$v]) ? $this->categories[$v] : null;
} | [
"public",
"function",
"getCategory",
"(",
"$",
"v",
")",
"{",
"$",
"v",
"=",
"$",
"this",
"->",
"buildCategoryId",
"(",
"$",
"v",
")",
";",
"return",
"isset",
"(",
"$",
"this",
"->",
"categories",
"[",
"$",
"v",
"]",
")",
"?",
"$",
"this",
"->",
... | Returns category by name or id.
@param string $v category name or id
@return Category|null return category object if provided name/id exists, else null | [
"Returns",
"category",
"by",
"name",
"or",
"id",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/CategoryManager.php#L81-L86 |
191,732 | backbee/backbee-php | ClassContent/CategoryManager.php | CategoryManager.loadCategoriesFromClassContentDirectories | private function loadCategoriesFromClassContentDirectories($directories)
{
$classcontents = [];
foreach ($directories as $directory) {
$classcontents = array_merge($classcontents, self::getClassContentClassnamesFromDir($directory));
}
foreach ($classcontents as $class) {... | php | private function loadCategoriesFromClassContentDirectories($directories)
{
$classcontents = [];
foreach ($directories as $directory) {
$classcontents = array_merge($classcontents, self::getClassContentClassnamesFromDir($directory));
}
foreach ($classcontents as $class) {... | [
"private",
"function",
"loadCategoriesFromClassContentDirectories",
"(",
"$",
"directories",
")",
"{",
"$",
"classcontents",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"directories",
"as",
"$",
"directory",
")",
"{",
"$",
"classcontents",
"=",
"array_merge",
"(",
... | Parse classcontent directories and hydrate categories attribute.
@param array $directories classcontent directories | [
"Parse",
"classcontent",
"directories",
"and",
"hydrate",
"categories",
"attribute",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/CategoryManager.php#L118-L134 |
191,733 | backbee/backbee-php | Security/Logout/BBLogoutHandler.php | BBLogoutHandler.logout | public function logout(Request $request, Response $response, TokenInterface $token)
{
$this->_authentication_provider->clearNonce($token);
} | php | public function logout(Request $request, Response $response, TokenInterface $token)
{
$this->_authentication_provider->clearNonce($token);
} | [
"public",
"function",
"logout",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"TokenInterface",
"$",
"token",
")",
"{",
"$",
"this",
"->",
"_authentication_provider",
"->",
"clearNonce",
"(",
"$",
"token",
")",
";",
"}"
] | Invalidate the current BB connection.
@param \Symfony\Component\HttpFoundation\Request $request
@param \Symfony\Component\HttpFoundation\Response $response
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token | [
"Invalidate",
"the",
"current",
"BB",
"connection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Logout/BBLogoutHandler.php#L66-L69 |
191,734 | backbee/backbee-php | MetaData/MetaDataResolver.php | MetaDataResolver.resolveConst | protected function resolveConst($const, Page $page = null)
{
$value = '';
switch (strtolower($const)) {
case 'url':
$value = (null !== $page) ? $page->getUrl() : '';
default:
break;
}
return $value;
} | php | protected function resolveConst($const, Page $page = null)
{
$value = '';
switch (strtolower($const)) {
case 'url':
$value = (null !== $page) ? $page->getUrl() : '';
default:
break;
}
return $value;
} | [
"protected",
"function",
"resolveConst",
"(",
"$",
"const",
",",
"Page",
"$",
"page",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"''",
";",
"switch",
"(",
"strtolower",
"(",
"$",
"const",
")",
")",
"{",
"case",
"'url'",
":",
"$",
"value",
"=",
"(",
... | Resolves constant value.
@param string $const
@param Page|NULL $page
@return string | [
"Resolves",
"constant",
"value",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/MetaData/MetaDataResolver.php#L274-L285 |
191,735 | backbee/backbee-php | MetaData/MetaDataResolver.php | MetaDataResolver.getElementValue | private function getElementValue(AbstractClassContent $content, Page $page)
{
$draft = $this->releaseDraft($content);
if ($content instanceof File) {
$value = $content->path;
} elseif ($content instanceof Keyword) {
$value = $this->getKeyword($content);
... | php | private function getElementValue(AbstractClassContent $content, Page $page)
{
$draft = $this->releaseDraft($content);
if ($content instanceof File) {
$value = $content->path;
} elseif ($content instanceof Keyword) {
$value = $this->getKeyword($content);
... | [
"private",
"function",
"getElementValue",
"(",
"AbstractClassContent",
"$",
"content",
",",
"Page",
"$",
"page",
")",
"{",
"$",
"draft",
"=",
"$",
"this",
"->",
"releaseDraft",
"(",
"$",
"content",
")",
";",
"if",
"(",
"$",
"content",
"instanceof",
"File",... | Returns value for Element content.
@param AbstractClassContent $content
@return string | [
"Returns",
"value",
"for",
"Element",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/MetaData/MetaDataResolver.php#L314-L330 |
191,736 | backbee/backbee-php | MetaData/MetaDataResolver.php | MetaDataResolver.getArrayValue | private function getArrayValue(array $array)
{
$value = [];
foreach ($array as $item) {
if ($item instanceof Keyword) {
$item = $this->getKeyword($item);
}
$value[] = trim(str_replace(array("\n", "\r"), '', strip_tags('' . $item)));
... | php | private function getArrayValue(array $array)
{
$value = [];
foreach ($array as $item) {
if ($item instanceof Keyword) {
$item = $this->getKeyword($item);
}
$value[] = trim(str_replace(array("\n", "\r"), '', strip_tags('' . $item)));
... | [
"private",
"function",
"getArrayValue",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"value",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"array",
"as",
"$",
"item",
")",
"{",
"if",
"(",
"$",
"item",
"instanceof",
"Keyword",
")",
"{",
"$",
"item",
"=",
... | Returns value for array.
@param array $array
@return string | [
"Returns",
"value",
"for",
"array",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/MetaData/MetaDataResolver.php#L365-L378 |
191,737 | backbee/backbee-php | MetaData/MetaDataResolver.php | MetaDataResolver.releaseDraft | private function releaseDraft($content)
{
$draft = null;
if (
$content instanceof AbstractClassContent
&& (null !== $draft = $content->getDraft())
) {
$content->releaseDraft();
}
return $draft;
} | php | private function releaseDraft($content)
{
$draft = null;
if (
$content instanceof AbstractClassContent
&& (null !== $draft = $content->getDraft())
) {
$content->releaseDraft();
}
return $draft;
} | [
"private",
"function",
"releaseDraft",
"(",
"$",
"content",
")",
"{",
"$",
"draft",
"=",
"null",
";",
"if",
"(",
"$",
"content",
"instanceof",
"AbstractClassContent",
"&&",
"(",
"null",
"!==",
"$",
"draft",
"=",
"$",
"content",
"->",
"getDraft",
"(",
")"... | Release content draft and returns it.
@param AbstractClassContent $content
@return Revision|NULL | [
"Release",
"content",
"draft",
"and",
"returns",
"it",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/MetaData/MetaDataResolver.php#L433-L444 |
191,738 | backbee/backbee-php | NestedNode/Page.php | Page.setDefaultProperties | private function setDefaultProperties($uid = null, Section $mainSection = null, $title = null, $url = null, $target = self::DEFAULT_TARGET)
{
$this->_state = Page::STATE_HIDDEN;
$this->_target = $target;
$this->_created = new \DateTime();
$this->_modified = new \DateTime();
$... | php | private function setDefaultProperties($uid = null, Section $mainSection = null, $title = null, $url = null, $target = self::DEFAULT_TARGET)
{
$this->_state = Page::STATE_HIDDEN;
$this->_target = $target;
$this->_created = new \DateTime();
$this->_modified = new \DateTime();
$... | [
"private",
"function",
"setDefaultProperties",
"(",
"$",
"uid",
"=",
"null",
",",
"Section",
"$",
"mainSection",
"=",
"null",
",",
"$",
"title",
"=",
"null",
",",
"$",
"url",
"=",
"null",
",",
"$",
"target",
"=",
"self",
"::",
"DEFAULT_TARGET",
")",
"{... | Sets the default values to properties.
@param string|null $uid
@param Section|null $mainSection
@param string|null $title
@param string|null $url
@param string $target
@return Page | [
"Sets",
"the",
"default",
"values",
"to",
"properties",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L403-L420 |
191,739 | backbee/backbee-php | NestedNode/Page.php | Page.getUrl | public function getUrl($doRedirect = null)
{
if (null === $doRedirect) {
$doRedirect = $this->useUrlRedirect;
}
if ($this->isRedirect() && $doRedirect) {
return $this->getRedirect();
}
return $this->_url;
} | php | public function getUrl($doRedirect = null)
{
if (null === $doRedirect) {
$doRedirect = $this->useUrlRedirect;
}
if ($this->isRedirect() && $doRedirect) {
return $this->getRedirect();
}
return $this->_url;
} | [
"public",
"function",
"getUrl",
"(",
"$",
"doRedirect",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"doRedirect",
")",
"{",
"$",
"doRedirect",
"=",
"$",
"this",
"->",
"useUrlRedirect",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"isRedirect",
"... | Returns the URL of the page.
@param boolean|null $doRedirect If true - returns redirect url (if exists), otherwise - current page url.
@return string | [
"Returns",
"the",
"URL",
"of",
"the",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L521-L532 |
191,740 | backbee/backbee-php | NestedNode/Page.php | Page.getNormalizeUri | public function getNormalizeUri()
{
if (null === $this->getSite()) {
return $this->getUrl();
}
return $this->getUrl().$this->getSite()->getDefaultExtension();
} | php | public function getNormalizeUri()
{
if (null === $this->getSite()) {
return $this->getUrl();
}
return $this->getUrl().$this->getSite()->getDefaultExtension();
} | [
"public",
"function",
"getNormalizeUri",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getSite",
"(",
")",
")",
"{",
"return",
"$",
"this",
"->",
"getUrl",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"getUrl",
"(",
")",
".",
"... | Returns the URL with extension of the page.
@return string | [
"Returns",
"the",
"URL",
"with",
"extension",
"of",
"the",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L539-L546 |
191,741 | backbee/backbee-php | NestedNode/Page.php | Page.isOnline | public function isOnline($ignoreSchedule = false)
{
$onlineByState = ($this->getState() & self::STATE_ONLINE) && !($this->getState() & self::STATE_DELETED);
if (true === $ignoreSchedule) {
return $onlineByState;
} else {
return $onlineByState
&& (null... | php | public function isOnline($ignoreSchedule = false)
{
$onlineByState = ($this->getState() & self::STATE_ONLINE) && !($this->getState() & self::STATE_DELETED);
if (true === $ignoreSchedule) {
return $onlineByState;
} else {
return $onlineByState
&& (null... | [
"public",
"function",
"isOnline",
"(",
"$",
"ignoreSchedule",
"=",
"false",
")",
"{",
"$",
"onlineByState",
"=",
"(",
"$",
"this",
"->",
"getState",
"(",
")",
"&",
"self",
"::",
"STATE_ONLINE",
")",
"&&",
"!",
"(",
"$",
"this",
"->",
"getState",
"(",
... | Is the page online?
@param boolean $ignoreSchedule Don't take care of publishing period.
@return boolean True if the page is online, false otherwise. | [
"Is",
"the",
"page",
"online?"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L732-L744 |
191,742 | backbee/backbee-php | NestedNode/Page.php | Page.setLayout | public function setLayout(Layout $layout, AbstractClassContent $toPushInMainZone = null)
{
$this->_layout = $layout;
$count = count((array) $layout->getZones());
// Add as much ContentSet to the page main ContentSet than defined zones in layout
for ($i = $this->getContentSet()->coun... | php | public function setLayout(Layout $layout, AbstractClassContent $toPushInMainZone = null)
{
$this->_layout = $layout;
$count = count((array) $layout->getZones());
// Add as much ContentSet to the page main ContentSet than defined zones in layout
for ($i = $this->getContentSet()->coun... | [
"public",
"function",
"setLayout",
"(",
"Layout",
"$",
"layout",
",",
"AbstractClassContent",
"$",
"toPushInMainZone",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_layout",
"=",
"$",
"layout",
";",
"$",
"count",
"=",
"count",
"(",
"(",
"array",
")",
"$",
... | Sets the layout for the page.
Adds as much ContentSet to the page main ContentSet than defined zones in layout.
@param Layout $layout
@param AbstractClassContent $toPushInMainZone
@return Page | [
"Sets",
"the",
"layout",
"for",
"the",
"page",
".",
"Adds",
"as",
"much",
"ContentSet",
"to",
"the",
"page",
"main",
"ContentSet",
"than",
"defined",
"zones",
"in",
"layout",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L818-L852 |
191,743 | backbee/backbee-php | NestedNode/Page.php | Page.setState | public function setState($state)
{
$state = (int) $state;
if ($this->isRoot() && !($state & Page::STATE_ONLINE)) {
throw new \LogicException("Root page state must be online.");
}
if (!$this->isOnline() && (self::STATE_ONLINE & $state) && !$this->isRoot() && !$this->getPu... | php | public function setState($state)
{
$state = (int) $state;
if ($this->isRoot() && !($state & Page::STATE_ONLINE)) {
throw new \LogicException("Root page state must be online.");
}
if (!$this->isOnline() && (self::STATE_ONLINE & $state) && !$this->isRoot() && !$this->getPu... | [
"public",
"function",
"setState",
"(",
"$",
"state",
")",
"{",
"$",
"state",
"=",
"(",
"int",
")",
"$",
"state",
";",
"if",
"(",
"$",
"this",
"->",
"isRoot",
"(",
")",
"&&",
"!",
"(",
"$",
"state",
"&",
"Page",
"::",
"STATE_ONLINE",
")",
")",
"... | Sets the state.
@param integer $state
@return Page
@throws \LogicException Raises if this page is root and not online. | [
"Sets",
"the",
"state",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L946-L960 |
191,744 | backbee/backbee-php | NestedNode/Page.php | Page.setPublishing | public function setPublishing($publishing = null)
{
if ($publishing === null) {
$this->_publishing = null;
} else {
$this->_publishing = $this->validatePublishing($publishing);
}
return $this;
} | php | public function setPublishing($publishing = null)
{
if ($publishing === null) {
$this->_publishing = null;
} else {
$this->_publishing = $this->validatePublishing($publishing);
}
return $this;
} | [
"public",
"function",
"setPublishing",
"(",
"$",
"publishing",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"publishing",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_publishing",
"=",
"null",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"_publishing",
"=",
... | Sets the publishing date.
@param \DateTime|null $publishing
@return Page | [
"Sets",
"the",
"publishing",
"date",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L969-L978 |
191,745 | backbee/backbee-php | NestedNode/Page.php | Page.validatePublishing | private function validatePublishing($publishing)
{
if ($this->isRoot() && $publishing !== null) {
throw new \LogicException("Root page can't be scheduled published.");
}
if (!($publishing instanceof \DateTime)) {
$publishing = $this->convertTimestampToDateTime($publi... | php | private function validatePublishing($publishing)
{
if ($this->isRoot() && $publishing !== null) {
throw new \LogicException("Root page can't be scheduled published.");
}
if (!($publishing instanceof \DateTime)) {
$publishing = $this->convertTimestampToDateTime($publi... | [
"private",
"function",
"validatePublishing",
"(",
"$",
"publishing",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isRoot",
"(",
")",
"&&",
"$",
"publishing",
"!==",
"null",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"\"Root page can't be scheduled publ... | Validate the publishing date.
@param \DateTime $publishing
@return \DateTime
@throws \LogicException Raises if this page is root and publishing not null
or page not root but publishing datetime in the past. | [
"Validate",
"the",
"publishing",
"date",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L990-L1001 |
191,746 | backbee/backbee-php | NestedNode/Page.php | Page.setArchiving | public function setArchiving($archiving = null)
{
if ($archiving === null) {
$this->_archiving = null;
} else {
$this->_archiving = $this->validateArchiving($archiving);
}
return $this;
} | php | public function setArchiving($archiving = null)
{
if ($archiving === null) {
$this->_archiving = null;
} else {
$this->_archiving = $this->validateArchiving($archiving);
}
return $this;
} | [
"public",
"function",
"setArchiving",
"(",
"$",
"archiving",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"archiving",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"_archiving",
"=",
"null",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"_archiving",
"=",
"$",
... | Sets the archiving date.
@param \DateTime|null $archiving
@return Page | [
"Sets",
"the",
"archiving",
"date",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1010-L1019 |
191,747 | backbee/backbee-php | NestedNode/Page.php | Page.validateArchiving | private function validateArchiving($archiving)
{
if ($this->isRoot() && $archiving !== null) {
throw new \LogicException("Root page can't be archived.");
}
if (!($archiving instanceof \DateTime)) {
$archiving = $this->convertTimestampToDateTime($archiving);
}... | php | private function validateArchiving($archiving)
{
if ($this->isRoot() && $archiving !== null) {
throw new \LogicException("Root page can't be archived.");
}
if (!($archiving instanceof \DateTime)) {
$archiving = $this->convertTimestampToDateTime($archiving);
}... | [
"private",
"function",
"validateArchiving",
"(",
"$",
"archiving",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isRoot",
"(",
")",
"&&",
"$",
"archiving",
"!==",
"null",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"\"Root page can't be archived.\"",
"... | Validate the archiving date.
@param \DateTime $archiving
@return \DateTime
@throws \LogicException Raises if this page is root and archiving not null
or page not root but archiving datetime in the past. | [
"Validate",
"the",
"archiving",
"date",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1031-L1046 |
191,748 | backbee/backbee-php | NestedNode/Page.php | Page.getInheritedContensetZoneParams | public function getInheritedContensetZoneParams(ContentSet $contentSet)
{
$zone = null;
if (
null === $this->getLayout()
|| null === $this->getParent()
|| false === is_array($this->getLayout()->getZones())
) {
return $zone;
}
... | php | public function getInheritedContensetZoneParams(ContentSet $contentSet)
{
$zone = null;
if (
null === $this->getLayout()
|| null === $this->getParent()
|| false === is_array($this->getLayout()->getZones())
) {
return $zone;
}
... | [
"public",
"function",
"getInheritedContensetZoneParams",
"(",
"ContentSet",
"$",
"contentSet",
")",
"{",
"$",
"zone",
"=",
"null",
";",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getLayout",
"(",
")",
"||",
"null",
"===",
"$",
"this",
"->",
"getParent",... | Returns the inherited zone according to the provided ContentSet.
@param ContentSet $contentSet
@return \StdClass|null The inherited zone if found. | [
"Returns",
"the",
"inherited",
"zone",
"according",
"to",
"the",
"provided",
"ContentSet",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1083-L1106 |
191,749 | backbee/backbee-php | NestedNode/Page.php | Page.getParentZoneAtSamePositionIfExists | public function getParentZoneAtSamePositionIfExists(ContentSet $contentSet)
{
$indexOfContent = $this->getContentSet()->indexOfByUid($contentSet, true);
if (false === $indexOfContent) {
return false;
}
$parent = $this->getParent();
if (null === $parent) {
... | php | public function getParentZoneAtSamePositionIfExists(ContentSet $contentSet)
{
$indexOfContent = $this->getContentSet()->indexOfByUid($contentSet, true);
if (false === $indexOfContent) {
return false;
}
$parent = $this->getParent();
if (null === $parent) {
... | [
"public",
"function",
"getParentZoneAtSamePositionIfExists",
"(",
"ContentSet",
"$",
"contentSet",
")",
"{",
"$",
"indexOfContent",
"=",
"$",
"this",
"->",
"getContentSet",
"(",
")",
"->",
"indexOfByUid",
"(",
"$",
"contentSet",
",",
"true",
")",
";",
"if",
"(... | Returns the parent ContentSet in the same zone, false if it is not found.
@param ContentSet $contentSet
@return ContentSet|false | [
"Returns",
"the",
"parent",
"ContentSet",
"in",
"the",
"same",
"zone",
"false",
"if",
"it",
"is",
"not",
"found",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1127-L1145 |
191,750 | backbee/backbee-php | NestedNode/Page.php | Page.getInheritedZones | public function getInheritedZones($uidOnly = false)
{
$inheritedZones = array();
$uidOnly = (isset($uidOnly) && is_bool($uidOnly)) ? $uidOnly : false;
if (null !== $this->getParent()) {
$parentZones = $this->getParent()->getContentSet();
$cPageRootZoneContainer = $thi... | php | public function getInheritedZones($uidOnly = false)
{
$inheritedZones = array();
$uidOnly = (isset($uidOnly) && is_bool($uidOnly)) ? $uidOnly : false;
if (null !== $this->getParent()) {
$parentZones = $this->getParent()->getContentSet();
$cPageRootZoneContainer = $thi... | [
"public",
"function",
"getInheritedZones",
"(",
"$",
"uidOnly",
"=",
"false",
")",
"{",
"$",
"inheritedZones",
"=",
"array",
"(",
")",
";",
"$",
"uidOnly",
"=",
"(",
"isset",
"(",
"$",
"uidOnly",
")",
"&&",
"is_bool",
"(",
"$",
"uidOnly",
")",
")",
"... | Tells which "rootContentset" is inherited from currentpage's parent.
@param boolean $uidOnly
@return array Array of contentset uids | [
"Tells",
"which",
"rootContentset",
"is",
"inherited",
"from",
"currentpage",
"s",
"parent",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1154-L1173 |
191,751 | backbee/backbee-php | NestedNode/Page.php | Page.getPageMainZones | public function getPageMainZones()
{
$result = array();
if (null === $this->getLayout()) {
return $result;
}
$currentpageRootZones = $this->getContentSet();
$layoutZones = $this->getLayout()->getZones();
$count = count($layoutZones);
for ($i = 0;... | php | public function getPageMainZones()
{
$result = array();
if (null === $this->getLayout()) {
return $result;
}
$currentpageRootZones = $this->getContentSet();
$layoutZones = $this->getLayout()->getZones();
$count = count($layoutZones);
for ($i = 0;... | [
"public",
"function",
"getPageMainZones",
"(",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"getLayout",
"(",
")",
")",
"{",
"return",
"$",
"result",
";",
"}",
"$",
"currentpageRootZones",
"=",
"$... | Returns the main zones of the page
Page's mainzone can't be unlinked.
@return array | [
"Returns",
"the",
"main",
"zones",
"of",
"the",
"page",
"Page",
"s",
"mainzone",
"can",
"t",
"be",
"unlinked",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1181-L1207 |
191,752 | backbee/backbee-php | NestedNode/Page.php | Page.isLinkedToHisParentBy | public function isLinkedToHisParentBy(ContentSet $contentset = null)
{
if (
null !== $contentset &&
true === array_key_exists($contentset->getUid(), $this->getInheritedZones())
) {
return true;
}
return false;
} | php | public function isLinkedToHisParentBy(ContentSet $contentset = null)
{
if (
null !== $contentset &&
true === array_key_exists($contentset->getUid(), $this->getInheritedZones())
) {
return true;
}
return false;
} | [
"public",
"function",
"isLinkedToHisParentBy",
"(",
"ContentSet",
"$",
"contentset",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"contentset",
"&&",
"true",
"===",
"array_key_exists",
"(",
"$",
"contentset",
"->",
"getUid",
"(",
")",
",",
"$",
"t... | Is the ContentSet is linked to his parent.
@param ContentSet $contentset
@return boolean | [
"Is",
"the",
"ContentSet",
"is",
"linked",
"to",
"his",
"parent",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1216-L1226 |
191,753 | backbee/backbee-php | NestedNode/Page.php | Page.replaceRootContentSet | public function replaceRootContentSet(ContentSet $contentToReplace, ContentSet $newContentSet, $checkContentsLinkToParent = true)
{
$checkContentsLinkToParent = (true === $checkContentsLinkToParent);
$contentIsLinked = true === $checkContentsLinkToParent ? $this->isLinkedToHisParentBy($contentToRepl... | php | public function replaceRootContentSet(ContentSet $contentToReplace, ContentSet $newContentSet, $checkContentsLinkToParent = true)
{
$checkContentsLinkToParent = (true === $checkContentsLinkToParent);
$contentIsLinked = true === $checkContentsLinkToParent ? $this->isLinkedToHisParentBy($contentToRepl... | [
"public",
"function",
"replaceRootContentSet",
"(",
"ContentSet",
"$",
"contentToReplace",
",",
"ContentSet",
"$",
"newContentSet",
",",
"$",
"checkContentsLinkToParent",
"=",
"true",
")",
"{",
"$",
"checkContentsLinkToParent",
"=",
"(",
"true",
"===",
"$",
"checkCo... | Replaces the ContentSet of the page.
@param ContentSet $contentToReplace
@param ContentSet $newContentSet
@param boolean $checkContentsLinkToParent
@return ContentSet | [
"Replaces",
"the",
"ContentSet",
"of",
"the",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1237-L1249 |
191,754 | backbee/backbee-php | NestedNode/Page.php | Page.getUndeletedStates | public static function getUndeletedStates()
{
return array(
Page::STATE_OFFLINE,
Page::STATE_ONLINE,
Page::STATE_HIDDEN,
Page::STATE_ONLINE + Page::STATE_HIDDEN,
);
} | php | public static function getUndeletedStates()
{
return array(
Page::STATE_OFFLINE,
Page::STATE_ONLINE,
Page::STATE_HIDDEN,
Page::STATE_ONLINE + Page::STATE_HIDDEN,
);
} | [
"public",
"static",
"function",
"getUndeletedStates",
"(",
")",
"{",
"return",
"array",
"(",
"Page",
"::",
"STATE_OFFLINE",
",",
"Page",
"::",
"STATE_ONLINE",
",",
"Page",
"::",
"STATE_HIDDEN",
",",
"Page",
"::",
"STATE_ONLINE",
"+",
"Page",
"::",
"STATE_HIDDE... | Returns states except deleted.
@return integer[]
@codeCoverageIgnore | [
"Returns",
"states",
"except",
"deleted",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1257-L1265 |
191,755 | backbee/backbee-php | NestedNode/Page.php | Page.hasChildrenVisible | public function hasChildrenVisible()
{
foreach ($this->getChildren() as $child) {
if ($child->getState() == static::STATE_ONLINE) {
return true;
}
}
return false;
} | php | public function hasChildrenVisible()
{
foreach ($this->getChildren() as $child) {
if ($child->getState() == static::STATE_ONLINE) {
return true;
}
}
return false;
} | [
"public",
"function",
"hasChildrenVisible",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getChildren",
"(",
")",
"as",
"$",
"child",
")",
"{",
"if",
"(",
"$",
"child",
"->",
"getState",
"(",
")",
"==",
"static",
"::",
"STATE_ONLINE",
")",
"{",
... | Looks for at least one online children.
@return boolean True if at least one children of the page is online.
@deprecated | [
"Looks",
"for",
"at",
"least",
"one",
"online",
"children",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1289-L1298 |
191,756 | backbee/backbee-php | NestedNode/Page.php | Page.getBreadcrumb | public function getBreadcrumb(Page $page = null, $breadcrumb = array())
{
if (null === $this->breadcrumb) {
$page = (null !== $page) ? $page : $this;
$breadcrumb[] = $page;
if (null !== $page->getParent()) {
return $this->getBreadcrumb($page->getParent(), ... | php | public function getBreadcrumb(Page $page = null, $breadcrumb = array())
{
if (null === $this->breadcrumb) {
$page = (null !== $page) ? $page : $this;
$breadcrumb[] = $page;
if (null !== $page->getParent()) {
return $this->getBreadcrumb($page->getParent(), ... | [
"public",
"function",
"getBreadcrumb",
"(",
"Page",
"$",
"page",
"=",
"null",
",",
"$",
"breadcrumb",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"breadcrumb",
")",
"{",
"$",
"page",
"=",
"(",
"null",
"!==",
"$",
... | Returns an array of the ascendants.
@param Page $page
@param array $breadcrumb
@return Page[]
@deprecated | [
"Returns",
"an",
"array",
"of",
"the",
"ascendants",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1310-L1323 |
191,757 | backbee/backbee-php | NestedNode/Page.php | Page.getBreadcrumb_uids | public function getBreadcrumb_uids()
{
$breadcrumb_uids = array();
foreach ($this->getBreadcrumb() as $page) {
$breadcrumb_uids[] = $page->getUid();
}
return array_reverse($breadcrumb_uids);
} | php | public function getBreadcrumb_uids()
{
$breadcrumb_uids = array();
foreach ($this->getBreadcrumb() as $page) {
$breadcrumb_uids[] = $page->getUid();
}
return array_reverse($breadcrumb_uids);
} | [
"public",
"function",
"getBreadcrumb_uids",
"(",
")",
"{",
"$",
"breadcrumb_uids",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getBreadcrumb",
"(",
")",
"as",
"$",
"page",
")",
"{",
"$",
"breadcrumb_uids",
"[",
"]",
"=",
"$",
"page... | Returns an array of the unique identifiers of the ascendants.
@return string[]
@deprecated | [
"Returns",
"an",
"array",
"of",
"the",
"unique",
"identifiers",
"of",
"the",
"ascendants",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1332-L1340 |
191,758 | backbee/backbee-php | NestedNode/Page.php | Page.getStates | public function getStates()
{
$states = [];
if (self::STATE_OFFLINE === $this->_state) {
$states[] = self::STATE_OFFLINE;
} elseif (self::STATE_HIDDEN === $this->_state) {
$states[] = self::STATE_OFFLINE;
$states[] = self::STATE_HIDDEN;
} else {
... | php | public function getStates()
{
$states = [];
if (self::STATE_OFFLINE === $this->_state) {
$states[] = self::STATE_OFFLINE;
} elseif (self::STATE_HIDDEN === $this->_state) {
$states[] = self::STATE_OFFLINE;
$states[] = self::STATE_HIDDEN;
} else {
... | [
"public",
"function",
"getStates",
"(",
")",
"{",
"$",
"states",
"=",
"[",
"]",
";",
"if",
"(",
"self",
"::",
"STATE_OFFLINE",
"===",
"$",
"this",
"->",
"_state",
")",
"{",
"$",
"states",
"[",
"]",
"=",
"self",
"::",
"STATE_OFFLINE",
";",
"}",
"els... | Returns available states.
@return integer[]
@Serializer\VirtualProperty
@Serializer\SerializedName("states") | [
"Returns",
"available",
"states",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1447-L1465 |
191,759 | backbee/backbee-php | NestedNode/Page.php | Page.getStateCode | public function getStateCode()
{
$code = $this->isOnline(true) ? '1' : '0';
$code .= null !== $this->_workflow_state
? '_'.$this->_workflow_state->getCode()
: ''
;
return $code;
} | php | public function getStateCode()
{
$code = $this->isOnline(true) ? '1' : '0';
$code .= null !== $this->_workflow_state
? '_'.$this->_workflow_state->getCode()
: ''
;
return $code;
} | [
"public",
"function",
"getStateCode",
"(",
")",
"{",
"$",
"code",
"=",
"$",
"this",
"->",
"isOnline",
"(",
"true",
")",
"?",
"'1'",
":",
"'0'",
";",
"$",
"code",
".=",
"null",
"!==",
"$",
"this",
"->",
"_workflow_state",
"?",
"'_'",
".",
"$",
"this... | Returns the code of the workflow state.
@return integer
@Serializer\VirtualProperty
@Serializer\Type("string") | [
"Returns",
"the",
"code",
"of",
"the",
"workflow",
"state",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1501-L1510 |
191,760 | backbee/backbee-php | NestedNode/Page.php | Page.convertTimestampToDateTime | private function convertTimestampToDateTime($date)
{
if (false === ($date instanceof \DateTime) && false === is_int($date)) {
throw new InvalidArgumentException(
'Page::convertTimestampToDateTime() expect date argument to be an integer or an instance of \DateTime'
);
... | php | private function convertTimestampToDateTime($date)
{
if (false === ($date instanceof \DateTime) && false === is_int($date)) {
throw new InvalidArgumentException(
'Page::convertTimestampToDateTime() expect date argument to be an integer or an instance of \DateTime'
);
... | [
"private",
"function",
"convertTimestampToDateTime",
"(",
"$",
"date",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"$",
"date",
"instanceof",
"\\",
"DateTime",
")",
"&&",
"false",
"===",
"is_int",
"(",
"$",
"date",
")",
")",
"{",
"throw",
"new",
"InvalidAr... | Convert provided date to DateTime.
@param integer|\Datetime $date The date to convert to \DateTime.
@return DateTime
@throws InvalidArgumentException Raises if provided date is not an integer or an instance of \DateTime | [
"Convert",
"provided",
"date",
"to",
"DateTime",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1534-L1545 |
191,761 | backbee/backbee-php | NestedNode/Page.php | Page.createNewDefaultContent | private function createNewDefaultContent($classname, $mainzone = false)
{
$content = new $classname();
if (null !== $content->getProperty('labelized-by')) {
try {
$label = $content;
foreach (explode('->', (string) $label->getProperty('labelized-by')) as $p... | php | private function createNewDefaultContent($classname, $mainzone = false)
{
$content = new $classname();
if (null !== $content->getProperty('labelized-by')) {
try {
$label = $content;
foreach (explode('->', (string) $label->getProperty('labelized-by')) as $p... | [
"private",
"function",
"createNewDefaultContent",
"(",
"$",
"classname",
",",
"$",
"mainzone",
"=",
"false",
")",
"{",
"$",
"content",
"=",
"new",
"$",
"classname",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"content",
"->",
"getProperty",
"(",
"'labe... | Creates a new default content to be pushed in layout columns.
@param string $classname
@param boolean $mainzone
@return AbstractClassContent | [
"Creates",
"a",
"new",
"default",
"content",
"to",
"be",
"pushed",
"in",
"layout",
"columns",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1576-L1600 |
191,762 | backbee/backbee-php | NestedNode/Page.php | Page.hasChildren | public function hasChildren($ignoreDeleted = true)
{
if ($ignoreDeleted) {
return $this->hasMainSection() ? $this->getMainSection()->getHasChildren() : false;
}
return $this->hasMainSection() ? $this->getMainSection()->hasChildren() : false;
} | php | public function hasChildren($ignoreDeleted = true)
{
if ($ignoreDeleted) {
return $this->hasMainSection() ? $this->getMainSection()->getHasChildren() : false;
}
return $this->hasMainSection() ? $this->getMainSection()->hasChildren() : false;
} | [
"public",
"function",
"hasChildren",
"(",
"$",
"ignoreDeleted",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"ignoreDeleted",
")",
"{",
"return",
"$",
"this",
"->",
"hasMainSection",
"(",
")",
"?",
"$",
"this",
"->",
"getMainSection",
"(",
")",
"->",
"getHasCh... | Has the page children?
@return boolean
@Serializer\VirtualProperty
@Serializer\Type("boolean") | [
"Has",
"the",
"page",
"children?"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1610-L1617 |
191,763 | backbee/backbee-php | NestedNode/Page.php | Page.setLevel | public function setLevel($level)
{
if (false === Numeric::isPositiveInteger($level, false)) {
throw new InvalidArgumentException('A nested level must be a positive integer.');
}
$this->_level = $level;
return $this;
} | php | public function setLevel($level)
{
if (false === Numeric::isPositiveInteger($level, false)) {
throw new InvalidArgumentException('A nested level must be a positive integer.');
}
$this->_level = $level;
return $this;
} | [
"public",
"function",
"setLevel",
"(",
"$",
"level",
")",
"{",
"if",
"(",
"false",
"===",
"Numeric",
"::",
"isPositiveInteger",
"(",
"$",
"level",
",",
"false",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'A nested level must be a positive i... | Sets the level.
@param integer $level
@return Page
@throws InvalidArgumentException Raises if the value can not be cast to positive integer. | [
"Sets",
"the",
"level",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1707-L1714 |
191,764 | backbee/backbee-php | NestedNode/Page.php | Page.setMainSection | public function setMainSection(Section $section)
{
if ($section === $this->_mainsection) {
return $this;
}
$this->_mainsection = $section;
$this->_position = 0;
$this->_level = $section->getLevel();
$section->setPage($this);
return $this->setSect... | php | public function setMainSection(Section $section)
{
if ($section === $this->_mainsection) {
return $this;
}
$this->_mainsection = $section;
$this->_position = 0;
$this->_level = $section->getLevel();
$section->setPage($this);
return $this->setSect... | [
"public",
"function",
"setMainSection",
"(",
"Section",
"$",
"section",
")",
"{",
"if",
"(",
"$",
"section",
"===",
"$",
"this",
"->",
"_mainsection",
")",
"{",
"return",
"$",
"this",
";",
"}",
"$",
"this",
"->",
"_mainsection",
"=",
"$",
"section",
";... | Sets the main section for this page.
@param Section $section
@return Page | [
"Sets",
"the",
"main",
"section",
"for",
"this",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1820-L1832 |
191,765 | backbee/backbee-php | NestedNode/Page.php | Page.setSection | public function setSection(Section $section)
{
if ($section !== $this->_mainsection) {
$this->_mainsection = null;
$this->_level = $section->getLevel() + 1;
if (0 === $this->_position) {
$this->_position = 1;
}
}
$this->_sectio... | php | public function setSection(Section $section)
{
if ($section !== $this->_mainsection) {
$this->_mainsection = null;
$this->_level = $section->getLevel() + 1;
if (0 === $this->_position) {
$this->_position = 1;
}
}
$this->_sectio... | [
"public",
"function",
"setSection",
"(",
"Section",
"$",
"section",
")",
"{",
"if",
"(",
"$",
"section",
"!==",
"$",
"this",
"->",
"_mainsection",
")",
"{",
"$",
"this",
"->",
"_mainsection",
"=",
"null",
";",
"$",
"this",
"->",
"_level",
"=",
"$",
"... | Sets the section for this page.
@param Section $section
@return Page | [
"Sets",
"the",
"section",
"for",
"this",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1841-L1854 |
191,766 | backbee/backbee-php | NestedNode/Page.php | Page.getSection | public function getSection()
{
if (null === $this->_section) {
$this->setSection(new Section($this->getUid(), array('page' => $this)));
}
return $this->_section;
} | php | public function getSection()
{
if (null === $this->_section) {
$this->setSection(new Section($this->getUid(), array('page' => $this)));
}
return $this->_section;
} | [
"public",
"function",
"getSection",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_section",
")",
"{",
"$",
"this",
"->",
"setSection",
"(",
"new",
"Section",
"(",
"$",
"this",
"->",
"getUid",
"(",
")",
",",
"array",
"(",
"'page'",
"... | Returns the section of this page.
@return Section | [
"Returns",
"the",
"section",
"of",
"this",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1861-L1868 |
191,767 | backbee/backbee-php | NestedNode/Page.php | Page.isAncestorOf | public function isAncestorOf(Page $page, $strict = true)
{
if (!$this->hasMainSection()) {
return ($this === $page && false === $strict);
}
return $this->getSection()->isAncestorOf($page->getSection(), $strict) || $page->getParent() === $this;
} | php | public function isAncestorOf(Page $page, $strict = true)
{
if (!$this->hasMainSection()) {
return ($this === $page && false === $strict);
}
return $this->getSection()->isAncestorOf($page->getSection(), $strict) || $page->getParent() === $this;
} | [
"public",
"function",
"isAncestorOf",
"(",
"Page",
"$",
"page",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasMainSection",
"(",
")",
")",
"{",
"return",
"(",
"$",
"this",
"===",
"$",
"page",
"&&",
"false",
"==="... | Is this page is an ancestor of the provided one?
@param Page $page
@param boolean $strict Optional, if true (default) this page is excluded of ancestors list.
@return boolean True if this page is an anscestor of provided page, false otherwise... | [
"Is",
"this",
"page",
"is",
"an",
"ancestor",
"of",
"the",
"provided",
"one?"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1888-L1894 |
191,768 | backbee/backbee-php | NestedNode/Page.php | Page.isDescendantOf | public function isDescendantOf(Page $page, $strict = true)
{
if ($this === $page) {
return !$strict;
}
if (!$this->hasMainSection()) {
return $page === $this->getParent() || $this->getSection()->isDescendantOf($page->getSection());
}
return $this->ge... | php | public function isDescendantOf(Page $page, $strict = true)
{
if ($this === $page) {
return !$strict;
}
if (!$this->hasMainSection()) {
return $page === $this->getParent() || $this->getSection()->isDescendantOf($page->getSection());
}
return $this->ge... | [
"public",
"function",
"isDescendantOf",
"(",
"Page",
"$",
"page",
",",
"$",
"strict",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"this",
"===",
"$",
"page",
")",
"{",
"return",
"!",
"$",
"strict",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
"hasMain... | Is this page is a descendant of the provided one?
@param Page $page
@param boolean $strict Optional, if truz (default) this page is excluded of descendants list.
@return boolean True if this page is a descendant of provided page, false otherw... | [
"Is",
"this",
"page",
"is",
"a",
"descendant",
"of",
"the",
"provided",
"one?"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1904-L1915 |
191,769 | backbee/backbee-php | NestedNode/Page.php | Page.getRoot | public function getRoot()
{
if ($this->getSection()->getRoot() instanceof Section) {
return $this->getSection()->getRoot()->getPage();
}
return null;
} | php | public function getRoot()
{
if ($this->getSection()->getRoot() instanceof Section) {
return $this->getSection()->getRoot()->getPage();
}
return null;
} | [
"public",
"function",
"getRoot",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getSection",
"(",
")",
"->",
"getRoot",
"(",
")",
"instanceof",
"Section",
")",
"{",
"return",
"$",
"this",
"->",
"getSection",
"(",
")",
"->",
"getRoot",
"(",
")",
"->",
... | Returns the root page.
@return Page | [
"Returns",
"the",
"root",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1922-L1929 |
191,770 | backbee/backbee-php | NestedNode/Page.php | Page.setRoot | public function setRoot(Page $root)
{
if ($this->hasMainSection()) {
$this->getMainSection()->setRoot($root->getRoot()->getMainSection());
}
return $this;
} | php | public function setRoot(Page $root)
{
if ($this->hasMainSection()) {
$this->getMainSection()->setRoot($root->getRoot()->getMainSection());
}
return $this;
} | [
"public",
"function",
"setRoot",
"(",
"Page",
"$",
"root",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasMainSection",
"(",
")",
")",
"{",
"$",
"this",
"->",
"getMainSection",
"(",
")",
"->",
"setRoot",
"(",
"$",
"root",
"->",
"getRoot",
"(",
")",
"-... | Sets the root node.
@param Page $root
@return Page | [
"Sets",
"the",
"root",
"node",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1948-L1955 |
191,771 | backbee/backbee-php | NestedNode/Page.php | Page.getParent | public function getParent()
{
$section = $this->getSection();
if ($this->hasMainSection()) {
if ($section->isRoot()) {
return null;
} elseif ($section->getParent() instanceof Section) {
return $section->getParent()->getPage();
} els... | php | public function getParent()
{
$section = $this->getSection();
if ($this->hasMainSection()) {
if ($section->isRoot()) {
return null;
} elseif ($section->getParent() instanceof Section) {
return $section->getParent()->getPage();
} els... | [
"public",
"function",
"getParent",
"(",
")",
"{",
"$",
"section",
"=",
"$",
"this",
"->",
"getSection",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"hasMainSection",
"(",
")",
")",
"{",
"if",
"(",
"$",
"section",
"->",
"isRoot",
"(",
")",
")",
"... | Returns the parent page, null if this page is root.
@return Page|null | [
"Returns",
"the",
"parent",
"page",
"null",
"if",
"this",
"page",
"is",
"root",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Page.php#L1983-L1997 |
191,772 | backbee/backbee-php | Event/Listener/LayoutListener.php | LayoutListener.onBeforeSave | public static function onBeforeSave(Event $event)
{
$layout = $event->getTarget();
if (!is_a($layout, 'BackBee\Site\Layout')) {
return;
}
$dispatcher = $event->getDispatcher();
if (null !== $dispatcher->getApplication()) {
if (is_a($event->getEventArg... | php | public static function onBeforeSave(Event $event)
{
$layout = $event->getTarget();
if (!is_a($layout, 'BackBee\Site\Layout')) {
return;
}
$dispatcher = $event->getDispatcher();
if (null !== $dispatcher->getApplication()) {
if (is_a($event->getEventArg... | [
"public",
"static",
"function",
"onBeforeSave",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"layout",
"=",
"$",
"event",
"->",
"getTarget",
"(",
")",
";",
"if",
"(",
"!",
"is_a",
"(",
"$",
"layout",
",",
"'BackBee\\Site\\Layout'",
")",
")",
"{",
"return... | Occur on site.layout.beforesave events.
@access public
@param Event $event | [
"Occur",
"on",
"site",
".",
"layout",
".",
"beforesave",
"events",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Event/Listener/LayoutListener.php#L47-L80 |
191,773 | backbee/backbee-php | Event/Listener/LayoutListener.php | LayoutListener.onAfterRemove | public static function onAfterRemove(Event $event)
{
$layout = $event->getTarget();
if (!is_a($layout, 'BackBee\Site\Layout')) {
return;
}
$dispatcher = $event->getDispatcher();
if (null !== $dispatcher->getApplication()) {
$dispatcher->getApplication... | php | public static function onAfterRemove(Event $event)
{
$layout = $event->getTarget();
if (!is_a($layout, 'BackBee\Site\Layout')) {
return;
}
$dispatcher = $event->getDispatcher();
if (null !== $dispatcher->getApplication()) {
$dispatcher->getApplication... | [
"public",
"static",
"function",
"onAfterRemove",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"layout",
"=",
"$",
"event",
"->",
"getTarget",
"(",
")",
";",
"if",
"(",
"!",
"is_a",
"(",
"$",
"layout",
",",
"'BackBee\\Site\\Layout'",
")",
")",
"{",
"retur... | Occur on site.layout.postremove events.
@access public
@param Event $event | [
"Occur",
"on",
"site",
".",
"layout",
".",
"postremove",
"events",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Event/Listener/LayoutListener.php#L89-L104 |
191,774 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.setContainer | public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
if ($this->getApplication()) {
$mediaClasses = $this->getApplication()->getAutoloader()->glob('Media'.DIRECTORY_SEPARATOR.'*');
foreach ($mediaClasses as $mediaClass) {
... | php | public function setContainer(ContainerInterface $container = null)
{
parent::setContainer($container);
if ($this->getApplication()) {
$mediaClasses = $this->getApplication()->getAutoloader()->glob('Media'.DIRECTORY_SEPARATOR.'*');
foreach ($mediaClasses as $mediaClass) {
... | [
"public",
"function",
"setContainer",
"(",
"ContainerInterface",
"$",
"container",
"=",
"null",
")",
"{",
"parent",
"::",
"setContainer",
"(",
"$",
"container",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getApplication",
"(",
")",
")",
"{",
"$",
"mediaClasse... | Creates an instance of MediaController.
@param ContainerInterface|null $container
@internal param ContainerInterface $app | [
"Creates",
"an",
"instance",
"of",
"MediaController",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L54-L64 |
191,775 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.putAction | public function putAction($id, Request $request)
{
$mediaTitle = $request->get('title', 'Untitled media');
$mediaFolderUid = $request->get('media_folder', null);
$media = $this->getMediaRepository()->find($id);
$currentMediaFoldierUid = $media->getMediaFolder()->getUid();
if... | php | public function putAction($id, Request $request)
{
$mediaTitle = $request->get('title', 'Untitled media');
$mediaFolderUid = $request->get('media_folder', null);
$media = $this->getMediaRepository()->find($id);
$currentMediaFoldierUid = $media->getMediaFolder()->getUid();
if... | [
"public",
"function",
"putAction",
"(",
"$",
"id",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"mediaTitle",
"=",
"$",
"request",
"->",
"get",
"(",
"'title'",
",",
"'Untitled media'",
")",
";",
"$",
"mediaFolderUid",
"=",
"$",
"request",
"->",
"get",
... | Update media content's and folder | [
"Update",
"media",
"content",
"s",
"and",
"folder"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L146-L171 |
191,776 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.postAction | public function postAction(Request $request)
{
$contentUid = $request->request->get('content_uid');
$contentType = $request->request->get('content_type', null);
$mediaFolderUid = $request->request->get('folder_uid', null);
$mediaTitle = $request->request->get('title', 'Untitled media... | php | public function postAction(Request $request)
{
$contentUid = $request->request->get('content_uid');
$contentType = $request->request->get('content_type', null);
$mediaFolderUid = $request->request->get('folder_uid', null);
$mediaTitle = $request->request->get('title', 'Untitled media... | [
"public",
"function",
"postAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"contentUid",
"=",
"$",
"request",
"->",
"request",
"->",
"get",
"(",
"'content_uid'",
")",
";",
"$",
"contentType",
"=",
"$",
"request",
"->",
"request",
"->",
"get",
"("... | Post a new media.
@param Request $request
@return Response
@throws BadRequestHttpException | [
"Post",
"a",
"new",
"media",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L180-L221 |
191,777 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.getClassContentManager | private function getClassContentManager()
{
$manager = $this->getApplication()
->getContainer()
->get('classcontent.manager')
->setBBUserToken($this->getApplication()->getBBUserToken());
return $manager;
} | php | private function getClassContentManager()
{
$manager = $this->getApplication()
->getContainer()
->get('classcontent.manager')
->setBBUserToken($this->getApplication()->getBBUserToken());
return $manager;
} | [
"private",
"function",
"getClassContentManager",
"(",
")",
"{",
"$",
"manager",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'classcontent.manager'",
")",
"->",
"setBBUserToken",
"(",
"$",
"this",
"->... | Get class content manager.
@return mixed | [
"Get",
"class",
"content",
"manager",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L248-L256 |
191,778 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.mediaToJson | private function mediaToJson($collection)
{
$result = [];
foreach ($collection as $media) {
$content = $media->getContent();
if (null !== $draft = $this->getClassContentManager()->getDraft($content)) {
$content->setDraft($draft);
}
//... | php | private function mediaToJson($collection)
{
$result = [];
foreach ($collection as $media) {
$content = $media->getContent();
if (null !== $draft = $this->getClassContentManager()->getDraft($content)) {
$content->setDraft($draft);
}
//... | [
"private",
"function",
"mediaToJson",
"(",
"$",
"collection",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"collection",
"as",
"$",
"media",
")",
"{",
"$",
"content",
"=",
"$",
"media",
"->",
"getContent",
"(",
")",
";",
"if",
... | Generate json.
@param $collection
@return array | [
"Generate",
"json",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L264-L288 |
191,779 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.addRangeToContent | private function addRangeToContent(Response $response, $collection, $offset, $limit)
{
$total = "*";
if ($collection instanceof Paginator) {
$total = count($collection);
}
$lastResult = $offset + $limit - 1;
$lastResult = $lastResult < 0 ? 0 : $lastResult;
... | php | private function addRangeToContent(Response $response, $collection, $offset, $limit)
{
$total = "*";
if ($collection instanceof Paginator) {
$total = count($collection);
}
$lastResult = $offset + $limit - 1;
$lastResult = $lastResult < 0 ? 0 : $lastResult;
... | [
"private",
"function",
"addRangeToContent",
"(",
"Response",
"$",
"response",
",",
"$",
"collection",
",",
"$",
"offset",
",",
"$",
"limit",
")",
"{",
"$",
"total",
"=",
"\"*\"",
";",
"if",
"(",
"$",
"collection",
"instanceof",
"Paginator",
")",
"{",
"$"... | Add range to content.
@param Response $response
@param array $collection
@param int $offset
@param int $limit
@return Response | [
"Add",
"range",
"to",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L299-L311 |
191,780 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.getClassicCollection | private function getClassicCollection(Request $request, $mediaFolder, $start, $count)
{
$params = $request->query->all();
$contentType = $request->get('contentType', null);
if (null !== $contentType) {
try {
$params['contentType'] = AbstractClassContent::getClas... | php | private function getClassicCollection(Request $request, $mediaFolder, $start, $count)
{
$params = $request->query->all();
$contentType = $request->get('contentType', null);
if (null !== $contentType) {
try {
$params['contentType'] = AbstractClassContent::getClas... | [
"private",
"function",
"getClassicCollection",
"(",
"Request",
"$",
"request",
",",
"$",
"mediaFolder",
",",
"$",
"start",
",",
"$",
"count",
")",
"{",
"$",
"params",
"=",
"$",
"request",
"->",
"query",
"->",
"all",
"(",
")",
";",
"$",
"contentType",
"... | Get classic collection.
@param Request $request
@param MediaFolder $mediaFolder
@param int $start
@param int $count
@return mixed | [
"Get",
"classic",
"collection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L322-L339 |
191,781 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.getCollectionByContent | private function getCollectionByContent($contentUid, MediaFolder $mediaFolder)
{
$content = $this->getEntityManager()->find('BackBee\ClassContent\AbstractClassContent', $contentUid);
if (null === $content) {
throw new NotFoundHttpException("No content find with uid '{$contentUid}'");
... | php | private function getCollectionByContent($contentUid, MediaFolder $mediaFolder)
{
$content = $this->getEntityManager()->find('BackBee\ClassContent\AbstractClassContent', $contentUid);
if (null === $content) {
throw new NotFoundHttpException("No content find with uid '{$contentUid}'");
... | [
"private",
"function",
"getCollectionByContent",
"(",
"$",
"contentUid",
",",
"MediaFolder",
"$",
"mediaFolder",
")",
"{",
"$",
"content",
"=",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"find",
"(",
"'BackBee\\ClassContent\\AbstractClassContent'",
",",
... | Get collection by content.
@param string $contentUid
@param MediaFolder $mediaFolder
@return mixed | [
"Get",
"collection",
"by",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L348-L357 |
191,782 | backbee/backbee-php | Rest/Controller/MediaController.php | MediaController.autoCommitContent | private function autoCommitContent(AbstractClassContent $content)
{
// Commit subelement of the Media content
foreach ($content->getData() as $subcontent) {
if (!($subcontent instanceof AbstractClassContent)) {
continue;
}
$this->commit($subconten... | php | private function autoCommitContent(AbstractClassContent $content)
{
// Commit subelement of the Media content
foreach ($content->getData() as $subcontent) {
if (!($subcontent instanceof AbstractClassContent)) {
continue;
}
$this->commit($subconten... | [
"private",
"function",
"autoCommitContent",
"(",
"AbstractClassContent",
"$",
"content",
")",
"{",
"// Commit subelement of the Media content",
"foreach",
"(",
"$",
"content",
"->",
"getData",
"(",
")",
"as",
"$",
"subcontent",
")",
"{",
"if",
"(",
"!",
"(",
"$"... | Auto commit content put or post in the library.
@param AbstractClassContent $content | [
"Auto",
"commit",
"content",
"put",
"or",
"post",
"in",
"the",
"library",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/MediaController.php#L364-L377 |
191,783 | Geocodio/geocodio-php | src/Stanley/Geocodio/Client.php | Client.getRequest | protected function getRequest($data, $fields, $verb)
{
$params = [
'q' => $data,
'api_key' => $this->apiKey,
'fields' => implode(',', $fields)
];
$response = $this->client->get($verb, [
'query' => $params
]);
return $this->che... | php | protected function getRequest($data, $fields, $verb)
{
$params = [
'q' => $data,
'api_key' => $this->apiKey,
'fields' => implode(',', $fields)
];
$response = $this->client->get($verb, [
'query' => $params
]);
return $this->che... | [
"protected",
"function",
"getRequest",
"(",
"$",
"data",
",",
"$",
"fields",
",",
"$",
"verb",
")",
"{",
"$",
"params",
"=",
"[",
"'q'",
"=>",
"$",
"data",
",",
"'api_key'",
"=>",
"$",
"this",
"->",
"apiKey",
",",
"'fields'",
"=>",
"implode",
"(",
... | Call Guzzle with Get Request
@param string $data Address Data
@param string $verb The method being called - geocode, parse, or reverse
@return GuzzleHttp\Psr7\Response | [
"Call",
"Guzzle",
"with",
"Get",
"Request"
] | 643f84024fa74d5ea6b03f6a6d86939baff7569b | https://github.com/Geocodio/geocodio-php/blob/643f84024fa74d5ea6b03f6a6d86939baff7569b/src/Stanley/Geocodio/Client.php#L125-L138 |
191,784 | Geocodio/geocodio-php | src/Stanley/Geocodio/Client.php | Client.bulkPost | protected function bulkPost($data, $fields, $verb = 'geocode')
{
$params = [
'api_key' => $this->apiKey,
'fields' => implode(',', $fields)
];
$response = $this->client->post($verb, [
'query' => $params,
'json' => $data
]);
ret... | php | protected function bulkPost($data, $fields, $verb = 'geocode')
{
$params = [
'api_key' => $this->apiKey,
'fields' => implode(',', $fields)
];
$response = $this->client->post($verb, [
'query' => $params,
'json' => $data
]);
ret... | [
"protected",
"function",
"bulkPost",
"(",
"$",
"data",
",",
"$",
"fields",
",",
"$",
"verb",
"=",
"'geocode'",
")",
"{",
"$",
"params",
"=",
"[",
"'api_key'",
"=>",
"$",
"this",
"->",
"apiKey",
",",
"'fields'",
"=>",
"implode",
"(",
"','",
",",
"$",
... | Call Guzzle Post request method
@param array $data Address data
@param string $verb Method to be called - should only be geocode for now
@return GuzzleHttp\Psr7\Response | [
"Call",
"Guzzle",
"Post",
"request",
"method"
] | 643f84024fa74d5ea6b03f6a6d86939baff7569b | https://github.com/Geocodio/geocodio-php/blob/643f84024fa74d5ea6b03f6a6d86939baff7569b/src/Stanley/Geocodio/Client.php#L147-L160 |
191,785 | Geocodio/geocodio-php | src/Stanley/Geocodio/Client.php | Client.checkResponse | protected function checkResponse(Response $response)
{
$status = $response->getStatusCode();
$reason = $response->getReasonPhrase();
switch ($status) {
case '403':
throw new Exceptions\GeocodioAuthError($reason);
break;
case '422':
... | php | protected function checkResponse(Response $response)
{
$status = $response->getStatusCode();
$reason = $response->getReasonPhrase();
switch ($status) {
case '403':
throw new Exceptions\GeocodioAuthError($reason);
break;
case '422':
... | [
"protected",
"function",
"checkResponse",
"(",
"Response",
"$",
"response",
")",
"{",
"$",
"status",
"=",
"$",
"response",
"->",
"getStatusCode",
"(",
")",
";",
"$",
"reason",
"=",
"$",
"response",
"->",
"getReasonPhrase",
"(",
")",
";",
"switch",
"(",
"... | Check response code and throw appropriate exception
@param GuzzleHttp\Psr7\Response $response Guzzle Response
@return mixed | [
"Check",
"response",
"code",
"and",
"throw",
"appropriate",
"exception"
] | 643f84024fa74d5ea6b03f6a6d86939baff7569b | https://github.com/Geocodio/geocodio-php/blob/643f84024fa74d5ea6b03f6a6d86939baff7569b/src/Stanley/Geocodio/Client.php#L168-L193 |
191,786 | backbee/backbee-php | Security/Authorization/Voter/BBAclVoter.php | BBAclVoter.voteForObject | private function voteForObject(TokenInterface $token, $object, array $attributes)
{
if (self::ACCESS_GRANTED !== $result = parent::vote($token, $object, $attributes)) {
// try class-scope ace
$objectIdentity = $this->getClassScopeObjectIdentity($object);
$result = parent:... | php | private function voteForObject(TokenInterface $token, $object, array $attributes)
{
if (self::ACCESS_GRANTED !== $result = parent::vote($token, $object, $attributes)) {
// try class-scope ace
$objectIdentity = $this->getClassScopeObjectIdentity($object);
$result = parent:... | [
"private",
"function",
"voteForObject",
"(",
"TokenInterface",
"$",
"token",
",",
"$",
"object",
",",
"array",
"$",
"attributes",
")",
"{",
"if",
"(",
"self",
"::",
"ACCESS_GRANTED",
"!==",
"$",
"result",
"=",
"parent",
"::",
"vote",
"(",
"$",
"token",
"... | Returns the vote for the cuurent object, if denied try the vote for the general object.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@param object|ObjectIdentityInterface $object
@param array ... | [
"Returns",
"the",
"vote",
"for",
"the",
"cuurent",
"object",
"if",
"denied",
"try",
"the",
"vote",
"for",
"the",
"general",
"object",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authorization/Voter/BBAclVoter.php#L100-L109 |
191,787 | backbee/backbee-php | Security/Authorization/Voter/BBAclVoter.php | BBAclVoter.voteForPage | private function voteForPage(TokenInterface $token, Page $page, array $attributes)
{
if (self::ACCESS_DENIED === $result = $this->voteForObject($token, $page, $attributes)) {
if (null !== $page->getParent()) {
$result = $this->voteForPage($token, $page->getParent(), $attributes);... | php | private function voteForPage(TokenInterface $token, Page $page, array $attributes)
{
if (self::ACCESS_DENIED === $result = $this->voteForObject($token, $page, $attributes)) {
if (null !== $page->getParent()) {
$result = $this->voteForPage($token, $page->getParent(), $attributes);... | [
"private",
"function",
"voteForPage",
"(",
"TokenInterface",
"$",
"token",
",",
"Page",
"$",
"page",
",",
"array",
"$",
"attributes",
")",
"{",
"if",
"(",
"self",
"::",
"ACCESS_DENIED",
"===",
"$",
"result",
"=",
"$",
"this",
"->",
"voteForObject",
"(",
... | Returns the vote for page object, recursively till root.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@param \BackBee\NestedNode\Page $page
@param array $attributes
@retur... | [
"Returns",
"the",
"vote",
"for",
"page",
"object",
"recursively",
"till",
"root",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authorization/Voter/BBAclVoter.php#L134-L143 |
191,788 | backbee/backbee-php | Security/Authorization/Voter/BBAclVoter.php | BBAclVoter.voteForNestedNode | private function voteForNestedNode(TokenInterface $token, AbstractNestedNode $node, array $attributes)
{
if (self::ACCESS_DENIED === $result = $this->voteForObject($token, $node, $attributes)) {
if (null !== $node->getParent()) {
$result = $this->voteForNestedNode($token, $node->... | php | private function voteForNestedNode(TokenInterface $token, AbstractNestedNode $node, array $attributes)
{
if (self::ACCESS_DENIED === $result = $this->voteForObject($token, $node, $attributes)) {
if (null !== $node->getParent()) {
$result = $this->voteForNestedNode($token, $node->... | [
"private",
"function",
"voteForNestedNode",
"(",
"TokenInterface",
"$",
"token",
",",
"AbstractNestedNode",
"$",
"node",
",",
"array",
"$",
"attributes",
")",
"{",
"if",
"(",
"self",
"::",
"ACCESS_DENIED",
"===",
"$",
"result",
"=",
"$",
"this",
"->",
"voteF... | Returns the vote for nested node object, recursively till root.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@param \BackBee\NestedNode\AbstractNestedNode $node
@param array $attributes
@return integer ... | [
"Returns",
"the",
"vote",
"for",
"nested",
"node",
"object",
"recursively",
"till",
"root",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authorization/Voter/BBAclVoter.php#L153-L162 |
191,789 | backbee/backbee-php | Security/Authorization/Voter/BBAclVoter.php | BBAclVoter.voteForClassContent | private function voteForClassContent(TokenInterface $token, AbstractClassContent $content, array $attributes)
{
if (null === $content->getProperty('category')) {
return self::ACCESS_GRANTED;
}
if (self::ACCESS_DENIED === $result = $this->voteForObject($token, $content, $attribut... | php | private function voteForClassContent(TokenInterface $token, AbstractClassContent $content, array $attributes)
{
if (null === $content->getProperty('category')) {
return self::ACCESS_GRANTED;
}
if (self::ACCESS_DENIED === $result = $this->voteForObject($token, $content, $attribut... | [
"private",
"function",
"voteForClassContent",
"(",
"TokenInterface",
"$",
"token",
",",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"attributes",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"content",
"->",
"getProperty",
"(",
"'category'",
")",
")... | Returns the vote for class content object, recursively till AbstractClassContent.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@param \BackBee\ClassContent\AbstractClassContent $content
@param array $attributes
@retu... | [
"Returns",
"the",
"vote",
"for",
"class",
"content",
"object",
"recursively",
"till",
"AbstractClassContent",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authorization/Voter/BBAclVoter.php#L172-L191 |
191,790 | backbee/backbee-php | Controller/Controller.php | Controller.setContainer | public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
$this->application = null !== $container ? $this->container->get('bbapp') : null;
} | php | public function setContainer(ContainerInterface $container = null)
{
$this->container = $container;
$this->application = null !== $container ? $this->container->get('bbapp') : null;
} | [
"public",
"function",
"setContainer",
"(",
"ContainerInterface",
"$",
"container",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"$",
"container",
";",
"$",
"this",
"->",
"application",
"=",
"null",
"!==",
"$",
"container",
"?",
"$",
"this",
... | Application's dependency injection container setters.
@param ContainerInterface|null $container | [
"Application",
"s",
"dependency",
"injection",
"container",
"setters",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Controller/Controller.php#L93-L97 |
191,791 | backbee/backbee-php | Installer/Database.php | Database.createBackBeeSchema | public function createBackBeeSchema()
{
$classes = $this->getBackBeeSchema();
try {
$this->_schemaTool->dropSchema($classes);
$this->_schemaTool->createSchema($classes);
} catch (\Exception $e) {
echo $e->getMessage()."\n";
}
} | php | public function createBackBeeSchema()
{
$classes = $this->getBackBeeSchema();
try {
$this->_schemaTool->dropSchema($classes);
$this->_schemaTool->createSchema($classes);
} catch (\Exception $e) {
echo $e->getMessage()."\n";
}
} | [
"public",
"function",
"createBackBeeSchema",
"(",
")",
"{",
"$",
"classes",
"=",
"$",
"this",
"->",
"getBackBeeSchema",
"(",
")",
";",
"try",
"{",
"$",
"this",
"->",
"_schemaTool",
"->",
"dropSchema",
"(",
"$",
"classes",
")",
";",
"$",
"this",
"->",
"... | Create the BackBee schema. | [
"Create",
"the",
"BackBee",
"schema",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Installer/Database.php#L87-L96 |
191,792 | backbee/backbee-php | Installer/Database.php | Database.createBundlesSchema | public function createBundlesSchema()
{
foreach ($this->_application->getBundles() as $bundle) {
$this->createBundleSchema($bundle->getId());
}
} | php | public function createBundlesSchema()
{
foreach ($this->_application->getBundles() as $bundle) {
$this->createBundleSchema($bundle->getId());
}
} | [
"public",
"function",
"createBundlesSchema",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_application",
"->",
"getBundles",
"(",
")",
"as",
"$",
"bundle",
")",
"{",
"$",
"this",
"->",
"createBundleSchema",
"(",
"$",
"bundle",
"->",
"getId",
"(",
"... | create all bundles schema. | [
"create",
"all",
"bundles",
"schema",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Installer/Database.php#L101-L106 |
191,793 | backbee/backbee-php | Installer/Database.php | Database.createBundleSchema | public function createBundleSchema($bundleName)
{
if (null === $bundle = $this->_application->getBundle($bundleName)) {
return;
}
try {
$schemaTool = new SchemaTool($bundle->getEntityManager());
$classes = $this->getBundleSchema($bundle);
$sch... | php | public function createBundleSchema($bundleName)
{
if (null === $bundle = $this->_application->getBundle($bundleName)) {
return;
}
try {
$schemaTool = new SchemaTool($bundle->getEntityManager());
$classes = $this->getBundleSchema($bundle);
$sch... | [
"public",
"function",
"createBundleSchema",
"(",
"$",
"bundleName",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"bundle",
"=",
"$",
"this",
"->",
"_application",
"->",
"getBundle",
"(",
"$",
"bundleName",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$"... | Create the bundle schema specified in param.
@param string $bundleName | [
"Create",
"the",
"bundle",
"schema",
"specified",
"in",
"param",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Installer/Database.php#L113-L128 |
191,794 | backbee/backbee-php | Installer/Database.php | Database.updateBundlesSchema | public function updateBundlesSchema()
{
foreach ($this->_application->getBundles() as $bundle) {
$this->updateBundleSchema($bundle->getId());
}
} | php | public function updateBundlesSchema()
{
foreach ($this->_application->getBundles() as $bundle) {
$this->updateBundleSchema($bundle->getId());
}
} | [
"public",
"function",
"updateBundlesSchema",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_application",
"->",
"getBundles",
"(",
")",
"as",
"$",
"bundle",
")",
"{",
"$",
"this",
"->",
"updateBundleSchema",
"(",
"$",
"bundle",
"->",
"getId",
"(",
"... | update all bundles schema. | [
"update",
"all",
"bundles",
"schema",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Installer/Database.php#L141-L146 |
191,795 | backbee/backbee-php | Installer/Database.php | Database.updateBundleSchema | public function updateBundleSchema($bundleName)
{
if (null === $bundle = $this->_application->getBundle($bundleName)) {
return;
}
try {
$schemaTool = new SchemaTool($bundle->getEntityManager());
$classes = $this->getBundleSchema($bundle);
$sch... | php | public function updateBundleSchema($bundleName)
{
if (null === $bundle = $this->_application->getBundle($bundleName)) {
return;
}
try {
$schemaTool = new SchemaTool($bundle->getEntityManager());
$classes = $this->getBundleSchema($bundle);
$sch... | [
"public",
"function",
"updateBundleSchema",
"(",
"$",
"bundleName",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"bundle",
"=",
"$",
"this",
"->",
"_application",
"->",
"getBundle",
"(",
"$",
"bundleName",
")",
")",
"{",
"return",
";",
"}",
"try",
"{",
"$"... | update the bundle schema specified in param.
@param string $bundleName | [
"update",
"the",
"bundle",
"schema",
"specified",
"in",
"param",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Installer/Database.php#L153-L165 |
191,796 | backbee/backbee-php | Util/Transport/AbstractTransport.php | AbstractTransport._getAbsoluteRemotePath | protected function _getAbsoluteRemotePath($path = null)
{
if (null === $path) {
return $this->_startingpath;
}
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
if (null === $parse_url = @parse_url($path)) {
$parse_url = array('path' => $path);
}
... | php | protected function _getAbsoluteRemotePath($path = null)
{
if (null === $path) {
return $this->_startingpath;
}
$path = str_replace(DIRECTORY_SEPARATOR, '/', $path);
if (null === $parse_url = @parse_url($path)) {
$parse_url = array('path' => $path);
}
... | [
"protected",
"function",
"_getAbsoluteRemotePath",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"path",
")",
"{",
"return",
"$",
"this",
"->",
"_startingpath",
";",
"}",
"$",
"path",
"=",
"str_replace",
"(",
"DIRECTORY_SEPARATOR"... | Returns the absolute remote path of a file.
@param string $path
@return string | [
"Returns",
"the",
"absolute",
"remote",
"path",
"of",
"a",
"file",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Transport/AbstractTransport.php#L140-L152 |
191,797 | contao-bootstrap/navbar | src/Helper/NavigationHelper.php | NavigationHelper.getItemHelper | public function getItemHelper(array $item): ItemHelper
{
if ($this->level !== 1 && $item['type'] === 'folder') {
return new HeaderItemHelper($item);
} elseif ($this->level === 2 || ($this->level > 1 && $this->getPageType() === 'folder')) {
return new DropdownItemHelper($item)... | php | public function getItemHelper(array $item): ItemHelper
{
if ($this->level !== 1 && $item['type'] === 'folder') {
return new HeaderItemHelper($item);
} elseif ($this->level === 2 || ($this->level > 1 && $this->getPageType() === 'folder')) {
return new DropdownItemHelper($item)... | [
"public",
"function",
"getItemHelper",
"(",
"array",
"$",
"item",
")",
":",
"ItemHelper",
"{",
"if",
"(",
"$",
"this",
"->",
"level",
"!==",
"1",
"&&",
"$",
"item",
"[",
"'type'",
"]",
"===",
"'folder'",
")",
"{",
"return",
"new",
"HeaderItemHelper",
"... | Get an item helper for an item.
@param array $item Item data.
@return ItemHelper
@throws InvalidArgumentException If invalid data is given. | [
"Get",
"an",
"item",
"helper",
"for",
"an",
"item",
"."
] | 6d6956510a3053dd438a11384f4d237644d4321e | https://github.com/contao-bootstrap/navbar/blob/6d6956510a3053dd438a11384f4d237644d4321e/src/Helper/NavigationHelper.php#L114-L123 |
191,798 | backbee/backbee-php | AutoLoader/AutoLoader.php | AutoLoader.autoloadThrowWrappers | private function autoloadThrowWrappers($namespace, $classname)
{
if (false === is_array($this->_streamWrappers)) {
return false;
}
foreach ($this->_streamWrappers as $n => $wrappers) {
if (0 === strpos($namespace, $n)) {
$classpath = str_replace(array... | php | private function autoloadThrowWrappers($namespace, $classname)
{
if (false === is_array($this->_streamWrappers)) {
return false;
}
foreach ($this->_streamWrappers as $n => $wrappers) {
if (0 === strpos($namespace, $n)) {
$classpath = str_replace(array... | [
"private",
"function",
"autoloadThrowWrappers",
"(",
"$",
"namespace",
",",
"$",
"classname",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"this",
"->",
"_streamWrappers",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"th... | Looks for class definition throw declared wrappers according to the namespace.
@param string $namespace the namespace's class
@param string $classname the class name looked for
@return Boolean TRUE if the class is found FALSE else
@throws \BackBee\Stream\ClassWrapper\Exception\ClassWrapperException Occurs when the w... | [
"Looks",
"for",
"class",
"definition",
"throw",
"declared",
"wrappers",
"according",
"to",
"the",
"namespace",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/AutoLoader/AutoLoader.php#L186-L220 |
191,799 | backbee/backbee-php | AutoLoader/AutoLoader.php | AutoLoader.autoloadThrowFilesystem | private function autoloadThrowFilesystem($namespace, $classname)
{
if (false === is_array($this->_namespaces)) {
return false;
}
$pathfiles = array();
if (false === is_array($this->_includeExtensions)
|| 0 == count($this->_includeExtensions)) {
... | php | private function autoloadThrowFilesystem($namespace, $classname)
{
if (false === is_array($this->_namespaces)) {
return false;
}
$pathfiles = array();
if (false === is_array($this->_includeExtensions)
|| 0 == count($this->_includeExtensions)) {
... | [
"private",
"function",
"autoloadThrowFilesystem",
"(",
"$",
"namespace",
",",
"$",
"classname",
")",
"{",
"if",
"(",
"false",
"===",
"is_array",
"(",
"$",
"this",
"->",
"_namespaces",
")",
")",
"{",
"return",
"false",
";",
"}",
"$",
"pathfiles",
"=",
"ar... | Looks for class definition using the PHP 5.3 standards to the namespace.
@param string $namespace the namespace's class
@param string $classname the class name looked for
@return Boolean TRUE if the class is found FALSE else
@throws \BackBee\AutoLoader\Exception\SyntaxErrorException Occurs when the found PHP code is... | [
"Looks",
"for",
"class",
"definition",
"using",
"the",
"PHP",
"5",
".",
"3",
"standards",
"to",
"the",
"namespace",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/AutoLoader/AutoLoader.php#L232-L275 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.