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,900 | backbee/backbee-php | Renderer/Helper/metadata.php | metadata.generateMeta | private function generateMeta(bbMetaData $meta)
{
if (0 === $meta->count() || 'title' === $meta->getName()) {
return '';
}
$result = '<meta ';
foreach ($meta as $attribute => $value) {
if (false !== strpos($meta->getName(), 'keyword') && 'content' === $attrib... | php | private function generateMeta(bbMetaData $meta)
{
if (0 === $meta->count() || 'title' === $meta->getName()) {
return '';
}
$result = '<meta ';
foreach ($meta as $attribute => $value) {
if (false !== strpos($meta->getName(), 'keyword') && 'content' === $attrib... | [
"private",
"function",
"generateMeta",
"(",
"bbMetaData",
"$",
"meta",
")",
"{",
"if",
"(",
"0",
"===",
"$",
"meta",
"->",
"count",
"(",
")",
"||",
"'title'",
"===",
"$",
"meta",
"->",
"getName",
"(",
")",
")",
"{",
"return",
"''",
";",
"}",
"$",
... | Generates HTML tag according to the metadata.
@param bbMetaData $meta
@return string | [
"Generates",
"HTML",
"tag",
"according",
"to",
"the",
"metadata",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Helper/metadata.php#L113-L137 |
191,901 | backbee/backbee-php | ClassContent/Iconizer/ThumbnailIconizer.php | ThumbnailIconizer.resolveResourceThumbnail | private function resolveResourceThumbnail($defaultImage)
{
$baseFolder = $this->getBaseFolder();
$iconUrl = $baseFolder.DIRECTORY_SEPARATOR.'default_thumbnail.png';
foreach ($this->getThumbnailBaseFolderPaths() as $path) {
$imageFilePath = $path.DIRECTORY_SEPARATOR.$defaultImage;... | php | private function resolveResourceThumbnail($defaultImage)
{
$baseFolder = $this->getBaseFolder();
$iconUrl = $baseFolder.DIRECTORY_SEPARATOR.'default_thumbnail.png';
foreach ($this->getThumbnailBaseFolderPaths() as $path) {
$imageFilePath = $path.DIRECTORY_SEPARATOR.$defaultImage;... | [
"private",
"function",
"resolveResourceThumbnail",
"(",
"$",
"defaultImage",
")",
"{",
"$",
"baseFolder",
"=",
"$",
"this",
"->",
"getBaseFolder",
"(",
")",
";",
"$",
"iconUrl",
"=",
"$",
"baseFolder",
".",
"DIRECTORY_SEPARATOR",
".",
"'default_thumbnail.png'",
... | Resolves the thumbnail resource URL depending on the default image provided.
@param string $defaultImage The default image of a content.
@return string The resolved URL if found. | [
"Resolves",
"the",
"thumbnail",
"resource",
"URL",
"depending",
"on",
"the",
"default",
"image",
"provided",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Iconizer/ThumbnailIconizer.php#L103-L117 |
191,902 | backbee/backbee-php | ClassContent/Iconizer/ThumbnailIconizer.php | ThumbnailIconizer.getBaseFolder | private function getBaseFolder()
{
$container = $this->application->getContainer();
if (
null === $this->baseFolder
&& $container->hasParameter('classcontent_thumbnail.base_folder')
) {
$this->baseFolder = $container->getParameter('classcontent_th... | php | private function getBaseFolder()
{
$container = $this->application->getContainer();
if (
null === $this->baseFolder
&& $container->hasParameter('classcontent_thumbnail.base_folder')
) {
$this->baseFolder = $container->getParameter('classcontent_th... | [
"private",
"function",
"getBaseFolder",
"(",
")",
"{",
"$",
"container",
"=",
"$",
"this",
"->",
"application",
"->",
"getContainer",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"baseFolder",
"&&",
"$",
"container",
"->",
"hasParameter",
... | Returns the container base folder for thumnails or null
@return string|null | [
"Returns",
"the",
"container",
"base",
"folder",
"for",
"thumnails",
"or",
"null"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Iconizer/ThumbnailIconizer.php#L124-L135 |
191,903 | backbee/backbee-php | ClassContent/Iconizer/ThumbnailIconizer.php | ThumbnailIconizer.getThumbnailBaseFolderPaths | private function getThumbnailBaseFolderPaths()
{
if (is_array($this->thumbnailBaseDir)) {
return $this->thumbnailBaseDir;
}
$this->thumbnailBaseDir = [];
if (null !== $baseFolder = $this->getBaseFolder()) {
$thumbnailBaseDir = array_map(function ($directory)... | php | private function getThumbnailBaseFolderPaths()
{
if (is_array($this->thumbnailBaseDir)) {
return $this->thumbnailBaseDir;
}
$this->thumbnailBaseDir = [];
if (null !== $baseFolder = $this->getBaseFolder()) {
$thumbnailBaseDir = array_map(function ($directory)... | [
"private",
"function",
"getThumbnailBaseFolderPaths",
"(",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"thumbnailBaseDir",
")",
")",
"{",
"return",
"$",
"this",
"->",
"thumbnailBaseDir",
";",
"}",
"$",
"this",
"->",
"thumbnailBaseDir",
"=",
"[",... | Getter of class content thumbnails folder paths
@return array The class content thumbnails flder path if found, null otherwise. | [
"Getter",
"of",
"class",
"content",
"thumbnails",
"folder",
"paths"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Iconizer/ThumbnailIconizer.php#L142-L167 |
191,904 | backbee/backbee-php | ClassContent/Listener/RevisionListener.php | RevisionListener.onFlushElementFile | public static function onFlushElementFile(Event $event)
{
$revision = $event->getTarget();
$content = $revision->getContent();
if (!($content instanceof ElementFile) || !is_file($content->path)) {
return;
}
$application = $event->getApplication();
$em = ... | php | public static function onFlushElementFile(Event $event)
{
$revision = $event->getTarget();
$content = $revision->getContent();
if (!($content instanceof ElementFile) || !is_file($content->path)) {
return;
}
$application = $event->getApplication();
$em = ... | [
"public",
"static",
"function",
"onFlushElementFile",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"revision",
"=",
"$",
"event",
"->",
"getTarget",
"(",
")",
";",
"$",
"content",
"=",
"$",
"revision",
"->",
"getContent",
"(",
")",
";",
"if",
"(",
"!",
... | Occurs on revision.onflush events.
@param Event $event | [
"Occurs",
"on",
"revision",
".",
"onflush",
"events",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Listener/RevisionListener.php#L116-L153 |
191,905 | backbee/backbee-php | ClassContent/Listener/RevisionListener.php | RevisionListener.onPrerenderContent | public static function onPrerenderContent(Event $event)
{
$dispatcher = $event->getDispatcher();
if (null === $application = $dispatcher->getApplication()) {
return;
}
if (null === $token = $application->getBBUserToken()) {
return;
}
$renderer... | php | public static function onPrerenderContent(Event $event)
{
$dispatcher = $event->getDispatcher();
if (null === $application = $dispatcher->getApplication()) {
return;
}
if (null === $token = $application->getBBUserToken()) {
return;
}
$renderer... | [
"public",
"static",
"function",
"onPrerenderContent",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"dispatcher",
"=",
"$",
"event",
"->",
"getDispatcher",
"(",
")",
";",
"if",
"(",
"null",
"===",
"$",
"application",
"=",
"$",
"dispatcher",
"->",
"getApplicat... | Occurs on classcontent.prerender events.
@param Event $event | [
"Occurs",
"on",
"classcontent",
".",
"prerender",
"events",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Listener/RevisionListener.php#L200-L247 |
191,906 | backbee/backbee-php | Cache/APC/Cache.php | Cache.save | public function save($id, $data, $lifetime = null, $tag = null)
{
try {
if (\apc_store($id, $data, $lifetime)) {
$this->_hashmap[$tag][$id] = array("time" => time(), "ttl" => $lifetime);
return $this->saveHashmap();
} else {
return fal... | php | public function save($id, $data, $lifetime = null, $tag = null)
{
try {
if (\apc_store($id, $data, $lifetime)) {
$this->_hashmap[$tag][$id] = array("time" => time(), "ttl" => $lifetime);
return $this->saveHashmap();
} else {
return fal... | [
"public",
"function",
"save",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"lifetime",
"=",
"null",
",",
"$",
"tag",
"=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"\\",
"apc_store",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"lifetime",
")",
... | Store provided data into cache.
@param string $id Cache id
@param mixed $data Datas to cache
@param int $lifetime Optional, the specific lifetime for this record (by default null, infinite lifetime)
@param string $tag Optional, an associated tag to the stored data
@return boolean TRUE if cache is s... | [
"Store",
"provided",
"data",
"into",
"cache",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/APC/Cache.php#L168-L185 |
191,907 | backbee/backbee-php | Cache/APC/Cache.php | Cache.removeTag | private function removeTag($tag)
{
try {
if (isset($this->_hashmap[$tag])) {
foreach (array_keys($this->_hashmap[$tag]) as $key) {
if (\apc_delete($key)) {
unset($this->_hashmap[$tag][$key]);
}
}
... | php | private function removeTag($tag)
{
try {
if (isset($this->_hashmap[$tag])) {
foreach (array_keys($this->_hashmap[$tag]) as $key) {
if (\apc_delete($key)) {
unset($this->_hashmap[$tag][$key]);
}
}
... | [
"private",
"function",
"removeTag",
"(",
"$",
"tag",
")",
"{",
"try",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_hashmap",
"[",
"$",
"tag",
"]",
")",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"_hashmap",
"[",
"$",
"t... | Removes all cache records associated to provided tag.
@param string $tag
@return boolean TRUE if cache is removed FALSE otherwise | [
"Removes",
"all",
"cache",
"records",
"associated",
"to",
"provided",
"tag",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/APC/Cache.php#L296-L315 |
191,908 | backbee/backbee-php | Cache/APC/Cache.php | Cache.updateExpireTag | private function updateExpireTag($tag, $lifetime = null)
{
try {
if (isset($this->_hashmap[$tag])) {
foreach (array_keys($this->_hashmap[$tag]) as $key) {
$value = $this->load($key);
if ($value) {
$this->save($key, $... | php | private function updateExpireTag($tag, $lifetime = null)
{
try {
if (isset($this->_hashmap[$tag])) {
foreach (array_keys($this->_hashmap[$tag]) as $key) {
$value = $this->load($key);
if ($value) {
$this->save($key, $... | [
"private",
"function",
"updateExpireTag",
"(",
"$",
"tag",
",",
"$",
"lifetime",
"=",
"null",
")",
"{",
"try",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"_hashmap",
"[",
"$",
"tag",
"]",
")",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",... | Updates the TTL for all cache records associated to provided tag.
@param string $tag
@param int $lifetime
@return boolean TRUE if cache is removed FALSE otherwise | [
"Updates",
"the",
"TTL",
"for",
"all",
"cache",
"records",
"associated",
"to",
"provided",
"tag",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/APC/Cache.php#L325-L345 |
191,909 | backbee/backbee-php | Cache/APC/Cache.php | Cache.removeFromHashmapById | private function removeFromHashmapById($id)
{
try {
foreach ($this->_hashmap as $tag => $vars) {
foreach (array_keys($vars) as $key) {
if ($key == $id) {
unset($this->_hashmap[$tag][$key]);
return $this->saveHas... | php | private function removeFromHashmapById($id)
{
try {
foreach ($this->_hashmap as $tag => $vars) {
foreach (array_keys($vars) as $key) {
if ($key == $id) {
unset($this->_hashmap[$tag][$key]);
return $this->saveHas... | [
"private",
"function",
"removeFromHashmapById",
"(",
"$",
"id",
")",
"{",
"try",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_hashmap",
"as",
"$",
"tag",
"=>",
"$",
"vars",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"vars",
")",
"as",
"$",
"key",... | Remove provided id from hashmap.
@return boolean | [
"Remove",
"provided",
"id",
"from",
"hashmap",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/APC/Cache.php#L352-L371 |
191,910 | backbee/backbee-php | Cache/APC/Cache.php | Cache.saveHashmap | private function saveHashmap()
{
try {
return \apc_store($this->_hashmapId, $this->_hashmap, self::HASHMAP_TTL);
} catch (\Exception $e) {
$this->log('warning', \sprintf('Unable to store hashmap %s : %s', $this->_hashmapId, $e->getMessage()));
return false;
... | php | private function saveHashmap()
{
try {
return \apc_store($this->_hashmapId, $this->_hashmap, self::HASHMAP_TTL);
} catch (\Exception $e) {
$this->log('warning', \sprintf('Unable to store hashmap %s : %s', $this->_hashmapId, $e->getMessage()));
return false;
... | [
"private",
"function",
"saveHashmap",
"(",
")",
"{",
"try",
"{",
"return",
"\\",
"apc_store",
"(",
"$",
"this",
"->",
"_hashmapId",
",",
"$",
"this",
"->",
"_hashmap",
",",
"self",
"::",
"HASHMAP_TTL",
")",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$... | Store hasmap for current hashmap id.
@return boolean | [
"Store",
"hasmap",
"for",
"current",
"hashmap",
"id",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/APC/Cache.php#L378-L387 |
191,911 | backbee/backbee-php | Cache/APC/Cache.php | Cache.loadHashmap | public function loadHashmap()
{
try {
if ($this->_hashmap = \apc_fetch($this->_hashmapId)) {
return $this->_hashmap;
} else {
return array();
}
} catch (\Exception $e) {
$this->log('warning', \sprintf('Unable to load has... | php | public function loadHashmap()
{
try {
if ($this->_hashmap = \apc_fetch($this->_hashmapId)) {
return $this->_hashmap;
} else {
return array();
}
} catch (\Exception $e) {
$this->log('warning', \sprintf('Unable to load has... | [
"public",
"function",
"loadHashmap",
"(",
")",
"{",
"try",
"{",
"if",
"(",
"$",
"this",
"->",
"_hashmap",
"=",
"\\",
"apc_fetch",
"(",
"$",
"this",
"->",
"_hashmapId",
")",
")",
"{",
"return",
"$",
"this",
"->",
"_hashmap",
";",
"}",
"else",
"{",
"... | Retrieve hasmap according current hashmap id.
@return boolean | [
"Retrieve",
"hasmap",
"according",
"current",
"hashmap",
"id",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/APC/Cache.php#L394-L407 |
191,912 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.getMetadataAction | public function getMetadataAction(Page $page)
{
$metadata = null !== $page->getMetaData() ? $page->getMetaData()->jsonSerialize() : array();
if (empty($metadata)) {
$metadata = $this->application->getContainer()->get('nestednode.metadata.resolver')->resolve($page);
}
ret... | php | public function getMetadataAction(Page $page)
{
$metadata = null !== $page->getMetaData() ? $page->getMetaData()->jsonSerialize() : array();
if (empty($metadata)) {
$metadata = $this->application->getContainer()->get('nestednode.metadata.resolver')->resolve($page);
}
ret... | [
"public",
"function",
"getMetadataAction",
"(",
"Page",
"$",
"page",
")",
"{",
"$",
"metadata",
"=",
"null",
"!==",
"$",
"page",
"->",
"getMetaData",
"(",
")",
"?",
"$",
"page",
"->",
"getMetaData",
"(",
")",
"->",
"jsonSerialize",
"(",
")",
":",
"arra... | Get page's metadatas.
@param Page $page the page we want to get its metadatas
@return \Symfony\Component\HttpFoundation\Response
@Rest\ParamConverter(name="page", class="BackBee\NestedNode\Page") | [
"Get",
"page",
"s",
"metadatas",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L82-L90 |
191,913 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.getAncestorsAction | public function getAncestorsAction(Page $page)
{
$ancestors = $this->getPageRepository()->getAncestors($page);
return $this->createResponse($this->formatCollection($ancestors));
} | php | public function getAncestorsAction(Page $page)
{
$ancestors = $this->getPageRepository()->getAncestors($page);
return $this->createResponse($this->formatCollection($ancestors));
} | [
"public",
"function",
"getAncestorsAction",
"(",
"Page",
"$",
"page",
")",
"{",
"$",
"ancestors",
"=",
"$",
"this",
"->",
"getPageRepository",
"(",
")",
"->",
"getAncestors",
"(",
"$",
"page",
")",
";",
"return",
"$",
"this",
"->",
"createResponse",
"(",
... | Get page ancestors
@param Page $page the page we want to get its ancestors
@return \Symfony\Component\HttpFoundation\Response
@Rest\ParamConverter(name="page", class="BackBee\NestedNode\Page") | [
"Get",
"page",
"ancestors"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L98-L103 |
191,914 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.putMetadataAction | public function putMetadataAction(Page $page, Request $request)
{
$metadatas = $this->application
->getContainer()
->get('nestednode.metadata.resolver')
->resolve($page);
foreach ($request->request->all() as $name => $attributes) {
if ($me... | php | public function putMetadataAction(Page $page, Request $request)
{
$metadatas = $this->application
->getContainer()
->get('nestednode.metadata.resolver')
->resolve($page);
foreach ($request->request->all() as $name => $attributes) {
if ($me... | [
"public",
"function",
"putMetadataAction",
"(",
"Page",
"$",
"page",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"metadatas",
"=",
"$",
"this",
"->",
"application",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'nestednode.metadata.resolver'",
")",
"... | Update page's metadatas.
@param Page $page the page we want to update its metadatas
@param Request $request
@return Symfony\Component\HttpFoundation\Response
@Rest\ParamConverter(name="page", class="BackBee\NestedNode\Page") | [
"Update",
"page",
"s",
"metadatas",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L115-L136 |
191,915 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.getCollectionAction | public function getCollectionAction(Request $request, $start, $count, Page $parent = null)
{
$response = null;
$contentUid = $request->query->get('content_uid', null);
$contentType = $request->query->get('content_type', null);
if (null !== $contentUid && null !== $contentType) {
... | php | public function getCollectionAction(Request $request, $start, $count, Page $parent = null)
{
$response = null;
$contentUid = $request->query->get('content_uid', null);
$contentType = $request->query->get('content_type', null);
if (null !== $contentUid && null !== $contentType) {
... | [
"public",
"function",
"getCollectionAction",
"(",
"Request",
"$",
"request",
",",
"$",
"start",
",",
"$",
"count",
",",
"Page",
"$",
"parent",
"=",
"null",
")",
"{",
"$",
"response",
"=",
"null",
";",
"$",
"contentUid",
"=",
"$",
"request",
"->",
"quer... | Get collection of page entity.
Version 1
- without params return current root
- parent_uid return first level before the parent page
Version 2
- without params return all pages
- `parent_uid` return all pages available before the nested level
- `root` return current root
- `level_offset` permit to choose the depth ex... | [
"Get",
"collection",
"of",
"page",
"entity",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L184-L203 |
191,916 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.isFinal | private function isFinal(Page $page = null)
{
$result = false;
if (null !== $page) {
$layout = $page->getLayout();
if (null !== $layout && $layout->isFinal()) {
$result = true;
}
}
return $result;
} | php | private function isFinal(Page $page = null)
{
$result = false;
if (null !== $page) {
$layout = $page->getLayout();
if (null !== $layout && $layout->isFinal()) {
$result = true;
}
}
return $result;
} | [
"private",
"function",
"isFinal",
"(",
"Page",
"$",
"page",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"false",
";",
"if",
"(",
"null",
"!==",
"$",
"page",
")",
"{",
"$",
"layout",
"=",
"$",
"page",
"->",
"getLayout",
"(",
")",
";",
"if",
"(",
... | Check if the page is final
@param Page|null $page [description]
@return boolean [description] | [
"Check",
"if",
"the",
"page",
"is",
"final"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L327-L338 |
191,917 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.putCollectionAction | public function putCollectionAction(Request $request)
{
$result = [];
foreach ($request->request->all() as $data) {
if (!isset($data['uid'])) {
throw new BadRequestHttpException('uid is missing.');
}
try {
$page = $this->getEntityM... | php | public function putCollectionAction(Request $request)
{
$result = [];
foreach ($request->request->all() as $data) {
if (!isset($data['uid'])) {
throw new BadRequestHttpException('uid is missing.');
}
try {
$page = $this->getEntityM... | [
"public",
"function",
"putCollectionAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"request",
"->",
"request",
"->",
"all",
"(",
")",
"as",
"$",
"data",
")",
"{",
"if",
"(",
"!",
"isset",
... | Update page collecton.
@return \Symfony\Component\HttpFoundation\JsonResponse
@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')") | [
"Update",
"page",
"collecton",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L426-L480 |
191,918 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.softDelete | private function softDelete(Page $page)
{
if ($page->isRoot()) {
throw new BadRequestHttpException('Cannot remove root page of a site.');
}
$this->granted('DELETE', $page);
$this->granted('EDIT', $page->getParent()); // user must have edit permission on parent
i... | php | private function softDelete(Page $page)
{
if ($page->isRoot()) {
throw new BadRequestHttpException('Cannot remove root page of a site.');
}
$this->granted('DELETE', $page);
$this->granted('EDIT', $page->getParent()); // user must have edit permission on parent
i... | [
"private",
"function",
"softDelete",
"(",
"Page",
"$",
"page",
")",
"{",
"if",
"(",
"$",
"page",
"->",
"isRoot",
"(",
")",
")",
"{",
"throw",
"new",
"BadRequestHttpException",
"(",
"'Cannot remove root page of a site.'",
")",
";",
"}",
"$",
"this",
"->",
"... | Moves the pages in trash.
@param Page $page The page to be moved in trash.
@throws BadRequestHttpException Occures if $page is a root. | [
"Moves",
"the",
"pages",
"in",
"trash",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L539-L553 |
191,919 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.hardDelete | private function hardDelete(Page $page)
{
if (!$page->isDeleted()) {
throw new BadRequestHttpException('Page is not in trash, cannot remove it.');
}
if (true === $page->isRoot()) {
throw new BadRequestHttpException('Cannot remove root page of a site.');
}
... | php | private function hardDelete(Page $page)
{
if (!$page->isDeleted()) {
throw new BadRequestHttpException('Page is not in trash, cannot remove it.');
}
if (true === $page->isRoot()) {
throw new BadRequestHttpException('Cannot remove root page of a site.');
}
... | [
"private",
"function",
"hardDelete",
"(",
"Page",
"$",
"page",
")",
"{",
"if",
"(",
"!",
"$",
"page",
"->",
"isDeleted",
"(",
")",
")",
"{",
"throw",
"new",
"BadRequestHttpException",
"(",
"'Page is not in trash, cannot remove it.'",
")",
";",
"}",
"if",
"("... | Remove page from the database.
@param Page $page The page to be removeed.
@throws BadRequestHttpException Occures if $page is not in trash or is a root. | [
"Remove",
"page",
"from",
"the",
"database",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L562-L575 |
191,920 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.patchAction | public function patchAction(Page $page, Request $request)
{
$operations = $request->request->all();
try {
(new OperationSyntaxValidator())->validate($operations);
} catch (InvalidOperationSyntaxException $e) {
throw new BadRequestHttpException('operation invalid synt... | php | public function patchAction(Page $page, Request $request)
{
$operations = $request->request->all();
try {
(new OperationSyntaxValidator())->validate($operations);
} catch (InvalidOperationSyntaxException $e) {
throw new BadRequestHttpException('operation invalid synt... | [
"public",
"function",
"patchAction",
"(",
"Page",
"$",
"page",
",",
"Request",
"$",
"request",
")",
"{",
"$",
"operations",
"=",
"$",
"request",
"->",
"request",
"->",
"all",
"(",
")",
";",
"try",
"{",
"(",
"new",
"OperationSyntaxValidator",
"(",
")",
... | Patch page.
@return \Symfony\Component\HttpFoundation\Response
@Rest\RequestParam(name="0", description="Patch operations", requirements={
@Assert\NotBlank(message="Request must contain at least one operation")
})
@Rest\ParamConverter(name="page", class="BackBee\NestedNode\Page")
@Rest\Security(expression="is_grante... | [
"Patch",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L589-L621 |
191,921 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.deleteAction | public function deleteAction(Page $page)
{
if ($page->isDeleted()) {
$this->hardDelete($page);
} else {
$this->softDelete($page);
}
$this->getEntityManager()->flush();
return $this->createJsonResponse(null, 204);
} | php | public function deleteAction(Page $page)
{
if ($page->isDeleted()) {
$this->hardDelete($page);
} else {
$this->softDelete($page);
}
$this->getEntityManager()->flush();
return $this->createJsonResponse(null, 204);
} | [
"public",
"function",
"deleteAction",
"(",
"Page",
"$",
"page",
")",
"{",
"if",
"(",
"$",
"page",
"->",
"isDeleted",
"(",
")",
")",
"{",
"$",
"this",
"->",
"hardDelete",
"(",
"$",
"page",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"softDelete",... | Delete page.
@return \Symfony\Component\HttpFoundation\Response
@Rest\ParamConverter(name="page", class="BackBee\NestedNode\Page") | [
"Delete",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L630-L641 |
191,922 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.deleteCollectionAction | public function deleteCollectionAction(Request $request)
{
if (null === $uids = $request->get('uids', null)) {
throw new BadRequestHttpException('uid is missing.');
}
$result = [];
$statusCode = 204;
$pages = $this->getPageRepository()->findBy(['_uid' => $uids]);... | php | public function deleteCollectionAction(Request $request)
{
if (null === $uids = $request->get('uids', null)) {
throw new BadRequestHttpException('uid is missing.');
}
$result = [];
$statusCode = 204;
$pages = $this->getPageRepository()->findBy(['_uid' => $uids]);... | [
"public",
"function",
"deleteCollectionAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"uids",
"=",
"$",
"request",
"->",
"get",
"(",
"'uids'",
",",
"null",
")",
")",
"{",
"throw",
"new",
"BadRequestHttpException",
"(",
... | Delete page collecton.
@return \Symfony\Component\HttpFoundation\JsonResponse
@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')") | [
"Delete",
"page",
"collecton",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L650-L701 |
191,923 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.cloneAction | public function cloneAction(Page $source, Page $parent = null, $sibling = null, Request $request)
{
// user must have view permission on chosen layout
$this->granted('VIEW', $source->getLayout());
if (null !== $sibling) {
$parent = $sibling->getParent();
} elseif (null =... | php | public function cloneAction(Page $source, Page $parent = null, $sibling = null, Request $request)
{
// user must have view permission on chosen layout
$this->granted('VIEW', $source->getLayout());
if (null !== $sibling) {
$parent = $sibling->getParent();
} elseif (null =... | [
"public",
"function",
"cloneAction",
"(",
"Page",
"$",
"source",
",",
"Page",
"$",
"parent",
"=",
"null",
",",
"$",
"sibling",
"=",
"null",
",",
"Request",
"$",
"request",
")",
"{",
"// user must have view permission on chosen layout",
"$",
"this",
"->",
"gran... | Clone a page.
@return \Symfony\Component\HttpFoundation\Response
@Rest\RequestParam(name="title", description="Cloning page new title", requirements={
@Assert\Length(min=3, minMessage="Title must contains atleast 3 characters"),
@Assert\NotBlank
})
@Rest\ParamConverter(name="source", class="BackBee\NestedNode\Page")... | [
"Clone",
"a",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L723-L767 |
191,924 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.doGetCollectionByContent | private function doGetCollectionByContent($contentType, $contentUid)
{
$content = null;
$classname = AbstractClassContent::getClassnameByContentType($contentType);
$em = $this->getApplication()->getEntityManager();
try {
$content = $em->find($classname, $contentUid);
... | php | private function doGetCollectionByContent($contentType, $contentUid)
{
$content = null;
$classname = AbstractClassContent::getClassnameByContentType($contentType);
$em = $this->getApplication()->getEntityManager();
try {
$content = $em->find($classname, $contentUid);
... | [
"private",
"function",
"doGetCollectionByContent",
"(",
"$",
"contentType",
",",
"$",
"contentUid",
")",
"{",
"$",
"content",
"=",
"null",
";",
"$",
"classname",
"=",
"AbstractClassContent",
"::",
"getClassnameByContentType",
"(",
"$",
"contentType",
")",
";",
"... | Returns every pages that contains provided classcontent.
@param string $contentType
@param string $contentUid
@return \Symfony\Component\HttpFoundation\Response | [
"Returns",
"every",
"pages",
"that",
"contains",
"provided",
"classcontent",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L787-L811 |
191,925 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.getOrderCriteria | private function getOrderCriteria(array $requestedOrder = null, $qb = null)
{
if (!empty($requestedOrder)) {
$orderBy = [];
foreach ($requestedOrder as $key => $value) {
if ('_' !== $key[0]) {
$key = '_' . $key;
}
$... | php | private function getOrderCriteria(array $requestedOrder = null, $qb = null)
{
if (!empty($requestedOrder)) {
$orderBy = [];
foreach ($requestedOrder as $key => $value) {
if ('_' !== $key[0]) {
$key = '_' . $key;
}
$... | [
"private",
"function",
"getOrderCriteria",
"(",
"array",
"$",
"requestedOrder",
"=",
"null",
",",
"$",
"qb",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"requestedOrder",
")",
")",
"{",
"$",
"orderBy",
"=",
"[",
"]",
";",
"foreach",
"("... | Computes order criteria for collection.
@param array|null $requestedOrder
@return array | [
"Computes",
"order",
"criteria",
"for",
"collection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L953-L973 |
191,926 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.trySetPageWorkflowState | private function trySetPageWorkflowState(Page $page, State $workflow = null)
{
$page->setWorkflowState(null);
if (null !== $workflow) {
if (null === $workflow->getLayout() || $workflow->getLayout()->getUid() === $page->getLayout()->getUid()) {
$page->setWorkflowState($wor... | php | private function trySetPageWorkflowState(Page $page, State $workflow = null)
{
$page->setWorkflowState(null);
if (null !== $workflow) {
if (null === $workflow->getLayout() || $workflow->getLayout()->getUid() === $page->getLayout()->getUid()) {
$page->setWorkflowState($wor... | [
"private",
"function",
"trySetPageWorkflowState",
"(",
"Page",
"$",
"page",
",",
"State",
"$",
"workflow",
"=",
"null",
")",
"{",
"$",
"page",
"->",
"setWorkflowState",
"(",
"null",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"workflow",
")",
"{",
"if",
"... | Page workflow state setter.
@param Page $page
@param State $workflow | [
"Page",
"workflow",
"state",
"setter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L998-L1006 |
191,927 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.patchStateOperation | private function patchStateOperation(Page $page, array &$operations)
{
$stateOp = null;
$isHiddenOp = null;
foreach ($operations as $key => $operation) {
$op = [
'key' => $key,
'op' => $operation
];
if ('/state' === $operati... | php | private function patchStateOperation(Page $page, array &$operations)
{
$stateOp = null;
$isHiddenOp = null;
foreach ($operations as $key => $operation) {
$op = [
'key' => $key,
'op' => $operation
];
if ('/state' === $operati... | [
"private",
"function",
"patchStateOperation",
"(",
"Page",
"$",
"page",
",",
"array",
"&",
"$",
"operations",
")",
"{",
"$",
"stateOp",
"=",
"null",
";",
"$",
"isHiddenOp",
"=",
"null",
";",
"foreach",
"(",
"$",
"operations",
"as",
"$",
"key",
"=>",
"$... | Custom patch process for Page's state property.
@param Page $page
@param array $operations passed by reference | [
"Custom",
"patch",
"process",
"for",
"Page",
"s",
"state",
"property",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L1014-L1066 |
191,928 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.patchSiblingAndParentOperation | private function patchSiblingAndParentOperation(Page $page, array &$operations)
{
$sibling_operation = null;
$parent_operation = null;
foreach ($operations as $key => $operation) {
$op = array('key' => $key, 'op' => $operation);
if ('/sibling_uid' === $operation['path... | php | private function patchSiblingAndParentOperation(Page $page, array &$operations)
{
$sibling_operation = null;
$parent_operation = null;
foreach ($operations as $key => $operation) {
$op = array('key' => $key, 'op' => $operation);
if ('/sibling_uid' === $operation['path... | [
"private",
"function",
"patchSiblingAndParentOperation",
"(",
"Page",
"$",
"page",
",",
"array",
"&",
"$",
"operations",
")",
"{",
"$",
"sibling_operation",
"=",
"null",
";",
"$",
"parent_operation",
"=",
"null",
";",
"foreach",
"(",
"$",
"operations",
"as",
... | Custom patch process for Page's sibling or parent node.
@param Page $page
@param array $operations passed by reference | [
"Custom",
"patch",
"process",
"for",
"Page",
"s",
"sibling",
"or",
"parent",
"node",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L1074-L1118 |
191,929 | backbee/backbee-php | Rest/Controller/PageController.php | PageController.getPageByUid | private function getPageByUid($uid)
{
if (null === $page = $this->getApplication()->getEntityManager()->find('BackBee\NestedNode\Page', $uid)) {
throw new NotFoundHttpException("Unable to find page with uid `$uid`");
}
return $page;
} | php | private function getPageByUid($uid)
{
if (null === $page = $this->getApplication()->getEntityManager()->find('BackBee\NestedNode\Page', $uid)) {
throw new NotFoundHttpException("Unable to find page with uid `$uid`");
}
return $page;
} | [
"private",
"function",
"getPageByUid",
"(",
"$",
"uid",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"page",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"getEntityManager",
"(",
")",
"->",
"find",
"(",
"'BackBee\\NestedNode\\Page'",
",",
"$",
"... | Retrieves page entity with provided uid.
@param string $uid
@return Page
@throws NotFoundHttpException raised if page not found with provided uid | [
"Retrieves",
"page",
"entity",
"with",
"provided",
"uid",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/PageController.php#L1152-L1159 |
191,930 | backbee/backbee-php | Site/Layout.php | Layout.getDomDocument | public function getDomDocument()
{
if (null === $this->_domdocument) {
if (true === $this->isValid()) {
$mainLayoutRow = new \DOMDocument('1.0', 'UTF-8');
$mainNode = $mainLayoutRow->createElement('div');
$mainNode->setAttribute('class', 'row');
... | php | public function getDomDocument()
{
if (null === $this->_domdocument) {
if (true === $this->isValid()) {
$mainLayoutRow = new \DOMDocument('1.0', 'UTF-8');
$mainNode = $mainLayoutRow->createElement('div');
$mainNode->setAttribute('class', 'row');
... | [
"public",
"function",
"getDomDocument",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_domdocument",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"isValid",
"(",
")",
")",
"{",
"$",
"mainLayoutRow",
"=",
"new",
"\\",
"DOMDocu... | Generates and returns a DOM document according to the unserialized data object.
@return \DOMDocument|NULL Returns a DOM document or NULL is the layout datas
are invalid. | [
"Generates",
"and",
"returns",
"a",
"DOM",
"document",
"according",
"to",
"the",
"unserialized",
"data",
"object",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Layout.php#L426-L475 |
191,931 | backbee/backbee-php | Site/Layout.php | Layout.isValid | public function isValid()
{
if (null === $this->_isValid) {
$this->_isValid = false;
if (null !== $data_object = $this->getDataObject()) {
if (true === property_exists($data_object, 'templateLayouts')
&& true === is_array($data_object->templat... | php | public function isValid()
{
if (null === $this->_isValid) {
$this->_isValid = false;
if (null !== $data_object = $this->getDataObject()) {
if (true === property_exists($data_object, 'templateLayouts')
&& true === is_array($data_object->templat... | [
"public",
"function",
"isValid",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_isValid",
")",
"{",
"$",
"this",
"->",
"_isValid",
"=",
"false",
";",
"if",
"(",
"null",
"!==",
"$",
"data_object",
"=",
"$",
"this",
"->",
"getDataObject"... | Checks for a valid structure of the unserialized data object.
@return Boolean Returns TRUE if the data object is valid, FALSE otherwise | [
"Checks",
"for",
"a",
"valid",
"structure",
"of",
"the",
"unserialized",
"data",
"object",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Layout.php#L482-L508 |
191,932 | backbee/backbee-php | Site/Layout.php | Layout.setData | public function setData($data)
{
if (true === is_object($data)) {
return $this->setDataObject($data);
}
$this->_picpath = null;
$this->_isValid = null;
$this->_domdocument = null;
$this->_zones = null;
$this->_data = $data;
return $this;... | php | public function setData($data)
{
if (true === is_object($data)) {
return $this->setDataObject($data);
}
$this->_picpath = null;
$this->_isValid = null;
$this->_domdocument = null;
$this->_zones = null;
$this->_data = $data;
return $this;... | [
"public",
"function",
"setData",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"true",
"===",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"return",
"$",
"this",
"->",
"setDataObject",
"(",
"$",
"data",
")",
";",
"}",
"$",
"this",
"->",
"_picpath",
"=",
... | Sets the data associated to the layout.
No validation checks are performed at this step.
@param mixed $data
@return \BackBee\Site\Layout | [
"Sets",
"the",
"data",
"associated",
"to",
"the",
"layout",
".",
"No",
"validation",
"checks",
"are",
"performed",
"at",
"this",
"step",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Layout.php#L550-L564 |
191,933 | backbee/backbee-php | Site/Layout.php | Layout.setDataObject | public function setDataObject($data)
{
if (true === is_object($data)) {
$data = json_encode($data);
}
return $this->setData($data);
} | php | public function setDataObject($data)
{
if (true === is_object($data)) {
$data = json_encode($data);
}
return $this->setData($data);
} | [
"public",
"function",
"setDataObject",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"true",
"===",
"is_object",
"(",
"$",
"data",
")",
")",
"{",
"$",
"data",
"=",
"json_encode",
"(",
"$",
"data",
")",
";",
"}",
"return",
"$",
"this",
"->",
"setData",
"("... | Sets the data associated to the layout.
None validity checks are performed at this step.
@param mixed $data
@return \BackBee\Site\Layout | [
"Sets",
"the",
"data",
"associated",
"to",
"the",
"layout",
".",
"None",
"validity",
"checks",
"are",
"performed",
"at",
"this",
"step",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Layout.php#L574-L581 |
191,934 | backbee/backbee-php | Site/Layout.php | Layout.setParam | public function setParam($var = null, $values = null)
{
if (null === $var) {
$this->_parameters = $values;
} else {
$this->_parameters[$var] = $values;
}
return $this;
} | php | public function setParam($var = null, $values = null)
{
if (null === $var) {
$this->_parameters = $values;
} else {
$this->_parameters[$var] = $values;
}
return $this;
} | [
"public",
"function",
"setParam",
"(",
"$",
"var",
"=",
"null",
",",
"$",
"values",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"var",
")",
"{",
"$",
"this",
"->",
"_parameters",
"=",
"$",
"values",
";",
"}",
"else",
"{",
"$",
"this",
... | Sets one or all parameters.
@param string $var the parameter name to set, if NULL all the parameters array wil be set
@param mixed $values the parameter value or all the parameters if $var is NULL
@return \BackBee\Site\Layout | [
"Sets",
"one",
"or",
"all",
"parameters",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Layout.php#L623-L632 |
191,935 | backbee/backbee-php | Site/Layout.php | Layout.getZoneOptions | private function getZoneOptions(\stdClass $zone)
{
$options = array(
'parameters' => array(
'class' => array(
'type' => 'scalar',
'options' => array('default' => 'row'),
),
),
);
if (true === pro... | php | private function getZoneOptions(\stdClass $zone)
{
$options = array(
'parameters' => array(
'class' => array(
'type' => 'scalar',
'options' => array('default' => 'row'),
),
),
);
if (true === pro... | [
"private",
"function",
"getZoneOptions",
"(",
"\\",
"stdClass",
"$",
"zone",
")",
"{",
"$",
"options",
"=",
"array",
"(",
"'parameters'",
"=>",
"array",
"(",
"'class'",
"=>",
"array",
"(",
"'type'",
"=>",
"'scalar'",
",",
"'options'",
"=>",
"array",
"(",
... | Returns a contentset options according to the layout zone.
@param \StdClass $zone
@return array | [
"Returns",
"a",
"contentset",
"options",
"according",
"to",
"the",
"layout",
"zone",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Layout.php#L641-L670 |
191,936 | backbee/backbee-php | Rest/Patcher/RightManager.php | RightManager.addAuthorizationMapping | public function addAuthorizationMapping($entity, $mapping)
{
$classname = get_class($entity);
if (!isset($this->rights[$classname])) {
$this->buildRights($classname);
}
$this->rights[$classname] = array_merge($this->rights[$classname], $mapping);
return $this;
... | php | public function addAuthorizationMapping($entity, $mapping)
{
$classname = get_class($entity);
if (!isset($this->rights[$classname])) {
$this->buildRights($classname);
}
$this->rights[$classname] = array_merge($this->rights[$classname], $mapping);
return $this;
... | [
"public",
"function",
"addAuthorizationMapping",
"(",
"$",
"entity",
",",
"$",
"mapping",
")",
"{",
"$",
"classname",
"=",
"get_class",
"(",
"$",
"entity",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"rights",
"[",
"$",
"classname",
"]",... | Add authorization mapping for entity.
@param object $entity
@param array $mapping
@return self | [
"Add",
"authorization",
"mapping",
"for",
"entity",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Patcher/RightManager.php#L101-L111 |
191,937 | backbee/backbee-php | Rest/Patcher/RightManager.php | RightManager.buildProperMethodName | private function buildProperMethodName($prefix, $propertyName)
{
$methodName = explode('_', $propertyName);
$methodName = array_map(function ($str) {
return ucfirst($str);
}, $methodName);
return $prefix.implode('', $methodName);
} | php | private function buildProperMethodName($prefix, $propertyName)
{
$methodName = explode('_', $propertyName);
$methodName = array_map(function ($str) {
return ucfirst($str);
}, $methodName);
return $prefix.implode('', $methodName);
} | [
"private",
"function",
"buildProperMethodName",
"(",
"$",
"prefix",
",",
"$",
"propertyName",
")",
"{",
"$",
"methodName",
"=",
"explode",
"(",
"'_'",
",",
"$",
"propertyName",
")",
";",
"$",
"methodName",
"=",
"array_map",
"(",
"function",
"(",
"$",
"str"... | Builds a valid method name for property name; Replaces every '_' by ''
and apply ucfirst to every words seperated by an underscore.
@param string $prefix the prefix to prepend to the method name (example: 'get', 'set', 'is')
@param string $propertyName
@return string a valid method name | [
"Builds",
"a",
"valid",
"method",
"name",
"for",
"property",
"name",
";",
"Replaces",
"every",
"_",
"by",
"and",
"apply",
"ucfirst",
"to",
"every",
"words",
"seperated",
"by",
"an",
"underscore",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Patcher/RightManager.php#L160-L168 |
191,938 | backbee/backbee-php | NestedNode/Section.php | Section.setPage | public function setPage(Page $page)
{
$this->_page = $page;
$page->setMainSection($this);
return $this;
} | php | public function setPage(Page $page)
{
$this->_page = $page;
$page->setMainSection($this);
return $this;
} | [
"public",
"function",
"setPage",
"(",
"Page",
"$",
"page",
")",
"{",
"$",
"this",
"->",
"_page",
"=",
"$",
"page",
";",
"$",
"page",
"->",
"setMainSection",
"(",
"$",
"this",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the associated page for this section.
@param Page $page
@return Section | [
"Sets",
"the",
"associated",
"page",
"for",
"this",
"section",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Section.php#L195-L201 |
191,939 | backbee/backbee-php | DependencyInjection/ContainerBuilder.php | ContainerBuilder.getContainer | public function getContainer()
{
if (null !== $this->container) {
throw new ContainerAlreadyExistsException($this->container);
}
// Construct container
$this->container = new Container();
$this->hydrateContainerWithBootstrapParameters();
if (false === $t... | php | public function getContainer()
{
if (null !== $this->container) {
throw new ContainerAlreadyExistsException($this->container);
}
// Construct container
$this->container = new Container();
$this->hydrateContainerWithBootstrapParameters();
if (false === $t... | [
"public",
"function",
"getContainer",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"container",
")",
"{",
"throw",
"new",
"ContainerAlreadyExistsException",
"(",
"$",
"this",
"->",
"container",
")",
";",
"}",
"// Construct container",
"$",
"th... | Every time you invoke this method it will return a new BackBee\DependencyInjection\Container.
@return BackBee\DependencyInjection\Container
@throws ContainerAlreadyExistsException will be raise if you try to call more than one time
getContainer | [
"Every",
"time",
"you",
"invoke",
"this",
"method",
"it",
"will",
"return",
"a",
"new",
"BackBee",
"\\",
"DependencyInjection",
"\\",
"Container",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerBuilder.php#L129-L145 |
191,940 | backbee/backbee-php | DependencyInjection/ContainerBuilder.php | ContainerBuilder.hydrateContainerWithBootstrapParameters | private function hydrateContainerWithBootstrapParameters()
{
$parameters = (new BootstrapResolver($this->repository_directory, $this->context, $this->environment))
->getBootstrapParameters()
;
$missing_parameters = array();
$this->tryAddParameter('debug', $parameters, $m... | php | private function hydrateContainerWithBootstrapParameters()
{
$parameters = (new BootstrapResolver($this->repository_directory, $this->context, $this->environment))
->getBootstrapParameters()
;
$missing_parameters = array();
$this->tryAddParameter('debug', $parameters, $m... | [
"private",
"function",
"hydrateContainerWithBootstrapParameters",
"(",
")",
"{",
"$",
"parameters",
"=",
"(",
"new",
"BootstrapResolver",
"(",
"$",
"this",
"->",
"repository_directory",
",",
"$",
"this",
"->",
"context",
",",
"$",
"this",
"->",
"environment",
")... | Hydrate container with bootstrap.yml parameter.
@throws MissingBootstrapParametersException raises if we are not able to find bootstrap.yml file | [
"Hydrate",
"container",
"with",
"bootstrap",
".",
"yml",
"parameter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerBuilder.php#L175-L195 |
191,941 | backbee/backbee-php | DependencyInjection/ContainerBuilder.php | ContainerBuilder.tryParseContainerDump | private function tryParseContainerDump()
{
$success = false;
$container_directory = $this->container->getParameter('container.dump_directory');
$container_filename = $this->getContainerDumpFilename($this->container->getParameter('bootstrap_filepath'));
$container_filepath = $contain... | php | private function tryParseContainerDump()
{
$success = false;
$container_directory = $this->container->getParameter('container.dump_directory');
$container_filename = $this->getContainerDumpFilename($this->container->getParameter('bootstrap_filepath'));
$container_filepath = $contain... | [
"private",
"function",
"tryParseContainerDump",
"(",
")",
"{",
"$",
"success",
"=",
"false",
";",
"$",
"container_directory",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"'container.dump_directory'",
")",
";",
"$",
"container_filename",
"=",
... | This method try to restore container from a dump if it is possible, otherwise it will set
container.class, container.file and container.dir parameters into container. | [
"This",
"method",
"try",
"to",
"restore",
"container",
"from",
"a",
"dump",
"if",
"it",
"is",
"possible",
"otherwise",
"it",
"will",
"set",
"container",
".",
"class",
"container",
".",
"file",
"and",
"container",
".",
"dir",
"parameters",
"into",
"container"... | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerBuilder.php#L262-L286 |
191,942 | backbee/backbee-php | DependencyInjection/ContainerBuilder.php | ContainerBuilder.loadApplicationServices | private function loadApplicationServices()
{
// setting default services
$this->container->set('bbapp', $this->application);
$this->container->set('container.builder', $this);
$services_directory = $this->application->getBBDir().'/Config/services';
foreach (scandir($services... | php | private function loadApplicationServices()
{
// setting default services
$this->container->set('bbapp', $this->application);
$this->container->set('container.builder', $this);
$services_directory = $this->application->getBBDir().'/Config/services';
foreach (scandir($services... | [
"private",
"function",
"loadApplicationServices",
"(",
")",
"{",
"// setting default services",
"$",
"this",
"->",
"container",
"->",
"set",
"(",
"'bbapp'",
",",
"$",
"this",
"->",
"application",
")",
";",
"$",
"this",
"->",
"container",
"->",
"set",
"(",
"'... | Load and override services into container; the load order is from the most global to the most specific
depends on context and environment. | [
"Load",
"and",
"override",
"services",
"into",
"container",
";",
"the",
"load",
"order",
"is",
"from",
"the",
"most",
"global",
"to",
"the",
"most",
"specific",
"depends",
"on",
"context",
"and",
"environment",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerBuilder.php#L304-L338 |
191,943 | backbee/backbee-php | DependencyInjection/ContainerBuilder.php | ContainerBuilder.loadLoggerDefinition | private function loadLoggerDefinition()
{
$logger_class = $this->container->getParameter('bbapp.logger.class');
if (true === $this->container->getParameter('debug')) {
$logger_class = $this->container->getParameter('bbapp.logger_debug.class');
}
$this->container->setDefi... | php | private function loadLoggerDefinition()
{
$logger_class = $this->container->getParameter('bbapp.logger.class');
if (true === $this->container->getParameter('debug')) {
$logger_class = $this->container->getParameter('bbapp.logger_debug.class');
}
$this->container->setDefi... | [
"private",
"function",
"loadLoggerDefinition",
"(",
")",
"{",
"$",
"logger_class",
"=",
"$",
"this",
"->",
"container",
"->",
"getParameter",
"(",
"'bbapp.logger.class'",
")",
";",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"container",
"->",
"getParameter",... | Load on the fly logging service definition, depends on debug value. | [
"Load",
"on",
"the",
"fly",
"logging",
"service",
"definition",
"depends",
"on",
"debug",
"value",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerBuilder.php#L343-L351 |
191,944 | backbee/backbee-php | NestedNode/Repository/KeyWordRepository.php | KeyWordRepository.getKeywordsFromElements | public function getKeywordsFromElements(&$elements = array())
{
if (0 === count($elements)) {
return array();
}
$uids = array();
$assoc = array();
foreach ($elements as &$element) {
if ($element instanceof Keyword) {
$uids[] = $element... | php | public function getKeywordsFromElements(&$elements = array())
{
if (0 === count($elements)) {
return array();
}
$uids = array();
$assoc = array();
foreach ($elements as &$element) {
if ($element instanceof Keyword) {
$uids[] = $element... | [
"public",
"function",
"getKeywordsFromElements",
"(",
"&",
"$",
"elements",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"elements",
")",
")",
"{",
"return",
"array",
"(",
")",
";",
"}",
"$",
"uids",
"=",
"array",
"("... | Returns the nested keywords object according to the element keyword objects provided
Also set the parameter 'objectKeyword' from the element to the nested keyword.
@param array $elements
@return array | [
"Returns",
"the",
"nested",
"keywords",
"object",
"according",
"to",
"the",
"element",
"keyword",
"objects",
"provided",
"Also",
"set",
"the",
"parameter",
"objectKeyword",
"from",
"the",
"element",
"to",
"the",
"nested",
"keyword",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/KeyWordRepository.php#L162-L193 |
191,945 | backbee/backbee-php | ClassContent/Repository/Element/KeywordRepository.php | KeywordRepository.updateKeywordLinks | public function updateKeywordLinks(AbstractClassContent $content, $keywords, BBUserToken $token = null)
{
if (!is_array($keywords)) {
$keywords = [$keywords];
}
foreach ($keywords as $keyword) {
if (!($keyword instanceof Keyword)) {
continue;
... | php | public function updateKeywordLinks(AbstractClassContent $content, $keywords, BBUserToken $token = null)
{
if (!is_array($keywords)) {
$keywords = [$keywords];
}
foreach ($keywords as $keyword) {
if (!($keyword instanceof Keyword)) {
continue;
... | [
"public",
"function",
"updateKeywordLinks",
"(",
"AbstractClassContent",
"$",
"content",
",",
"$",
"keywords",
",",
"BBUserToken",
"$",
"token",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"keywords",
")",
")",
"{",
"$",
"keywords",
"=",
... | Updates keywords_contents join.
@param AbstractClassContent $content
@param mixed $keywords
@param BBUserToken $token | [
"Updates",
"keywords_contents",
"join",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/Element/KeywordRepository.php#L118-L147 |
191,946 | backbee/backbee-php | ClassContent/Repository/Element/KeywordRepository.php | KeywordRepository.cleanKeywordLinks | public function cleanKeywordLinks(AbstractClassContent $content, $keywords)
{
if (!is_array($keywords)) {
$keywords = [$keywords];
}
$keywordUids = [];
foreach ($keywords as $keyword) {
if (
$keyword instanceof Keyword
&& !empt... | php | public function cleanKeywordLinks(AbstractClassContent $content, $keywords)
{
if (!is_array($keywords)) {
$keywords = [$keywords];
}
$keywordUids = [];
foreach ($keywords as $keyword) {
if (
$keyword instanceof Keyword
&& !empt... | [
"public",
"function",
"cleanKeywordLinks",
"(",
"AbstractClassContent",
"$",
"content",
",",
"$",
"keywords",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"keywords",
")",
")",
"{",
"$",
"keywords",
"=",
"[",
"$",
"keywords",
"]",
";",
"}",
"$",
"ke... | Deletes outdated keyword content joins.
@param AbstractClassContent $content
@param mixed $keywords | [
"Deletes",
"outdated",
"keyword",
"content",
"joins",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/Element/KeywordRepository.php#L155-L203 |
191,947 | backbee/backbee-php | NestedNode/KeyWord.php | KeyWord.toStdObject | public function toStdObject()
{
$object = new \stdClass();
$object->uid = $this->getUid();
$object->level = $this->getLevel();
$object->keyword = $this->getKeyword();
$object->children = array();
return $object;
} | php | public function toStdObject()
{
$object = new \stdClass();
$object->uid = $this->getUid();
$object->level = $this->getLevel();
$object->keyword = $this->getKeyword();
$object->children = array();
return $object;
} | [
"public",
"function",
"toStdObject",
"(",
")",
"{",
"$",
"object",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"object",
"->",
"uid",
"=",
"$",
"this",
"->",
"getUid",
"(",
")",
";",
"$",
"object",
"->",
"level",
"=",
"$",
"this",
"->",
"ge... | Returns a stdObj representation of the node.
@return \stdClass | [
"Returns",
"a",
"stdObj",
"representation",
"of",
"the",
"node",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/KeyWord.php#L261-L269 |
191,948 | backbee/backbee-php | Event/PostUploadEvent.php | PostUploadEvent.hasValidSourceFile | public function hasValidSourceFile()
{
$sourcefile = $this->getSourceFile();
return (true === is_readable($sourcefile) && false === is_dir($sourcefile));
} | php | public function hasValidSourceFile()
{
$sourcefile = $this->getSourceFile();
return (true === is_readable($sourcefile) && false === is_dir($sourcefile));
} | [
"public",
"function",
"hasValidSourceFile",
"(",
")",
"{",
"$",
"sourcefile",
"=",
"$",
"this",
"->",
"getSourceFile",
"(",
")",
";",
"return",
"(",
"true",
"===",
"is_readable",
"(",
"$",
"sourcefile",
")",
"&&",
"false",
"===",
"is_dir",
"(",
"$",
"sou... | Is the source file is a valid readable file ?
@return boolean | [
"Is",
"the",
"source",
"file",
"is",
"a",
"valid",
"readable",
"file",
"?"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Event/PostUploadEvent.php#L72-L77 |
191,949 | backbee/backbee-php | Profiler/DataCollector/DoctrineDataCollector.php | DoctrineDataCollector.interpolateQuery | private function interpolateQuery($query, array $params)
{
$keys = array();
$values = $params;
# build a regular expression for each parameter
foreach ($params as $key => $value) {
if (is_string($key)) {
$keys[] = '/:'.$key.'/';
} else {
... | php | private function interpolateQuery($query, array $params)
{
$keys = array();
$values = $params;
# build a regular expression for each parameter
foreach ($params as $key => $value) {
if (is_string($key)) {
$keys[] = '/:'.$key.'/';
} else {
... | [
"private",
"function",
"interpolateQuery",
"(",
"$",
"query",
",",
"array",
"$",
"params",
")",
"{",
"$",
"keys",
"=",
"array",
"(",
")",
";",
"$",
"values",
"=",
"$",
"params",
";",
"# build a regular expression for each parameter",
"foreach",
"(",
"$",
"pa... | Interpolate sql query tokens.
@param string $query
@param array $params
@return string | [
"Interpolate",
"sql",
"query",
"tokens",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Profiler/DataCollector/DoctrineDataCollector.php#L256-L283 |
191,950 | backbee/backbee-php | Config/Persistor/Registry.php | Registry.getScope | public function getScope($key)
{
$scope = ('application' === $key) ? 'APPLICATION_CONFIG' : 'BUNDLE_CONFIG';
if ($this->application->getContainer()->has('config.configurator')) {
$scope = $this
->application
->getContainer()
->... | php | public function getScope($key)
{
$scope = ('application' === $key) ? 'APPLICATION_CONFIG' : 'BUNDLE_CONFIG';
if ($this->application->getContainer()->has('config.configurator')) {
$scope = $this
->application
->getContainer()
->... | [
"public",
"function",
"getScope",
"(",
"$",
"key",
")",
"{",
"$",
"scope",
"=",
"(",
"'application'",
"===",
"$",
"key",
")",
"?",
"'APPLICATION_CONFIG'",
":",
"'BUNDLE_CONFIG'",
";",
"if",
"(",
"$",
"this",
"->",
"application",
"->",
"getContainer",
"(",
... | Returns the registry scope.
@param string $key
@return string | [
"Returns",
"the",
"registry",
"scope",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Persistor/Registry.php#L74-L88 |
191,951 | backbee/backbee-php | Cache/MemCache/Memcached.php | Memcached.setOption | public function setOption($option, $value)
{
if (false === is_int($option)) {
$this->log('warning', sprintf('Unknown memcached option: `%s`.', $option));
return false;
}
if (false === $this->_cache->setOption($option, $value)) {
return $this->_onError('s... | php | public function setOption($option, $value)
{
if (false === is_int($option)) {
$this->log('warning', sprintf('Unknown memcached option: `%s`.', $option));
return false;
}
if (false === $this->_cache->setOption($option, $value)) {
return $this->_onError('s... | [
"public",
"function",
"setOption",
"(",
"$",
"option",
",",
"$",
"value",
")",
"{",
"if",
"(",
"false",
"===",
"is_int",
"(",
"$",
"option",
")",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"'warning'",
",",
"sprintf",
"(",
"'Unknown memcached option: `%s`.... | Sets memcached option.
@param int $option
@param mixed $value
@return boolean
@link http://php.net/manual/en/memcached.setoption.php | [
"Sets",
"memcached",
"option",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/MemCache/Memcached.php#L113-L126 |
191,952 | backbee/backbee-php | Cache/MemCache/Memcached.php | Memcached.getOption | public function getOption($option)
{
if (false === is_int($option)) {
$this->log('warning', sprintf('Unknown memcached option: `%s`.', $option));
return false;
}
if (false === $this->_cache->getOption($option)) {
return $this->_onError('getOption');
... | php | public function getOption($option)
{
if (false === is_int($option)) {
$this->log('warning', sprintf('Unknown memcached option: `%s`.', $option));
return false;
}
if (false === $this->_cache->getOption($option)) {
return $this->_onError('getOption');
... | [
"public",
"function",
"getOption",
"(",
"$",
"option",
")",
"{",
"if",
"(",
"false",
"===",
"is_int",
"(",
"$",
"option",
")",
")",
"{",
"$",
"this",
"->",
"log",
"(",
"'warning'",
",",
"sprintf",
"(",
"'Unknown memcached option: `%s`.'",
",",
"$",
"opti... | Gets memcached option.
@param mixed $option
@param mixed $value
@return boolean
@link http://php.net/manual/en/memcached.getoption.php | [
"Gets",
"memcached",
"option",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/MemCache/Memcached.php#L138-L151 |
191,953 | backbee/backbee-php | Cache/MemCache/Memcached.php | Memcached.save | public function save($id, $data, $lifetime = null, $tag = null, $bypass_control = false)
{
$lifetime = $this->getLifeTime($lifetime);
if (false === $this->_cache->set($id, (is_array($data) ? $data : ''.$data), $lifetime)) {
return $this->_onError('save');
}
if (null !==... | php | public function save($id, $data, $lifetime = null, $tag = null, $bypass_control = false)
{
$lifetime = $this->getLifeTime($lifetime);
if (false === $this->_cache->set($id, (is_array($data) ? $data : ''.$data), $lifetime)) {
return $this->_onError('save');
}
if (null !==... | [
"public",
"function",
"save",
"(",
"$",
"id",
",",
"$",
"data",
",",
"$",
"lifetime",
"=",
"null",
",",
"$",
"tag",
"=",
"null",
",",
"$",
"bypass_control",
"=",
"false",
")",
"{",
"$",
"lifetime",
"=",
"$",
"this",
"->",
"getLifeTime",
"(",
"$",
... | Saves some string datas into a cache record.
@param string $id Cache id
@param string $data Datas to cache
@param int $lifetime Optional, the specific lifetime for this record
(by default null, infinite lifetime)
@param string $tag Optional, an associated tag to the data stored
@return boolean TRUE ... | [
"Saves",
"some",
"string",
"datas",
"into",
"a",
"cache",
"record",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/MemCache/Memcached.php#L205-L218 |
191,954 | Fakerino/Fakerino | src/Fakerino/Configuration/FakerinoConf.php | FakerinoConf.loadConfiguration | public function loadConfiguration()
{
if (empty($this->conf)) {
$this->conf = $this->loadDefault();
} else {
$this->conf = array_merge(self::loadDefault(), $this->conf);
}
return $this->conf;
} | php | public function loadConfiguration()
{
if (empty($this->conf)) {
$this->conf = $this->loadDefault();
} else {
$this->conf = array_merge(self::loadDefault(), $this->conf);
}
return $this->conf;
} | [
"public",
"function",
"loadConfiguration",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"conf",
")",
")",
"{",
"$",
"this",
"->",
"conf",
"=",
"$",
"this",
"->",
"loadDefault",
"(",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",
"co... | Loads the default configuration if it's not present a custom one.
@return array | [
"Loads",
"the",
"default",
"configuration",
"if",
"it",
"s",
"not",
"present",
"a",
"custom",
"one",
"."
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Configuration/FakerinoConf.php#L41-L50 |
191,955 | Fakerino/Fakerino | src/Fakerino/Configuration/FakerinoConf.php | FakerinoConf.get | public function get($value)
{
if (!empty($this->conf)) {
if (array_key_exists($value, $this->conf)) {
return $this->conf[$value];
}
}
throw new ConfValueNotFoundException($value);
} | php | public function get($value)
{
if (!empty($this->conf)) {
if (array_key_exists($value, $this->conf)) {
return $this->conf[$value];
}
}
throw new ConfValueNotFoundException($value);
} | [
"public",
"function",
"get",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"conf",
")",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"$",
"value",
",",
"$",
"this",
"->",
"conf",
")",
")",
"{",
"return",
"$",
"t... | Returns a configuration value.
@param string $value
@return mixed
@throws ConfValueNotFoundException | [
"Returns",
"a",
"configuration",
"value",
"."
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Configuration/FakerinoConf.php#L60-L70 |
191,956 | backbee/backbee-php | Site/Repository/LayoutRepository.php | LayoutRepository.drawRect | private function drawRect(&$image, $clip, $background, $nowpadding = true, $nohpadding = true)
{
imagefilledrectangle($image, $clip[0], $clip[1], $clip[0] + $clip[2] - (!$nowpadding * 1), $clip[1] + $clip[3] - (!$nohpadding * 1), $background);
} | php | private function drawRect(&$image, $clip, $background, $nowpadding = true, $nohpadding = true)
{
imagefilledrectangle($image, $clip[0], $clip[1], $clip[0] + $clip[2] - (!$nowpadding * 1), $clip[1] + $clip[3] - (!$nohpadding * 1), $background);
} | [
"private",
"function",
"drawRect",
"(",
"&",
"$",
"image",
",",
"$",
"clip",
",",
"$",
"background",
",",
"$",
"nowpadding",
"=",
"true",
",",
"$",
"nohpadding",
"=",
"true",
")",
"{",
"imagefilledrectangle",
"(",
"$",
"image",
",",
"$",
"clip",
"[",
... | Draw a filled rect on image.
@access private
@param ressource $image The image ressource
@param array $clip The clip rect to draw
@param int $background The background color
@param boolean $nowpadding If true don't insert a right padding
@param boolean $nohpadding If true don't insert a botto... | [
"Draw",
"a",
"filled",
"rect",
"on",
"image",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Repository/LayoutRepository.php#L52-L55 |
191,957 | backbee/backbee-php | Site/Repository/LayoutRepository.php | LayoutRepository.drawThumbnailZone | private function drawThumbnailZone(&$thumbnail, $node, $clip, $background, $gridcolumn, $lastChild = false)
{
$x = $clip[0];
$y = $clip[1];
$width = $clip[2];
$height = $clip[3];
if (null !== $spansize = preg_replace('/[^0-9]+/', '', $node->getAttribute('class'))) {
... | php | private function drawThumbnailZone(&$thumbnail, $node, $clip, $background, $gridcolumn, $lastChild = false)
{
$x = $clip[0];
$y = $clip[1];
$width = $clip[2];
$height = $clip[3];
if (null !== $spansize = preg_replace('/[^0-9]+/', '', $node->getAttribute('class'))) {
... | [
"private",
"function",
"drawThumbnailZone",
"(",
"&",
"$",
"thumbnail",
",",
"$",
"node",
",",
"$",
"clip",
",",
"$",
"background",
",",
"$",
"gridcolumn",
",",
"$",
"lastChild",
"=",
"false",
")",
"{",
"$",
"x",
"=",
"$",
"clip",
"[",
"0",
"]",
";... | Draw a final layout zone on its thumbnail.
@access private
@param ressource $thumbnail The thumbnail ressource
@param DOMNode $node The current node zone
@param array $clip The clip rect to draw
@param int $background The background color
@param int $gridcolumn The number of columns in ... | [
"Draw",
"a",
"final",
"layout",
"zone",
"on",
"its",
"thumbnail",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Repository/LayoutRepository.php#L71-L107 |
191,958 | backbee/backbee-php | Site/Repository/LayoutRepository.php | LayoutRepository.getModels | public function getModels()
{
try {
$q = $this->createQueryBuilder('l')
->where('l._site IS NULL')
->orderBy('l._label', 'ASC')
->getQuery();
return $q->getResult();
} catch (\Doctrine\ORM\NoResultException $e) {
... | php | public function getModels()
{
try {
$q = $this->createQueryBuilder('l')
->where('l._site IS NULL')
->orderBy('l._label', 'ASC')
->getQuery();
return $q->getResult();
} catch (\Doctrine\ORM\NoResultException $e) {
... | [
"public",
"function",
"getModels",
"(",
")",
"{",
"try",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'l'",
")",
"->",
"where",
"(",
"'l._site IS NULL'",
")",
"->",
"orderBy",
"(",
"'l._label'",
",",
"'ASC'",
")",
"->",
"getQuery",
... | Returns layout models.
@access public
@return array Array of Layout | [
"Returns",
"layout",
"models",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Site/Repository/LayoutRepository.php#L235-L249 |
191,959 | backbee/backbee-php | Util/Doctrine/EntityManagerCreator.php | EntityManagerCreator.create | public static function create(array $options = array(), LoggerInterface $logger = null, EventManager $evm = null, ContainerInterface $container = null)
{
if (isset($options['entity_manager'])) {
// Test the nature of the entity_manager parameter
$em = self::getEntityManagerWithEntity... | php | public static function create(array $options = array(), LoggerInterface $logger = null, EventManager $evm = null, ContainerInterface $container = null)
{
if (isset($options['entity_manager'])) {
// Test the nature of the entity_manager parameter
$em = self::getEntityManagerWithEntity... | [
"public",
"static",
"function",
"create",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
",",
"LoggerInterface",
"$",
"logger",
"=",
"null",
",",
"EventManager",
"$",
"evm",
"=",
"null",
",",
"ContainerInterface",
"$",
"container",
"=",
"null",
")",... | Creates a new Doctrine entity manager.
@param array $options Options provided to get an entity manager, keys should be :
- entity_manager EntityManager Optional, an already defined EntityManager (simply returns it)
- connection Connection Optional, an already initialized database connection
- proxy_d... | [
"Creates",
"a",
"new",
"Doctrine",
"entity",
"manager",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Doctrine/EntityManagerCreator.php#L62-L90 |
191,960 | backbee/backbee-php | Util/Doctrine/EntityManagerCreator.php | EntityManagerCreator.expandSqlite | private static function expandSqlite(Connection $connection)
{
// add support for REGEXP operator
$connection->getWrappedConnection()->sqliteCreateFunction(
'regexp',
function ($pattern, $data, $delimiter = '~', $modifiers = 'isuS') {
if (isset($pattern, $data... | php | private static function expandSqlite(Connection $connection)
{
// add support for REGEXP operator
$connection->getWrappedConnection()->sqliteCreateFunction(
'regexp',
function ($pattern, $data, $delimiter = '~', $modifiers = 'isuS') {
if (isset($pattern, $data... | [
"private",
"static",
"function",
"expandSqlite",
"(",
"Connection",
"$",
"connection",
")",
"{",
"// add support for REGEXP operator",
"$",
"connection",
"->",
"getWrappedConnection",
"(",
")",
"->",
"sqliteCreateFunction",
"(",
"'regexp'",
",",
"function",
"(",
"$",
... | Custom SQLite logic.
@param Connection $connection | [
"Custom",
"SQLite",
"logic",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Doctrine/EntityManagerCreator.php#L97-L110 |
191,961 | backbee/backbee-php | Util/Doctrine/EntityManagerCreator.php | EntityManagerCreator.addCustomFunctions | private static function addCustomFunctions(Configuration $config, array $options = array())
{
if (null !== $strFcts = Collection::get($options, 'orm:entity_managers:default:dql:string_functions')) {
foreach ($strFcts as $name => $class) {
if (class_exists($class)) {
... | php | private static function addCustomFunctions(Configuration $config, array $options = array())
{
if (null !== $strFcts = Collection::get($options, 'orm:entity_managers:default:dql:string_functions')) {
foreach ($strFcts as $name => $class) {
if (class_exists($class)) {
... | [
"private",
"static",
"function",
"addCustomFunctions",
"(",
"Configuration",
"$",
"config",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"strFcts",
"=",
"Collection",
"::",
"get",
"(",
"$",
"options",
","... | Adds userdefined functions.
@param Configuration $config
@param array $options
@return Configuration | [
"Adds",
"userdefined",
"functions",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Doctrine/EntityManagerCreator.php#L204-L231 |
191,962 | backbee/backbee-php | Util/Doctrine/EntityManagerCreator.php | EntityManagerCreator.createEntityManagerWithConnection | private static function createEntityManagerWithConnection($connection, Configuration $config, EventManager $evm = null)
{
if ($connection instanceof Connection) {
try {
return EntityManager::create($connection, $config, $evm);
} catch (\Exception $e) {
... | php | private static function createEntityManagerWithConnection($connection, Configuration $config, EventManager $evm = null)
{
if ($connection instanceof Connection) {
try {
return EntityManager::create($connection, $config, $evm);
} catch (\Exception $e) {
... | [
"private",
"static",
"function",
"createEntityManagerWithConnection",
"(",
"$",
"connection",
",",
"Configuration",
"$",
"config",
",",
"EventManager",
"$",
"evm",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"connection",
"instanceof",
"Connection",
")",
"{",
"try",
... | Returns a new EntityManager with the provided connection.
@param Connection $connection
@param Configuration $config
@param EventManager $evm Optional event manager
@return EntityManager
@throws InvalidArgumentException Occurs if $entityManager can not be created | [
"Returns",
"a",
"new",
"EntityManager",
"with",
"the",
"provided",
"connection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Doctrine/EntityManagerCreator.php#L259-L274 |
191,963 | backbee/backbee-php | Util/Doctrine/EntityManagerCreator.php | EntityManagerCreator.createEntityManagerWithParameters | private static function createEntityManagerWithParameters(array $options, Configuration $config, EventManager $evm = null)
{
try {
return EntityManager::create(self::randomizeServerPoolConnection($options), $config, $evm);
} catch (\Exception $e) {
throw new InvalidArgumentEx... | php | private static function createEntityManagerWithParameters(array $options, Configuration $config, EventManager $evm = null)
{
try {
return EntityManager::create(self::randomizeServerPoolConnection($options), $config, $evm);
} catch (\Exception $e) {
throw new InvalidArgumentEx... | [
"private",
"static",
"function",
"createEntityManagerWithParameters",
"(",
"array",
"$",
"options",
",",
"Configuration",
"$",
"config",
",",
"EventManager",
"$",
"evm",
"=",
"null",
")",
"{",
"try",
"{",
"return",
"EntityManager",
"::",
"create",
"(",
"self",
... | Returns a new EntityManager with the provided parameters.
@param array $options
@param Configuration $config
@param EventManager $evm
@return EntityManager
@throws InvalidArgumentException Occurs if $entityManager can not be created | [
"Returns",
"a",
"new",
"EntityManager",
"with",
"the",
"provided",
"parameters",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Doctrine/EntityManagerCreator.php#L287-L298 |
191,964 | backbee/backbee-php | Util/Doctrine/EntityManagerCreator.php | EntityManagerCreator.randomizeServerPoolConnection | private static function randomizeServerPoolConnection($options)
{
if (array_key_exists('host', $options) && is_array($options['host'])) {
if (1 < count($options['host'])) {
shuffle($options['host']);
}
$options['host'] = reset($options['host']);
}
... | php | private static function randomizeServerPoolConnection($options)
{
if (array_key_exists('host', $options) && is_array($options['host'])) {
if (1 < count($options['host'])) {
shuffle($options['host']);
}
$options['host'] = reset($options['host']);
}
... | [
"private",
"static",
"function",
"randomizeServerPoolConnection",
"(",
"$",
"options",
")",
"{",
"if",
"(",
"array_key_exists",
"(",
"'host'",
",",
"$",
"options",
")",
"&&",
"is_array",
"(",
"$",
"options",
"[",
"'host'",
"]",
")",
")",
"{",
"if",
"(",
... | If an array og db hosts is provided, randomize the selection of one of them
@param array $options
@return array | [
"If",
"an",
"array",
"og",
"db",
"hosts",
"is",
"provided",
"randomize",
"the",
"selection",
"of",
"one",
"of",
"them"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Doctrine/EntityManagerCreator.php#L305-L315 |
191,965 | backbee/backbee-php | Util/Doctrine/EntityManagerCreator.php | EntityManagerCreator.setConnectionCharset | private static function setConnectionCharset(Connection $connection, array $options = array())
{
if (isset($options['charset'])) {
try {
if ('pdo_mysql' === $connection->getDriver()->getName()) {
$connection->executeQuery('SET SESSION character_set_client = "'... | php | private static function setConnectionCharset(Connection $connection, array $options = array())
{
if (isset($options['charset'])) {
try {
if ('pdo_mysql' === $connection->getDriver()->getName()) {
$connection->executeQuery('SET SESSION character_set_client = "'... | [
"private",
"static",
"function",
"setConnectionCharset",
"(",
"Connection",
"$",
"connection",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'charset'",
"]",
")",
")",
"{",
"try",
"{",
"i... | Sets the character set for the provided connection.
@param Connection $connection
@param array $options
@throws InvalidArgumentException Occurs if charset is invalid | [
"Sets",
"the",
"character",
"set",
"for",
"the",
"provided",
"connection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Doctrine/EntityManagerCreator.php#L324-L341 |
191,966 | backbee/backbee-php | Util/Doctrine/EntityManagerCreator.php | EntityManagerCreator.setConnectionCollation | private static function setConnectionCollation(Connection $connection, array $options = array())
{
if (isset($options['collation'])) {
try {
if ('pdo_mysql' === $connection->getDriver()->getName()) {
$connection->executeQuery('SET SESSION collation_connection ... | php | private static function setConnectionCollation(Connection $connection, array $options = array())
{
if (isset($options['collation'])) {
try {
if ('pdo_mysql' === $connection->getDriver()->getName()) {
$connection->executeQuery('SET SESSION collation_connection ... | [
"private",
"static",
"function",
"setConnectionCollation",
"(",
"Connection",
"$",
"connection",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"options",
"[",
"'collation'",
"]",
")",
")",
"{",
"try",
"{",
... | Sets the collation for the provided connection.
@param Connection $connection
@param array $options
@throws InvalidArgumentException Occurs if collation is invalid | [
"Sets",
"the",
"collation",
"for",
"the",
"provided",
"connection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Doctrine/EntityManagerCreator.php#L350-L365 |
191,967 | backbee/backbee-php | Cache/IdentifierAppender/NodeAppender.php | NodeAppender.getClassContentCacheNodeParameter | private function getClassContentCacheNodeParameter(AbstractClassContent $content)
{
$classnames = array(ClassUtils::getRealClass($content));
$content_uids = $this->em->getRepository('\BackBee\ClassContent\Indexes\IdxContentContent')
->getDescendantsContentUids($content)
;
... | php | private function getClassContentCacheNodeParameter(AbstractClassContent $content)
{
$classnames = array(ClassUtils::getRealClass($content));
$content_uids = $this->em->getRepository('\BackBee\ClassContent\Indexes\IdxContentContent')
->getDescendantsContentUids($content)
;
... | [
"private",
"function",
"getClassContentCacheNodeParameter",
"(",
"AbstractClassContent",
"$",
"content",
")",
"{",
"$",
"classnames",
"=",
"array",
"(",
"ClassUtils",
"::",
"getRealClass",
"(",
"$",
"content",
")",
")",
";",
"$",
"content_uids",
"=",
"$",
"this"... | Try to extract cache node parameter from class content yaml files.
@param AbstractClassContent $content the content which we want to extract cache node parameter
@return null|string return the cache node parameter if it exists, else null | [
"Try",
"to",
"extract",
"cache",
"node",
"parameter",
"from",
"class",
"content",
"yaml",
"files",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/IdentifierAppender/NodeAppender.php#L123-L154 |
191,968 | backbee/backbee-php | Workflow/Listener/PageListener.php | PageListener.onPreUpdate | public static function onPreUpdate(Event $event)
{
$page = $event->getTarget();
$eventArgs = $event->getEventArgs();
if ($eventArgs instanceof PreUpdateEventArgs) {
if ($eventArgs->hasChangedField('_workflow_state')) {
$old = $eventArgs->getOldValue('_workflow_st... | php | public static function onPreUpdate(Event $event)
{
$page = $event->getTarget();
$eventArgs = $event->getEventArgs();
if ($eventArgs instanceof PreUpdateEventArgs) {
if ($eventArgs->hasChangedField('_workflow_state')) {
$old = $eventArgs->getOldValue('_workflow_st... | [
"public",
"static",
"function",
"onPreUpdate",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"page",
"=",
"$",
"event",
"->",
"getTarget",
"(",
")",
";",
"$",
"eventArgs",
"=",
"$",
"event",
"->",
"getEventArgs",
"(",
")",
";",
"if",
"(",
"$",
"eventArg... | Occur on nestednode.page.preupdate events.
@access public
@param Event $event | [
"Occur",
"on",
"nestednode",
".",
"page",
".",
"preupdate",
"events",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Workflow/Listener/PageListener.php#L48-L81 |
191,969 | backbee/backbee-php | Config/Persistor.php | Persistor.doPersist | private function doPersist(Config $config, array $config_to_persist)
{
foreach ($this->persistors as $persistor) {
if (true === $persistor->persist($config, $config_to_persist)) {
$this->application->getContainer()->get('container.builder')->removeContainerDump();
... | php | private function doPersist(Config $config, array $config_to_persist)
{
foreach ($this->persistors as $persistor) {
if (true === $persistor->persist($config, $config_to_persist)) {
$this->application->getContainer()->get('container.builder')->removeContainerDump();
... | [
"private",
"function",
"doPersist",
"(",
"Config",
"$",
"config",
",",
"array",
"$",
"config_to_persist",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"persistors",
"as",
"$",
"persistor",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"persistor",
"->",
"pers... | Tries to persist config by calling every declared persistors; it will stop on first success.
@param Config $config the concern this persist action concern
@param array $config_to_persist settings to persist for provided config | [
"Tries",
"to",
"persist",
"config",
"by",
"calling",
"every",
"declared",
"persistors",
";",
"it",
"will",
"stop",
"on",
"first",
"success",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Persistor.php#L117-L125 |
191,970 | backbee/backbee-php | Config/Persistor.php | Persistor.loadPersistors | private function loadPersistors()
{
if (null !== $config = $this->application->getConfig()) {
$config_config = $config->getConfigConfig();
if (!is_array($config_config) || !array_key_exists('persistor', $config_config)) {
throw new PersistorListNotFoundException();
... | php | private function loadPersistors()
{
if (null !== $config = $this->application->getConfig()) {
$config_config = $config->getConfigConfig();
if (!is_array($config_config) || !array_key_exists('persistor', $config_config)) {
throw new PersistorListNotFoundException();
... | [
"private",
"function",
"loadPersistors",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"config",
"=",
"$",
"this",
"->",
"application",
"->",
"getConfig",
"(",
")",
")",
"{",
"$",
"config_config",
"=",
"$",
"config",
"->",
"getConfigConfig",
"(",
")",
... | Loads every declared persistors in application config.yml, config section.
@throws PersistorListNotFoundException occurs if there is no persistor list in config.yml, section: config
it also occurs if config section does not exist in application config.yml
@throws InvalidArgumentException raises if one of declare... | [
"Loads",
"every",
"declared",
"persistors",
"in",
"application",
"config",
".",
"yml",
"config",
"section",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Persistor.php#L134-L160 |
191,971 | backbee/backbee-php | Rest/Controller/AclController.php | AclController.clearPermissionsPageAction | public function clearPermissionsPageAction(Request $request)
{
$page = $request->attributes->get('uid');
$group = $request->attributes->get('group');
$aclManager = $this->getContainer()->get('security.acl_manager');
$securityIdentity = new UserSecurityIdentity($group, 'BackBee\Secur... | php | public function clearPermissionsPageAction(Request $request)
{
$page = $request->attributes->get('uid');
$group = $request->attributes->get('group');
$aclManager = $this->getContainer()->get('security.acl_manager');
$securityIdentity = new UserSecurityIdentity($group, 'BackBee\Secur... | [
"public",
"function",
"clearPermissionsPageAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"page",
"=",
"$",
"request",
"->",
"attributes",
"->",
"get",
"(",
"'uid'",
")",
";",
"$",
"group",
"=",
"$",
"request",
"->",
"attributes",
"->",
"get",
"... | Clear permissions for an page
@Rest\ParamConverter(name="uid", class="BackBee\NestedNode\Page")
@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')")
@param Request $request
@return JsonResponse | [
"Clear",
"permissions",
"for",
"an",
"page"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/AclController.php#L514-L542 |
191,972 | backbee/backbee-php | Logging/Logger.php | Logger.getPriorityName | protected function getPriorityName($code)
{
return isset($this->_priorities[$code]) ? $this->_priorities[$code] : null;
} | php | protected function getPriorityName($code)
{
return isset($this->_priorities[$code]) ? $this->_priorities[$code] : null;
} | [
"protected",
"function",
"getPriorityName",
"(",
"$",
"code",
")",
"{",
"return",
"isset",
"(",
"$",
"this",
"->",
"_priorities",
"[",
"$",
"code",
"]",
")",
"?",
"$",
"this",
"->",
"_priorities",
"[",
"$",
"code",
"]",
":",
"null",
";",
"}"
] | Get priority name by its code.
@param int $code
@return string|null | [
"Get",
"priority",
"name",
"by",
"its",
"code",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Logging/Logger.php#L297-L300 |
191,973 | backbee/backbee-php | Rest/Controller/ResourceController.php | ResourceController.uploadAction | public function uploadAction(Request $request)
{
$files = $request->files;
$data = [];
if ($files->count() === 1) {
foreach ($files as $file) {
$data = $this->doRequestUpload($file);
break;
}
} else {
if ($files->co... | php | public function uploadAction(Request $request)
{
$files = $request->files;
$data = [];
if ($files->count() === 1) {
foreach ($files as $file) {
$data = $this->doRequestUpload($file);
break;
}
} else {
if ($files->co... | [
"public",
"function",
"uploadAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"files",
"=",
"$",
"request",
"->",
"files",
";",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"files",
"->",
"count",
"(",
")",
"===",
"1",
")",
"{",
"forea... | Upload file action
@return \Symfony\Component\HttpFoundation\JsonResponse
@throws NotFoundHttpException No file in the request
@throws BadRequestHttpException Only on file can be upload
@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')") | [
"Upload",
"file",
"action"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/ResourceController.php#L54-L79 |
191,974 | backbee/backbee-php | Rest/Controller/ResourceController.php | ResourceController.doRequestUpload | private function doRequestUpload(UploadedFile $file)
{
$tmpDirectory = $this->getApplication()->getTemporaryDir();
$data = [];
if (null !== $file) {
if ($file->isValid()) {
if ($file->getClientSize() <= $file->getMaxFilesize()) {
$data = $this... | php | private function doRequestUpload(UploadedFile $file)
{
$tmpDirectory = $this->getApplication()->getTemporaryDir();
$data = [];
if (null !== $file) {
if ($file->isValid()) {
if ($file->getClientSize() <= $file->getMaxFilesize()) {
$data = $this... | [
"private",
"function",
"doRequestUpload",
"(",
"UploadedFile",
"$",
"file",
")",
"{",
"$",
"tmpDirectory",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"getTemporaryDir",
"(",
")",
";",
"$",
"data",
"=",
"[",
"]",
";",
"if",
"(",
"null",
"... | Upload file from the request
@param UploadedFile $file
@return Array $data Retrieve into the content of response
@throws BadRequestHttpException The file is too big | [
"Upload",
"file",
"from",
"the",
"request"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/ResourceController.php#L88-L117 |
191,975 | backbee/backbee-php | Rest/Controller/ResourceController.php | ResourceController.doUpload | private function doUpload($src, $originalName)
{
$data = $this->buildData($originalName, File::getExtension($originalName, false));
file_put_contents($data['path'], base64_decode($src));
$this->application->getEventDispatcher()->dispatch(
ValidateFileUploadEvent::EVENT_NAME,
... | php | private function doUpload($src, $originalName)
{
$data = $this->buildData($originalName, File::getExtension($originalName, false));
file_put_contents($data['path'], base64_decode($src));
$this->application->getEventDispatcher()->dispatch(
ValidateFileUploadEvent::EVENT_NAME,
... | [
"private",
"function",
"doUpload",
"(",
"$",
"src",
",",
"$",
"originalName",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"buildData",
"(",
"$",
"originalName",
",",
"File",
"::",
"getExtension",
"(",
"$",
"originalName",
",",
"false",
")",
")",
";"... | Upload file from a base64
@param String $src base64
@param String $originalName
@return Array $data | [
"Upload",
"file",
"from",
"a",
"base64"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/ResourceController.php#L126-L137 |
191,976 | backbee/backbee-php | Rest/Controller/ResourceController.php | ResourceController.buildData | private function buildData($originalName, $extension)
{
$tmpDirectory = $this->getApplication()->getTemporaryDir();
$fileName = md5($originalName . uniqid('', true)) . '.' . $extension;
$data = [
'originalname' => $originalName,
'path' => $tmpDirectory . DIRE... | php | private function buildData($originalName, $extension)
{
$tmpDirectory = $this->getApplication()->getTemporaryDir();
$fileName = md5($originalName . uniqid('', true)) . '.' . $extension;
$data = [
'originalname' => $originalName,
'path' => $tmpDirectory . DIRE... | [
"private",
"function",
"buildData",
"(",
"$",
"originalName",
",",
"$",
"extension",
")",
"{",
"$",
"tmpDirectory",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"getTemporaryDir",
"(",
")",
";",
"$",
"fileName",
"=",
"md5",
"(",
"$",
"origin... | Build data for retrieve into the content of response
@param String $originalName
@param String $extension
@return Array $data | [
"Build",
"data",
"for",
"retrieve",
"into",
"the",
"content",
"of",
"response"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/ResourceController.php#L146-L158 |
191,977 | backbee/backbee-php | Config/Config.php | Config.setContainer | public function setContainer(Container $container = null)
{
$this->container = $container;
$this->parameters = array();
return $this;
} | php | public function setContainer(Container $container = null)
{
$this->container = $container;
$this->parameters = array();
return $this;
} | [
"public",
"function",
"setContainer",
"(",
"Container",
"$",
"container",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"container",
"=",
"$",
"container",
";",
"$",
"this",
"->",
"parameters",
"=",
"array",
"(",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Set the service container to be able to parse parameter and service in config
Resets the compiled parameters array.
@param \BackBee\DependencyInjection\Container $container
@return \BackBee\Config\Config | [
"Set",
"the",
"service",
"container",
"to",
"be",
"able",
"to",
"parse",
"parameter",
"and",
"service",
"in",
"config",
"Resets",
"the",
"compiled",
"parameters",
"array",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L199-L205 |
191,978 | backbee/backbee-php | Config/Config.php | Config.getRawSection | public function getRawSection($section = null)
{
if (null === $section) {
return $this->raw_parameters;
} elseif (array_key_exists($section, $this->raw_parameters)) {
return $this->raw_parameters[$section];
}
return;
} | php | public function getRawSection($section = null)
{
if (null === $section) {
return $this->raw_parameters;
} elseif (array_key_exists($section, $this->raw_parameters)) {
return $this->raw_parameters[$section];
}
return;
} | [
"public",
"function",
"getRawSection",
"(",
"$",
"section",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"section",
")",
"{",
"return",
"$",
"this",
"->",
"raw_parameters",
";",
"}",
"elseif",
"(",
"array_key_exists",
"(",
"$",
"section",
",",
... | Returns, if exists, the raw parameter section, null otherwise.
@param string $section
@return mixed|null | [
"Returns",
"if",
"exists",
"the",
"raw",
"parameter",
"section",
"null",
"otherwise",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L250-L259 |
191,979 | backbee/backbee-php | Config/Config.php | Config.getSection | public function getSection($section = null)
{
if (null === $this->container) {
return $this->getRawSection($section);
}
return $this->compileParameters($section);
} | php | public function getSection($section = null)
{
if (null === $this->container) {
return $this->getRawSection($section);
}
return $this->compileParameters($section);
} | [
"public",
"function",
"getSection",
"(",
"$",
"section",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"container",
")",
"{",
"return",
"$",
"this",
"->",
"getRawSection",
"(",
"$",
"section",
")",
";",
"}",
"return",
"$",
"this... | Returns, if exists, the parameter section.
@param string $section
@return array|NULL | [
"Returns",
"if",
"exists",
"the",
"parameter",
"section",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L278-L285 |
191,980 | backbee/backbee-php | Config/Config.php | Config.sectionHasKey | public function sectionHasKey($section, $key)
{
return (isset($this->raw_parameters[$section])
&& is_array($this->raw_parameters[$section])
&& array_key_exists($key, $this->raw_parameters[$section])
);
} | php | public function sectionHasKey($section, $key)
{
return (isset($this->raw_parameters[$section])
&& is_array($this->raw_parameters[$section])
&& array_key_exists($key, $this->raw_parameters[$section])
);
} | [
"public",
"function",
"sectionHasKey",
"(",
"$",
"section",
",",
"$",
"key",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"raw_parameters",
"[",
"$",
"section",
"]",
")",
"&&",
"is_array",
"(",
"$",
"this",
"->",
"raw_parameters",
"[",
"$"... | Checks if the key exists in the parameter section.
@param string $section
@param string $key
@return boolean | [
"Checks",
"if",
"the",
"key",
"exists",
"in",
"the",
"parameter",
"section",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L361-L367 |
191,981 | backbee/backbee-php | Config/Config.php | Config.setSection | public function setSection($section, array $config, $overwrite = false)
{
if (false === $overwrite && array_key_exists($section, $this->raw_parameters)) {
$this->raw_parameters[$section] = Collection::array_merge_assoc_recursive($this->raw_parameters[$section], $config);
} else {
... | php | public function setSection($section, array $config, $overwrite = false)
{
if (false === $overwrite && array_key_exists($section, $this->raw_parameters)) {
$this->raw_parameters[$section] = Collection::array_merge_assoc_recursive($this->raw_parameters[$section], $config);
} else {
... | [
"public",
"function",
"setSection",
"(",
"$",
"section",
",",
"array",
"$",
"config",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"overwrite",
"&&",
"array_key_exists",
"(",
"$",
"section",
",",
"$",
"this",
"->",
"ra... | Sets a parameter section.
@param string $section
@param array $config
@param boolean $overwrite
@return \BackBee\Config\Config The current config object | [
"Sets",
"a",
"parameter",
"section",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L378-L391 |
191,982 | backbee/backbee-php | Config/Config.php | Config.extend | public function extend($basedir = null, $overwrite = false)
{
if (null === $basedir) {
$basedir = $this->basedir;
}
$basedir = File::realpath($basedir);
if (false === $this->loadFromCache($basedir)) {
$this->loadFromBaseDir($basedir, $overwrite);
... | php | public function extend($basedir = null, $overwrite = false)
{
if (null === $basedir) {
$basedir = $this->basedir;
}
$basedir = File::realpath($basedir);
if (false === $this->loadFromCache($basedir)) {
$this->loadFromBaseDir($basedir, $overwrite);
... | [
"public",
"function",
"extend",
"(",
"$",
"basedir",
"=",
"null",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"basedir",
")",
"{",
"$",
"basedir",
"=",
"$",
"this",
"->",
"basedir",
";",
"}",
"$",
"basedir",
"=",
... | Extends the current instance with a new base directory.
@param string $basedir Optional base directory | [
"Extends",
"the",
"current",
"instance",
"with",
"a",
"new",
"base",
"directory",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L398-L420 |
191,983 | backbee/backbee-php | Config/Config.php | Config.loadFromCache | private function loadFromCache($basedir)
{
if (true === $this->debug) {
return false;
}
if (null === $this->cache) {
return false;
}
$cached_parameters = $this->cache->load($this->getCacheId($basedir), false, $this->getCacheExpire($basedir));
... | php | private function loadFromCache($basedir)
{
if (true === $this->debug) {
return false;
}
if (null === $this->cache) {
return false;
}
$cached_parameters = $this->cache->load($this->getCacheId($basedir), false, $this->getCacheExpire($basedir));
... | [
"private",
"function",
"loadFromCache",
"(",
"$",
"basedir",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"debug",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"cache",
")",
"{",
"return",
"false",
"... | If a cache system is defined, try to load a cache for the current basedir.
@param string $basedir The base directory
@return boolean Returns TRUE if a valid cache has been found, FALSE otherwise | [
"If",
"a",
"cache",
"system",
"is",
"defined",
"try",
"to",
"load",
"a",
"cache",
"for",
"the",
"current",
"basedir",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L484-L509 |
191,984 | backbee/backbee-php | Config/Config.php | Config.saveToCache | private function saveToCache($basedir)
{
if (true === $this->debug) {
return false;
}
if (null !== $this->cache) {
return $this->cache->save($this->getCacheId($basedir), serialize($this->raw_parameters), null, null, true);
}
return false;
} | php | private function saveToCache($basedir)
{
if (true === $this->debug) {
return false;
}
if (null !== $this->cache) {
return $this->cache->save($this->getCacheId($basedir), serialize($this->raw_parameters), null, null, true);
}
return false;
} | [
"private",
"function",
"saveToCache",
"(",
"$",
"basedir",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"debug",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"cache",
")",
"{",
"return",
"$",
"this",... | Saves the parameters in cache system if defined.
@param string $basedir The base directory
@return boolean Returns TRUE if a valid cache has been saved, FALSE otherwise | [
"Saves",
"the",
"parameters",
"in",
"cache",
"system",
"if",
"defined",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L518-L529 |
191,985 | backbee/backbee-php | Config/Config.php | Config.getYmlFiles | private function getYmlFiles($basedir)
{
$ymlFiles = File::getFilesByExtension($basedir, self::EXTENSION);
$defaultFile = $basedir.DIRECTORY_SEPARATOR.self::CONFIG_FILE.'.'.self::EXTENSION;
if (is_file($defaultFile) && 1 < count($ymlFiles)) {
// Ensure that config.yml is the fi... | php | private function getYmlFiles($basedir)
{
$ymlFiles = File::getFilesByExtension($basedir, self::EXTENSION);
$defaultFile = $basedir.DIRECTORY_SEPARATOR.self::CONFIG_FILE.'.'.self::EXTENSION;
if (is_file($defaultFile) && 1 < count($ymlFiles)) {
// Ensure that config.yml is the fi... | [
"private",
"function",
"getYmlFiles",
"(",
"$",
"basedir",
")",
"{",
"$",
"ymlFiles",
"=",
"File",
"::",
"getFilesByExtension",
"(",
"$",
"basedir",
",",
"self",
"::",
"EXTENSION",
")",
";",
"$",
"defaultFile",
"=",
"$",
"basedir",
".",
"DIRECTORY_SEPARATOR"... | Returns an array of YAML files in the directory.
@param string $basedir The base directory
@return array
@throws \BackBee\Config\Exception\InvalidBaseDirException Occurs if the base directory cannont be read | [
"Returns",
"an",
"array",
"of",
"YAML",
"files",
"in",
"the",
"directory",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L578-L598 |
191,986 | backbee/backbee-php | Config/Config.php | Config.loadFromBaseDir | private function loadFromBaseDir($basedir, $overwrite = false)
{
foreach ($this->getYmlFiles($basedir) as $filename) {
$this->loadFromFile($filename, $overwrite);
}
} | php | private function loadFromBaseDir($basedir, $overwrite = false)
{
foreach ($this->getYmlFiles($basedir) as $filename) {
$this->loadFromFile($filename, $overwrite);
}
} | [
"private",
"function",
"loadFromBaseDir",
"(",
"$",
"basedir",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getYmlFiles",
"(",
"$",
"basedir",
")",
"as",
"$",
"filename",
")",
"{",
"$",
"this",
"->",
"loadFromFile",
... | Loads the config files from the base directory.
@param string $basedir The base directory
@throws \BackBee\Config\Exception\InvalidBaseDirException Occurs if the base directory can't be read | [
"Loads",
"the",
"config",
"files",
"from",
"the",
"base",
"directory",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L607-L612 |
191,987 | backbee/backbee-php | Config/Config.php | Config.loadFromFile | private function loadFromFile($filename, $overwrite = false)
{
try {
$yamlDatas = Yaml::parse(file_get_contents($filename));
if (is_array($yamlDatas)) {
if (true === $this->debug) {
$this->debug_data[$filename] = $yamlDatas;
}
... | php | private function loadFromFile($filename, $overwrite = false)
{
try {
$yamlDatas = Yaml::parse(file_get_contents($filename));
if (is_array($yamlDatas)) {
if (true === $this->debug) {
$this->debug_data[$filename] = $yamlDatas;
}
... | [
"private",
"function",
"loadFromFile",
"(",
"$",
"filename",
",",
"$",
"overwrite",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"yamlDatas",
"=",
"Yaml",
"::",
"parse",
"(",
"file_get_contents",
"(",
"$",
"filename",
")",
")",
";",
"if",
"(",
"is_array",
... | Try to parse a yaml config file.
@param string $filename
@throws \BackBee\Config\Exception\InvalidConfigException Occurs when the file can't be parsed | [
"Try",
"to",
"parse",
"a",
"yaml",
"config",
"file",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L621-L646 |
191,988 | backbee/backbee-php | Config/Config.php | Config.compileAllParameters | private function compileAllParameters()
{
foreach (array_keys($this->raw_parameters) as $section) {
$this->parameters[$section] = $this->compileParameters($section);
}
return $this->parameters;
} | php | private function compileAllParameters()
{
foreach (array_keys($this->raw_parameters) as $section) {
$this->parameters[$section] = $this->compileParameters($section);
}
return $this->parameters;
} | [
"private",
"function",
"compileAllParameters",
"(",
")",
"{",
"foreach",
"(",
"array_keys",
"(",
"$",
"this",
"->",
"raw_parameters",
")",
"as",
"$",
"section",
")",
"{",
"$",
"this",
"->",
"parameters",
"[",
"$",
"section",
"]",
"=",
"$",
"this",
"->",
... | Replace services and container parameters keys by their values for the whole config.
@return array | [
"Replace",
"services",
"and",
"container",
"parameters",
"keys",
"by",
"their",
"values",
"for",
"the",
"whole",
"config",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L653-L660 |
191,989 | backbee/backbee-php | Config/Config.php | Config.compileParameters | private function compileParameters($section = null)
{
if (null === $section) {
return $this->compileAllParameters();
}
if (!array_key_exists($section, $this->raw_parameters)) {
return;
}
if (!array_key_exists($section, $this->parameters)) {
... | php | private function compileParameters($section = null)
{
if (null === $section) {
return $this->compileAllParameters();
}
if (!array_key_exists($section, $this->raw_parameters)) {
return;
}
if (!array_key_exists($section, $this->parameters)) {
... | [
"private",
"function",
"compileParameters",
"(",
"$",
"section",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"section",
")",
"{",
"return",
"$",
"this",
"->",
"compileAllParameters",
"(",
")",
";",
"}",
"if",
"(",
"!",
"array_key_exists",
"(",
... | Replace services and container parameters keys by their values for the provided section.
@param string|null $section The selected configuration section, can be null
@return array | [
"Replace",
"services",
"and",
"container",
"parameters",
"keys",
"by",
"their",
"values",
"for",
"the",
"provided",
"section",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Config.php#L669-L690 |
191,990 | backbee/backbee-php | Security/Authentication/Provider/BBAuthenticationProvider.php | BBAuthenticationProvider.authenticate | public function authenticate(TokenInterface $token)
{
if (false === $this->supports($token)) {
throw new SecurityException('Invalid token provided', SecurityException::UNSUPPORTED_TOKEN);
}
try {
$user = $this->userProvider->loadUserByUsername($token->getUsername());... | php | public function authenticate(TokenInterface $token)
{
if (false === $this->supports($token)) {
throw new SecurityException('Invalid token provided', SecurityException::UNSUPPORTED_TOKEN);
}
try {
$user = $this->userProvider->loadUserByUsername($token->getUsername());... | [
"public",
"function",
"authenticate",
"(",
"TokenInterface",
"$",
"token",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"supports",
"(",
"$",
"token",
")",
")",
"{",
"throw",
"new",
"SecurityException",
"(",
"'Invalid token provided'",
",",
"Secur... | Attempts to authenticates a TokenInterface object.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token
@return \BackBee\Security\Token\BBUserToken
@throws \BackBee\Security\Exception\SecurityException | [
"Attempts",
"to",
"authenticates",
"a",
"TokenInterface",
"object",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/BBAuthenticationProvider.php#L112-L160 |
191,991 | backbee/backbee-php | Security/Authentication/Provider/BBAuthenticationProvider.php | BBAuthenticationProvider.clearNonce | public function clearNonce(TokenInterface $token)
{
if (true === $this->supports($token) && null !== $token->getNonce()) {
$this->removeNonce($token->getNonce());
}
} | php | public function clearNonce(TokenInterface $token)
{
if (true === $this->supports($token) && null !== $token->getNonce()) {
$this->removeNonce($token->getNonce());
}
} | [
"public",
"function",
"clearNonce",
"(",
"TokenInterface",
"$",
"token",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"this",
"->",
"supports",
"(",
"$",
"token",
")",
"&&",
"null",
"!==",
"$",
"token",
"->",
"getNonce",
"(",
")",
")",
"{",
"$",
"this",
... | Clear nonce file for the current token.
@param \Symfony\Component\Security\Core\Authentication\Token\TokenInterface $token | [
"Clear",
"nonce",
"file",
"for",
"the",
"current",
"token",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/BBAuthenticationProvider.php#L181-L186 |
191,992 | backbee/backbee-php | Security/Authentication/Provider/BBAuthenticationProvider.php | BBAuthenticationProvider.checkNonce | protected function checkNonce(BBUserToken $token, $secret)
{
$digest = $token->getDigest();
$nonce = $token->getNonce();
$created = $token->getCreated();
if (time() - strtotime($created) > 300) {
throw new SecurityException('Request expired', SecurityException::EXPIRED_T... | php | protected function checkNonce(BBUserToken $token, $secret)
{
$digest = $token->getDigest();
$nonce = $token->getNonce();
$created = $token->getCreated();
if (time() - strtotime($created) > 300) {
throw new SecurityException('Request expired', SecurityException::EXPIRED_T... | [
"protected",
"function",
"checkNonce",
"(",
"BBUserToken",
"$",
"token",
",",
"$",
"secret",
")",
"{",
"$",
"digest",
"=",
"$",
"token",
"->",
"getDigest",
"(",
")",
";",
"$",
"nonce",
"=",
"$",
"token",
"->",
"getNonce",
"(",
")",
";",
"$",
"created... | Checks for a valid nonce file according to the WSE.
@param string $digest The digest string send by the client
@param string $nonce The nonce file
@param string $created The creation date of the nonce
@param string $secret The secret (ie password) to be check
@return boolean
@throws \BackBee\Security\Exception\S... | [
"Checks",
"for",
"a",
"valid",
"nonce",
"file",
"according",
"to",
"the",
"WSE",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/BBAuthenticationProvider.php#L200-L220 |
191,993 | backbee/backbee-php | Security/Authentication/Provider/BBAuthenticationProvider.php | BBAuthenticationProvider.readNonceValue | protected function readNonceValue($nonce)
{
$value = null;
if (null === $this->registryRepository) {
if (true === is_readable($this->nonceDir.DIRECTORY_SEPARATOR.$nonce)) {
$value = file_get_contents($this->nonceDir.DIRECTORY_SEPARATOR.$nonce);
}
} el... | php | protected function readNonceValue($nonce)
{
$value = null;
if (null === $this->registryRepository) {
if (true === is_readable($this->nonceDir.DIRECTORY_SEPARATOR.$nonce)) {
$value = file_get_contents($this->nonceDir.DIRECTORY_SEPARATOR.$nonce);
}
} el... | [
"protected",
"function",
"readNonceValue",
"(",
"$",
"nonce",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"registryRepository",
")",
"{",
"if",
"(",
"true",
"===",
"is_readable",
"(",
"$",
"this",
"->",
"nonce... | Returns the nonce value if found, NULL otherwise.
@param type $nonce
@return NULL|int | [
"Returns",
"the",
"nonce",
"value",
"if",
"found",
"NULL",
"otherwise",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/BBAuthenticationProvider.php#L229-L246 |
191,994 | backbee/backbee-php | Security/Authentication/Provider/BBAuthenticationProvider.php | BBAuthenticationProvider.writeNonceValue | protected function writeNonceValue(BBUserToken $token)
{
$now = strtotime($token->getCreated());
$nonce = $token->getNonce();
$signature_generator = new RequestSignatureEncoder();
$signature = $signature_generator->createSignature($token);
if (null === $this->registryReposito... | php | protected function writeNonceValue(BBUserToken $token)
{
$now = strtotime($token->getCreated());
$nonce = $token->getNonce();
$signature_generator = new RequestSignatureEncoder();
$signature = $signature_generator->createSignature($token);
if (null === $this->registryReposito... | [
"protected",
"function",
"writeNonceValue",
"(",
"BBUserToken",
"$",
"token",
")",
"{",
"$",
"now",
"=",
"strtotime",
"(",
"$",
"token",
"->",
"getCreated",
"(",
")",
")",
";",
"$",
"nonce",
"=",
"$",
"token",
"->",
"getNonce",
"(",
")",
";",
"$",
"s... | Updates the nonce value.
@param string $nonce | [
"Updates",
"the",
"nonce",
"value",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/BBAuthenticationProvider.php#L253-L265 |
191,995 | backbee/backbee-php | Security/Authentication/Provider/BBAuthenticationProvider.php | BBAuthenticationProvider.removeNonce | protected function removeNonce($nonce)
{
if (null === $this->registryRepository) {
@unlink($this->nonceDir.DIRECTORY_SEPARATOR.$nonce);
} else {
$registry = $this->getRegistry($nonce);
$this->registryRepository->remove($registry);
}
} | php | protected function removeNonce($nonce)
{
if (null === $this->registryRepository) {
@unlink($this->nonceDir.DIRECTORY_SEPARATOR.$nonce);
} else {
$registry = $this->getRegistry($nonce);
$this->registryRepository->remove($registry);
}
} | [
"protected",
"function",
"removeNonce",
"(",
"$",
"nonce",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"registryRepository",
")",
"{",
"@",
"unlink",
"(",
"$",
"this",
"->",
"nonceDir",
".",
"DIRECTORY_SEPARATOR",
".",
"$",
"nonce",
")",
";",
... | Removes the nonce.
@param string $nonce | [
"Removes",
"the",
"nonce",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Authentication/Provider/BBAuthenticationProvider.php#L272-L280 |
191,996 | contao-bootstrap/navbar | src/Helper/AbstractItemHelper.php | AbstractItemHelper.initializeItemClasses | private function initializeItemClasses(): void
{
if ($this->item['class']) {
$classes = StringUtil::trimsplit(' ', $this->item['class']);
foreach ($classes as $class) {
$this->itemClass[] = $class;
}
if (in_array('trail', $this->itemClass)) {
... | php | private function initializeItemClasses(): void
{
if ($this->item['class']) {
$classes = StringUtil::trimsplit(' ', $this->item['class']);
foreach ($classes as $class) {
$this->itemClass[] = $class;
}
if (in_array('trail', $this->itemClass)) {
... | [
"private",
"function",
"initializeItemClasses",
"(",
")",
":",
"void",
"{",
"if",
"(",
"$",
"this",
"->",
"item",
"[",
"'class'",
"]",
")",
"{",
"$",
"classes",
"=",
"StringUtil",
"::",
"trimsplit",
"(",
"' '",
",",
"$",
"this",
"->",
"item",
"[",
"'... | Initialize the item classes.
@return void | [
"Initialize",
"the",
"item",
"classes",
"."
] | 6d6956510a3053dd438a11384f4d237644d4321e | https://github.com/contao-bootstrap/navbar/blob/6d6956510a3053dd438a11384f4d237644d4321e/src/Helper/AbstractItemHelper.php#L110-L122 |
191,997 | Fakerino/Fakerino | src/Fakerino/Fakerino.php | Fakerino.create | public static function create($conf = null)
{
self::$defaultConf = new FakerinoConf();
self::$defaultConf->loadConfiguration();
if ($conf !== null) {
$confArray = $conf;
if (!is_array($conf)) {
$confTypeFactory = new FileConfigurationLoaderFactory(
... | php | public static function create($conf = null)
{
self::$defaultConf = new FakerinoConf();
self::$defaultConf->loadConfiguration();
if ($conf !== null) {
$confArray = $conf;
if (!is_array($conf)) {
$confTypeFactory = new FileConfigurationLoaderFactory(
... | [
"public",
"static",
"function",
"create",
"(",
"$",
"conf",
"=",
"null",
")",
"{",
"self",
"::",
"$",
"defaultConf",
"=",
"new",
"FakerinoConf",
"(",
")",
";",
"self",
"::",
"$",
"defaultConf",
"->",
"loadConfiguration",
"(",
")",
";",
"if",
"(",
"$",
... | Bootstrap function for Fakerino,
setups the global configuration.
@param null|array|string $conf
@return FakeDataFactory | [
"Bootstrap",
"function",
"for",
"Fakerino",
"setups",
"the",
"global",
"configuration",
"."
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Fakerino.php#L40-L59 |
191,998 | backbee/backbee-php | Bundle/Event/BundleInstallUpdateEvent.php | BundleInstallUpdateEvent.addLog | public function addLog($key, $message)
{
if (!is_string($message)) {
throw new \InvalidArgumentException(sprintf(
'[%s]: "message" must be type of string, %s given.',
__METHOD__,
gettype($message)
));
}
if (!isset($this... | php | public function addLog($key, $message)
{
if (!is_string($message)) {
throw new \InvalidArgumentException(sprintf(
'[%s]: "message" must be type of string, %s given.',
__METHOD__,
gettype($message)
));
}
if (!isset($this... | [
"public",
"function",
"addLog",
"(",
"$",
"key",
",",
"$",
"message",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"message",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'[%s]: \"message\" must be type of string, ... | Adds new message to logs.
@param string $key
@param string $message
@return self
@throws \InvalidArgumentException if message argument is not type of string | [
"Adds",
"new",
"message",
"to",
"logs",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/Event/BundleInstallUpdateEvent.php#L87-L104 |
191,999 | backbee/backbee-php | Rest/Controller/ClassContentController.php | ClassContentController.getCategoryCollectionAction | public function getCategoryCollectionAction()
{
$application = $this->getApplication();
$cache = $application->getContainer()->get('cache.control');
$cacheId = md5('classcontent_categories_'.$application->getContext().'_'.$application->getEnvironment());
if (!$application->isDebugMo... | php | public function getCategoryCollectionAction()
{
$application = $this->getApplication();
$cache = $application->getContainer()->get('cache.control');
$cacheId = md5('classcontent_categories_'.$application->getContext().'_'.$application->getEnvironment());
if (!$application->isDebugMo... | [
"public",
"function",
"getCategoryCollectionAction",
"(",
")",
"{",
"$",
"application",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
";",
"$",
"cache",
"=",
"$",
"application",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'cache.control'",
")",
... | Returns every availables categories datas.
@return Response
@Rest\Security("is_fully_authenticated() & has_role('ROLE_API_USER')") | [
"Returns",
"every",
"availables",
"categories",
"datas",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Controller/ClassContentController.php#L90-L108 |
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.