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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
192,100 | backbee/backbee-php | Renderer/Renderer.php | Renderer.updatesAfterClone | public function updatesAfterClone()
{
$this->updateHelpers();
foreach ($this->rendererAdapters->all() as $ra) {
$ra->onNewRenderer($this);
}
return $this;
} | php | public function updatesAfterClone()
{
$this->updateHelpers();
foreach ($this->rendererAdapters->all() as $ra) {
$ra->onNewRenderer($this);
}
return $this;
} | [
"public",
"function",
"updatesAfterClone",
"(",
")",
"{",
"$",
"this",
"->",
"updateHelpers",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"rendererAdapters",
"->",
"all",
"(",
")",
"as",
"$",
"ra",
")",
"{",
"$",
"ra",
"->",
"onNewRenderer",
"(",... | Update every helpers and every registered renderer adapters with the right AbstractRenderer;
this method is called everytime we clone a renderer | [
"Update",
"every",
"helpers",
"and",
"every",
"registered",
"renderer",
"adapters",
"with",
"the",
"right",
"AbstractRenderer",
";",
"this",
"method",
"is",
"called",
"everytime",
"we",
"clone",
"a",
"renderer"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L123-L131 |
192,101 | backbee/backbee-php | Renderer/Renderer.php | Renderer.getDefaultAdapterExt | public function getDefaultAdapterExt()
{
$managedExt = $this->rendererAdapters->get($this->defaultAdapter)->getManagedFileExtensions();
return array_shift($managedExt);
} | php | public function getDefaultAdapterExt()
{
$managedExt = $this->rendererAdapters->get($this->defaultAdapter)->getManagedFileExtensions();
return array_shift($managedExt);
} | [
"public",
"function",
"getDefaultAdapterExt",
"(",
")",
"{",
"$",
"managedExt",
"=",
"$",
"this",
"->",
"rendererAdapters",
"->",
"get",
"(",
"$",
"this",
"->",
"defaultAdapter",
")",
"->",
"getManagedFileExtensions",
"(",
")",
";",
"return",
"array_shift",
"(... | Return template file extension of the default adapter.
@return String | [
"Return",
"template",
"file",
"extension",
"of",
"the",
"default",
"adapter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L190-L195 |
192,102 | backbee/backbee-php | Renderer/Renderer.php | Renderer.getResourceUrl | public function getResourceUrl($pathinfo, Site $site = null)
{
return $this->getUri($pathinfo, null, $site, RouteCollection::RESOURCE_URL);
} | php | public function getResourceUrl($pathinfo, Site $site = null)
{
return $this->getUri($pathinfo, null, $site, RouteCollection::RESOURCE_URL);
} | [
"public",
"function",
"getResourceUrl",
"(",
"$",
"pathinfo",
",",
"Site",
"$",
"site",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"getUri",
"(",
"$",
"pathinfo",
",",
"null",
",",
"$",
"site",
",",
"RouteCollection",
"::",
"RESOURCE_URL",
")",
... | Returns resource url.
@param string $pathinfo
@param BackBee\Site\Site $site
@return string resource url | [
"Returns",
"resource",
"url",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L419-L422 |
192,103 | backbee/backbee-php | Renderer/Renderer.php | Renderer.updatesAfterUnset | protected function updatesAfterUnset()
{
$this->updateHelpers();
foreach ($this->rendererAdapters->all() as $ra) {
$ra->onRestorePreviousRenderer($this);
}
return $this;
} | php | protected function updatesAfterUnset()
{
$this->updateHelpers();
foreach ($this->rendererAdapters->all() as $ra) {
$ra->onRestorePreviousRenderer($this);
}
return $this;
} | [
"protected",
"function",
"updatesAfterUnset",
"(",
")",
"{",
"$",
"this",
"->",
"updateHelpers",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"rendererAdapters",
"->",
"all",
"(",
")",
"as",
"$",
"ra",
")",
"{",
"$",
"ra",
"->",
"onRestorePreviousRe... | Update every helpers and every registered renderer adapters with the right AbstractRenderer;
this method is called everytime we unset a renderer | [
"Update",
"every",
"helpers",
"and",
"every",
"registered",
"renderer",
"adapters",
"with",
"the",
"right",
"AbstractRenderer",
";",
"this",
"method",
"is",
"called",
"everytime",
"we",
"unset",
"a",
"renderer"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L632-L640 |
192,104 | backbee/backbee-php | Renderer/Renderer.php | Renderer.autoloadAdapters | private function autoloadAdapters()
{
$rendererConfig = $this->getApplication()->getConfig()->getRendererConfig();
$adapters = (array) $rendererConfig['adapter'];
foreach ($adapters as $adapter) {
$classname = $adapter;
$adapterConfig = [];
if (is_array($a... | php | private function autoloadAdapters()
{
$rendererConfig = $this->getApplication()->getConfig()->getRendererConfig();
$adapters = (array) $rendererConfig['adapter'];
foreach ($adapters as $adapter) {
$classname = $adapter;
$adapterConfig = [];
if (is_array($a... | [
"private",
"function",
"autoloadAdapters",
"(",
")",
"{",
"$",
"rendererConfig",
"=",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"getConfig",
"(",
")",
"->",
"getRendererConfig",
"(",
")",
";",
"$",
"adapters",
"=",
"(",
"array",
")",
"$",
"ren... | Autoloads every declared renderer adapters into application config.
@return self | [
"Autoloads",
"every",
"declared",
"renderer",
"adapters",
"into",
"application",
"config",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L647-L663 |
192,105 | backbee/backbee-php | Renderer/Renderer.php | Renderer.addManagedExtensions | private function addManagedExtensions(RendererAdapterInterface $rendererAdapter)
{
$key = $this->getRendererAdapterKey($rendererAdapter);
foreach ($rendererAdapter->getManagedFileExtensions() as $ext) {
$rendererAdapters = array($key);
if ($this->manageableExt->has($ext)) {
... | php | private function addManagedExtensions(RendererAdapterInterface $rendererAdapter)
{
$key = $this->getRendererAdapterKey($rendererAdapter);
foreach ($rendererAdapter->getManagedFileExtensions() as $ext) {
$rendererAdapters = array($key);
if ($this->manageableExt->has($ext)) {
... | [
"private",
"function",
"addManagedExtensions",
"(",
"RendererAdapterInterface",
"$",
"rendererAdapter",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getRendererAdapterKey",
"(",
"$",
"rendererAdapter",
")",
";",
"foreach",
"(",
"$",
"rendererAdapter",
"->",
"get... | Extract managed extensions from rendererAdapter and store it.
@param RendererAdapterInterface $rendererAdapter | [
"Extract",
"managed",
"extensions",
"from",
"rendererAdapter",
"and",
"store",
"it",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L765-L777 |
192,106 | backbee/backbee-php | Renderer/Renderer.php | Renderer.determineWhichAdapterToUse | private function determineWhichAdapterToUse($filename = null)
{
if (null === $filename || !is_string($filename)) {
return;
}
$pieces = explode('.', $filename);
if (1 > count($pieces)) {
return;
}
$ext = '.'.$pieces[count($pieces) - 1];
... | php | private function determineWhichAdapterToUse($filename = null)
{
if (null === $filename || !is_string($filename)) {
return;
}
$pieces = explode('.', $filename);
if (1 > count($pieces)) {
return;
}
$ext = '.'.$pieces[count($pieces) - 1];
... | [
"private",
"function",
"determineWhichAdapterToUse",
"(",
"$",
"filename",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"filename",
"||",
"!",
"is_string",
"(",
"$",
"filename",
")",
")",
"{",
"return",
";",
"}",
"$",
"pieces",
"=",
"explode",
... | Returns the right adapter to use according to the filename extension.
@return RendererAdapterInterface | [
"Returns",
"the",
"right",
"adapter",
"to",
"use",
"according",
"to",
"the",
"filename",
"extension",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L804-L824 |
192,107 | backbee/backbee-php | Renderer/Renderer.php | Renderer.renderPage | private function renderPage($layoutFile = null, $params = null)
{
$this->setNode($this->getObject());
$application = $this->getApplication();
// Rendering subcontent
if (null !== $contentSet = $this->getObject()->getContentSet()) {
$bbUserToken = $application->getBBUserT... | php | private function renderPage($layoutFile = null, $params = null)
{
$this->setNode($this->getObject());
$application = $this->getApplication();
// Rendering subcontent
if (null !== $contentSet = $this->getObject()->getContentSet()) {
$bbUserToken = $application->getBBUserT... | [
"private",
"function",
"renderPage",
"(",
"$",
"layoutFile",
"=",
"null",
",",
"$",
"params",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"setNode",
"(",
"$",
"this",
"->",
"getObject",
"(",
")",
")",
";",
"$",
"application",
"=",
"$",
"this",
"->",
... | Render a page object.
@param string $layoutfile A force layout script to be rendered
@return string The rendered output
@throws RendererException | [
"Render",
"a",
"page",
"object",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L835-L881 |
192,108 | backbee/backbee-php | Renderer/Renderer.php | Renderer.setRenderParams | private function setRenderParams(AbstractRenderer $render, $params)
{
if (null !== $params) {
$params = (array) $params;
foreach ($params as $param => $value) {
$render->setParam($param, $value);
}
}
} | php | private function setRenderParams(AbstractRenderer $render, $params)
{
if (null !== $params) {
$params = (array) $params;
foreach ($params as $param => $value) {
$render->setParam($param, $value);
}
}
} | [
"private",
"function",
"setRenderParams",
"(",
"AbstractRenderer",
"$",
"render",
",",
"$",
"params",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"params",
")",
"{",
"$",
"params",
"=",
"(",
"array",
")",
"$",
"params",
";",
"foreach",
"(",
"$",
"params",... | Set parameters to a renderer object in parameter.
@param AbstractRenderer $render
@param array $params | [
"Set",
"parameters",
"to",
"a",
"renderer",
"object",
"in",
"parameter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L984-L992 |
192,109 | backbee/backbee-php | Renderer/Renderer.php | Renderer.getBBVariable | private function getBBVariable()
{
return [
'bb' => [
'debug' => $this->getApplication()->isDebugMode(),
'token' => $this->getApplication()->getBBUserToken(),
'request' => $this->getApplication()->getRequest(),
'routing... | php | private function getBBVariable()
{
return [
'bb' => [
'debug' => $this->getApplication()->isDebugMode(),
'token' => $this->getApplication()->getBBUserToken(),
'request' => $this->getApplication()->getRequest(),
'routing... | [
"private",
"function",
"getBBVariable",
"(",
")",
"{",
"return",
"[",
"'bb'",
"=>",
"[",
"'debug'",
"=>",
"$",
"this",
"->",
"getApplication",
"(",
")",
"->",
"isDebugMode",
"(",
")",
",",
"'token'",
"=>",
"$",
"this",
"->",
"getApplication",
"(",
")",
... | Returns default parameters that are availables in every templates.
@return array | [
"Returns",
"default",
"parameters",
"that",
"are",
"availables",
"in",
"every",
"templates",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Renderer.php#L1083-L1094 |
192,110 | backbee/backbee-php | ClassContent/Iconizer/PropertyIconizer.php | PropertyIconizer.parseProperty | private function parseProperty(AbstractContent $content, $property)
{
$currentContent = $content;
foreach (explode('->', $property) as $part) {
if ('@' === substr($part, 0, 1)) {
return $this->iconizeByParam($currentContent, substr($part, 1));
} elseif ($curre... | php | private function parseProperty(AbstractContent $content, $property)
{
$currentContent = $content;
foreach (explode('->', $property) as $part) {
if ('@' === substr($part, 0, 1)) {
return $this->iconizeByParam($currentContent, substr($part, 1));
} elseif ($curre... | [
"private",
"function",
"parseProperty",
"(",
"AbstractContent",
"$",
"content",
",",
"$",
"property",
")",
"{",
"$",
"currentContent",
"=",
"$",
"content",
";",
"foreach",
"(",
"explode",
"(",
"'->'",
",",
"$",
"property",
")",
"as",
"$",
"part",
")",
"{... | Parses the content property and return the icon URL if found.
@param AbstractContent $content The content.
@param string $property The property to be parsed.
@return string|null The icon URL if found, null otherwise. | [
"Parses",
"the",
"content",
"property",
"and",
"return",
"the",
"icon",
"URL",
"if",
"found",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Iconizer/PropertyIconizer.php#L78-L96 |
192,111 | backbee/backbee-php | ClassContent/Iconizer/PropertyIconizer.php | PropertyIconizer.iconizeByParam | private function iconizeByParam(AbstractContent $content, $paramName)
{
if (null === $parameter = $content->getParam($paramName)) {
return null;
}
if (empty($parameter['value'])) {
return null;
}
return $this->getUri($parameter['value']);
} | php | private function iconizeByParam(AbstractContent $content, $paramName)
{
if (null === $parameter = $content->getParam($paramName)) {
return null;
}
if (empty($parameter['value'])) {
return null;
}
return $this->getUri($parameter['value']);
} | [
"private",
"function",
"iconizeByParam",
"(",
"AbstractContent",
"$",
"content",
",",
"$",
"paramName",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"parameter",
"=",
"$",
"content",
"->",
"getParam",
"(",
"$",
"paramName",
")",
")",
"{",
"return",
"null",
"... | Returns the icon URL from the parameter value.
@param AbstractContent $content The content.
@param string $paramName The parameter name.
@return string|null The icon URL. | [
"Returns",
"the",
"icon",
"URL",
"from",
"the",
"parameter",
"value",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Iconizer/PropertyIconizer.php#L106-L117 |
192,112 | backbee/backbee-php | ClassContent/Iconizer/PropertyIconizer.php | PropertyIconizer.getUri | private function getUri($pathinfo, $urlType = RouteCollection::DEFAULT_URL)
{
return $this->routeCollection->getUri($pathinfo, null, null, $urlType);
} | php | private function getUri($pathinfo, $urlType = RouteCollection::DEFAULT_URL)
{
return $this->routeCollection->getUri($pathinfo, null, null, $urlType);
} | [
"private",
"function",
"getUri",
"(",
"$",
"pathinfo",
",",
"$",
"urlType",
"=",
"RouteCollection",
"::",
"DEFAULT_URL",
")",
"{",
"return",
"$",
"this",
"->",
"routeCollection",
"->",
"getUri",
"(",
"$",
"pathinfo",
",",
"null",
",",
"null",
",",
"$",
"... | Returns the icon URL.
@param string $pathinfo The pathinfo to treate.
@param int|null $urlType Optional, the URL prefix to use.
@return string The icon URL. | [
"Returns",
"the",
"icon",
"URL",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Iconizer/PropertyIconizer.php#L148-L151 |
192,113 | backbee/backbee-php | Profiler/DataCollector/RoutingDataCollector.php | RoutingDataCollector.collect | public function collect(Request $request, Response $response, \Exception $exception = null)
{
$collection = $this->container->get('routing');
$_routes = $collection->all();
$routes = array();
foreach ($_routes as $routeName => $route) {
$defaults = $route->getDefaults(... | php | public function collect(Request $request, Response $response, \Exception $exception = null)
{
$collection = $this->container->get('routing');
$_routes = $collection->all();
$routes = array();
foreach ($_routes as $routeName => $route) {
$defaults = $route->getDefaults(... | [
"public",
"function",
"collect",
"(",
"Request",
"$",
"request",
",",
"Response",
"$",
"response",
",",
"\\",
"Exception",
"$",
"exception",
"=",
"null",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"container",
"->",
"get",
"(",
"'routing'",
")"... | Collects the Information on the Route.
@param Request $request The Request Object
@param Response $response The Response Object
@param \Exception $exception The Exception | [
"Collects",
"the",
"Information",
"on",
"the",
"Route",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Profiler/DataCollector/RoutingDataCollector.php#L59-L114 |
192,114 | backbee/backbee-php | Security/Token/BBUserToken.php | BBUserToken.setCreated | public function setCreated($created)
{
$this->created = $created instanceof \DateTime ? $created->format('Y-m-d H:i:s') : $created;
return $this;
} | php | public function setCreated($created)
{
$this->created = $created instanceof \DateTime ? $created->format('Y-m-d H:i:s') : $created;
return $this;
} | [
"public",
"function",
"setCreated",
"(",
"$",
"created",
")",
"{",
"$",
"this",
"->",
"created",
"=",
"$",
"created",
"instanceof",
"\\",
"DateTime",
"?",
"$",
"created",
"->",
"format",
"(",
"'Y-m-d H:i:s'",
")",
":",
"$",
"created",
";",
"return",
"$",... | Sets the creation date.
@codeCoverageIgnore
@param type $created
@return self | [
"Sets",
"the",
"creation",
"date",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Token/BBUserToken.php#L139-L144 |
192,115 | backbee/backbee-php | Security/Token/BBUserToken.php | BBUserToken.isExpired | public function isExpired()
{
if (null === $this->created || 0 === $this->lifetime) {
throw new \LogicException(
'Cannot define if token is expired, created datetime or/and lifetime are missing.'
);
}
return time() > strtotime($this->created) + $this-... | php | public function isExpired()
{
if (null === $this->created || 0 === $this->lifetime) {
throw new \LogicException(
'Cannot define if token is expired, created datetime or/and lifetime are missing.'
);
}
return time() > strtotime($this->created) + $this-... | [
"public",
"function",
"isExpired",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"created",
"||",
"0",
"===",
"$",
"this",
"->",
"lifetime",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'Cannot define if token is expired, created datet... | Returns true if current token is expired by comparing current timestamp
with token created datetime and its max lifetime.
@return boolean
@throws \LogicException if token max lifetime or/and token created datetime are not setted | [
"Returns",
"true",
"if",
"current",
"token",
"is",
"expired",
"by",
"comparing",
"current",
"timestamp",
"with",
"token",
"created",
"datetime",
"and",
"its",
"max",
"lifetime",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Token/BBUserToken.php#L165-L174 |
192,116 | Fakerino/Fakerino | src/Fakerino/Configuration/ConfigurationFile/Helper/FileConfigurationLoaderFactory.php | FileConfigurationLoaderFactory.load | public function load()
{
$file = new File($this->filePath);
$fileExt = $file->getExtension();
$fileConfClass = $this->getConfigFileClass($fileExt);
if (class_exists($fileConfClass)) {
$fileConf = new $fileConfClass($file);
return $fileConf;
}
... | php | public function load()
{
$file = new File($this->filePath);
$fileExt = $file->getExtension();
$fileConfClass = $this->getConfigFileClass($fileExt);
if (class_exists($fileConfClass)) {
$fileConf = new $fileConfClass($file);
return $fileConf;
}
... | [
"public",
"function",
"load",
"(",
")",
"{",
"$",
"file",
"=",
"new",
"File",
"(",
"$",
"this",
"->",
"filePath",
")",
";",
"$",
"fileExt",
"=",
"$",
"file",
"->",
"getExtension",
"(",
")",
";",
"$",
"fileConfClass",
"=",
"$",
"this",
"->",
"getCon... | Finds and returns the file if exists
@return Fakerino\Configuration\ConfigurationInterface
@throws ConfNotSupportedException | [
"Finds",
"and",
"returns",
"the",
"file",
"if",
"exists"
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Configuration/ConfigurationFile/Helper/FileConfigurationLoaderFactory.php#L42-L54 |
192,117 | backbee/backbee-php | DependencyInjection/ContainerProxy.php | ContainerProxy.init | public function init(array $containerDump = [])
{
if (0 < count($containerDump)) {
$this->rawDefinitions = $containerDump['services'];
if (isset($containerDump['parameters'])) {
$this->getParameterBag()->add($containerDump['parameters']);
}
i... | php | public function init(array $containerDump = [])
{
if (0 < count($containerDump)) {
$this->rawDefinitions = $containerDump['services'];
if (isset($containerDump['parameters'])) {
$this->getParameterBag()->add($containerDump['parameters']);
}
i... | [
"public",
"function",
"init",
"(",
"array",
"$",
"containerDump",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"0",
"<",
"count",
"(",
"$",
"containerDump",
")",
")",
"{",
"$",
"this",
"->",
"rawDefinitions",
"=",
"$",
"containerDump",
"[",
"'services'",
"]",
... | ContainerProxy's constructor;.
@param array $containerDump the container dump from where we can restore entirely the container | [
"ContainerProxy",
"s",
"constructor",
";",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerProxy.php#L65-L92 |
192,118 | backbee/backbee-php | DependencyInjection/ContainerProxy.php | ContainerProxy.buildDefinition | private function buildDefinition(array $array)
{
$definition = null;
if (isset($array['parent'])) {
$definition = new DefinitionDecorator($array['parent']);
} else {
$definition = new Definition();
}
if (isset($array['synthetic'])) {
$defi... | php | private function buildDefinition(array $array)
{
$definition = null;
if (isset($array['parent'])) {
$definition = new DefinitionDecorator($array['parent']);
} else {
$definition = new Definition();
}
if (isset($array['synthetic'])) {
$defi... | [
"private",
"function",
"buildDefinition",
"(",
"array",
"$",
"array",
")",
"{",
"$",
"definition",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"array",
"[",
"'parent'",
"]",
")",
")",
"{",
"$",
"definition",
"=",
"new",
"DefinitionDecorator",
"(",
... | Build a definition from the definition's array provided as current method parameter.
@param array $array the raw definition's array
@return Symfony\Component\DependencyInjection\Definition the definition object | [
"Build",
"a",
"definition",
"from",
"the",
"definition",
"s",
"array",
"provided",
"as",
"current",
"method",
"parameter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerProxy.php#L210-L232 |
192,119 | backbee/backbee-php | DependencyInjection/ContainerProxy.php | ContainerProxy.setDefinitionArguments | private function setDefinitionArguments(Definition $definition, array $array)
{
if (true === array_key_exists('arguments', $array)) {
foreach ($array['arguments'] as $arg) {
$definition->addArgument($this->convertArgument($arg));
}
}
} | php | private function setDefinitionArguments(Definition $definition, array $array)
{
if (true === array_key_exists('arguments', $array)) {
foreach ($array['arguments'] as $arg) {
$definition->addArgument($this->convertArgument($arg));
}
}
} | [
"private",
"function",
"setDefinitionArguments",
"(",
"Definition",
"$",
"definition",
",",
"array",
"$",
"array",
")",
"{",
"if",
"(",
"true",
"===",
"array_key_exists",
"(",
"'arguments'",
",",
"$",
"array",
")",
")",
"{",
"foreach",
"(",
"$",
"array",
"... | Set the definition arguments into definition object if it exists.
@param Definition $definition definition object to hydrate
@param array $array raw definition datas | [
"Set",
"the",
"definition",
"arguments",
"into",
"definition",
"object",
"if",
"it",
"exists",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerProxy.php#L253-L260 |
192,120 | backbee/backbee-php | DependencyInjection/ContainerProxy.php | ContainerProxy.setDefinitionFactory | private function setDefinitionFactory(Definition $definition, array $array)
{
if (isset($array['factory'])) {
$factory = [];
foreach ($array['factory'] as $argument) {
$factory[] = $this->convertArgument($argument);
}
$definition->setFactory($... | php | private function setDefinitionFactory(Definition $definition, array $array)
{
if (isset($array['factory'])) {
$factory = [];
foreach ($array['factory'] as $argument) {
$factory[] = $this->convertArgument($argument);
}
$definition->setFactory($... | [
"private",
"function",
"setDefinitionFactory",
"(",
"Definition",
"$",
"definition",
",",
"array",
"$",
"array",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"array",
"[",
"'factory'",
"]",
")",
")",
"{",
"$",
"factory",
"=",
"[",
"]",
";",
"foreach",
"(",
... | Set the definition factory into definition object if it exists.
@param Definition $definition definition object to hydrate
@param array $array raw definition datas | [
"Set",
"the",
"definition",
"factory",
"into",
"definition",
"object",
"if",
"it",
"exists",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerProxy.php#L268-L278 |
192,121 | backbee/backbee-php | DependencyInjection/ContainerProxy.php | ContainerProxy.convertArgument | private function convertArgument($argument)
{
if (is_string($argument) && 0 < strlen($argument) && '@' === $argument[0]) {
$argument = new Reference(substr($argument, 1));
}
return $argument;
} | php | private function convertArgument($argument)
{
if (is_string($argument) && 0 < strlen($argument) && '@' === $argument[0]) {
$argument = new Reference(substr($argument, 1));
}
return $argument;
} | [
"private",
"function",
"convertArgument",
"(",
"$",
"argument",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"argument",
")",
"&&",
"0",
"<",
"strlen",
"(",
"$",
"argument",
")",
"&&",
"'@'",
"===",
"$",
"argument",
"[",
"0",
"]",
")",
"{",
"$",
"ar... | Converts a service string id into Reference if needed.
@param mixed $argument the argument we may convert
@return mixed the argument which may be converted | [
"Converts",
"a",
"service",
"string",
"id",
"into",
"Reference",
"if",
"needed",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerProxy.php#L287-L294 |
192,122 | backbee/backbee-php | DependencyInjection/ContainerProxy.php | ContainerProxy.setDefinitionTags | private function setDefinitionTags(Definition $definition, array $array)
{
if (isset($array['tags'])) {
if (!is_array($array['tags'])) {
throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s".', $id));
}
foreach ($a... | php | private function setDefinitionTags(Definition $definition, array $array)
{
if (isset($array['tags'])) {
if (!is_array($array['tags'])) {
throw new InvalidArgumentException(sprintf('Parameter "tags" must be an array for service "%s".', $id));
}
foreach ($a... | [
"private",
"function",
"setDefinitionTags",
"(",
"Definition",
"$",
"definition",
",",
"array",
"$",
"array",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"array",
"[",
"'tags'",
"]",
")",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"array",
"[",
"'ta... | Set the definition tags into definition object if it exists.
@param Definition $definition definition object to hydrate
@param array $array raw definition datas | [
"Set",
"the",
"definition",
"tags",
"into",
"definition",
"object",
"if",
"it",
"exists",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerProxy.php#L302-L333 |
192,123 | backbee/backbee-php | DependencyInjection/ContainerProxy.php | ContainerProxy.setDefinitionMethodCalls | private function setDefinitionMethodCalls(Definition $definition, array $array)
{
if (isset($array['calls'])) {
foreach ($array['calls'] as $call) {
$args = [];
if (isset($call[1])) {
foreach ($call[1] as $arg) {
$args[]... | php | private function setDefinitionMethodCalls(Definition $definition, array $array)
{
if (isset($array['calls'])) {
foreach ($array['calls'] as $call) {
$args = [];
if (isset($call[1])) {
foreach ($call[1] as $arg) {
$args[]... | [
"private",
"function",
"setDefinitionMethodCalls",
"(",
"Definition",
"$",
"definition",
",",
"array",
"$",
"array",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"array",
"[",
"'calls'",
"]",
")",
")",
"{",
"foreach",
"(",
"$",
"array",
"[",
"'calls'",
"]",
... | Set the definition method calls into definition object if it exists.
@param Definition $definition definition object to hydrate
@param array $array raw definition datas | [
"Set",
"the",
"definition",
"method",
"calls",
"into",
"definition",
"object",
"if",
"it",
"exists",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerProxy.php#L341-L355 |
192,124 | backbee/backbee-php | DependencyInjection/ContainerProxy.php | ContainerProxy.setDefinitionConfigurator | private function setDefinitionConfigurator(Definition $definition, array $array)
{
if (isset($array['configurator'])) {
$configurator = $array['configurator'];
if (is_array($configurator)) {
$configurator[0] = $this->convertArgument($configurator[0]);
}
... | php | private function setDefinitionConfigurator(Definition $definition, array $array)
{
if (isset($array['configurator'])) {
$configurator = $array['configurator'];
if (is_array($configurator)) {
$configurator[0] = $this->convertArgument($configurator[0]);
}
... | [
"private",
"function",
"setDefinitionConfigurator",
"(",
"Definition",
"$",
"definition",
",",
"array",
"$",
"array",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"array",
"[",
"'configurator'",
"]",
")",
")",
"{",
"$",
"configurator",
"=",
"$",
"array",
"[",
... | Set the definition configurator into definition object if it exists.
@param Definition $definition definition object to hydrate
@param array $array raw definition datas | [
"Set",
"the",
"definition",
"configurator",
"into",
"definition",
"object",
"if",
"it",
"exists",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/ContainerProxy.php#L363-L373 |
192,125 | backbee/backbee-php | Renderer/Helper/bundleAdminUrl.php | bundleAdminUrl.parseQueryParameters | private function parseQueryParameters($bundle, $controller, $action, $query)
{
$url = '';
if (0 !== count($query)) {
$controller = (new BundleControllerResolver($this->_renderer->getApplication()))->resolve($bundle, $controller);
$methodParameters = (new \ReflectionMethod($... | php | private function parseQueryParameters($bundle, $controller, $action, $query)
{
$url = '';
if (0 !== count($query)) {
$controller = (new BundleControllerResolver($this->_renderer->getApplication()))->resolve($bundle, $controller);
$methodParameters = (new \ReflectionMethod($... | [
"private",
"function",
"parseQueryParameters",
"(",
"$",
"bundle",
",",
"$",
"controller",
",",
"$",
"action",
",",
"$",
"query",
")",
"{",
"$",
"url",
"=",
"''",
";",
"if",
"(",
"0",
"!==",
"count",
"(",
"$",
"query",
")",
")",
"{",
"$",
"controll... | parse query parameters to build the end of the url
@param String $bundle
@param String $controller
@param String $action
@param Array $query
@return String | [
"parse",
"query",
"parameters",
"to",
"build",
"the",
"end",
"of",
"the",
"url"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Helper/bundleAdminUrl.php#L76-L107 |
192,126 | backbee/backbee-php | Renderer/Helper/bundleAdminUrl.php | bundleAdminUrl.getJsMethod | protected function getJsMethod($method)
{
$methods = [
'get' => 'read',
'post' => 'create',
'put' => 'update',
'delete' => 'delete',
];
return isset($methods[strtolower($method)]) ? $methods[strtolower($method)] : 'read';
} | php | protected function getJsMethod($method)
{
$methods = [
'get' => 'read',
'post' => 'create',
'put' => 'update',
'delete' => 'delete',
];
return isset($methods[strtolower($method)]) ? $methods[strtolower($method)] : 'read';
} | [
"protected",
"function",
"getJsMethod",
"(",
"$",
"method",
")",
"{",
"$",
"methods",
"=",
"[",
"'get'",
"=>",
"'read'",
",",
"'post'",
"=>",
"'create'",
",",
"'put'",
"=>",
"'update'",
",",
"'delete'",
"=>",
"'delete'",
",",
"]",
";",
"return",
"isset",... | Do the correspondence behind js method and http methods
@param String $method
@return String | [
"Do",
"the",
"correspondence",
"behind",
"js",
"method",
"and",
"http",
"methods"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Helper/bundleAdminUrl.php#L115-L124 |
192,127 | backbee/backbee-php | Renderer/Helper/bundleAdminUrl.php | bundleAdminUrl.checkParameters | private function checkParameters($bundle, $controller, $action)
{
$application = $this->_renderer->getApplication();
$bundleController = (new BundleControllerResolver($application))->resolve($bundle, $controller);
if (!method_exists($bundleController, $action.'Action')) {
throw... | php | private function checkParameters($bundle, $controller, $action)
{
$application = $this->_renderer->getApplication();
$bundleController = (new BundleControllerResolver($application))->resolve($bundle, $controller);
if (!method_exists($bundleController, $action.'Action')) {
throw... | [
"private",
"function",
"checkParameters",
"(",
"$",
"bundle",
",",
"$",
"controller",
",",
"$",
"action",
")",
"{",
"$",
"application",
"=",
"$",
"this",
"->",
"_renderer",
"->",
"getApplication",
"(",
")",
";",
"$",
"bundleController",
"=",
"(",
"new",
... | Check if each parameters are correctly setted
@param string $bundle bundle name
@param string $controller controller name
@param string $action action name
@throws Exception Bad configuration | [
"Check",
"if",
"each",
"parameters",
"are",
"correctly",
"setted"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Renderer/Helper/bundleAdminUrl.php#L135-L144 |
192,128 | backbee/backbee-php | Util/Transport/SFTP.php | SFTP.connect | public function connect($host = null, $port = null)
{
$this->_host = null !== $host ? $host : $this->_host;
$this->_port = null !== $port ? $port : $this->_port;
if (false === $this->_ssh_resource = ssh2_connect($this->_host, $this->_port)) {
throw new TransportException(sprintf(... | php | public function connect($host = null, $port = null)
{
$this->_host = null !== $host ? $host : $this->_host;
$this->_port = null !== $port ? $port : $this->_port;
if (false === $this->_ssh_resource = ssh2_connect($this->_host, $this->_port)) {
throw new TransportException(sprintf(... | [
"public",
"function",
"connect",
"(",
"$",
"host",
"=",
"null",
",",
"$",
"port",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_host",
"=",
"null",
"!==",
"$",
"host",
"?",
"$",
"host",
":",
"$",
"this",
"->",
"_host",
";",
"$",
"this",
"->",
"_p... | Establish a SSH connection.
@param string $host
@param int $port
@return \BackBee\Util\Transport\SFTP
@throws \BackBee\Util\Transport\Exception\TransportException Occurs if connection failed | [
"Establish",
"a",
"SSH",
"connection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Transport/SFTP.php#L102-L111 |
192,129 | backbee/backbee-php | Util/Transport/SFTP.php | SFTP.login | public function login($username = null, $password = null)
{
$this->_username = null !== $username ? $username : $this->_username;
$this->_password = null !== $password ? $password : $this->_password;
if (null === $this->_ssh_resource) {
throw new TransportException(sprintf('None... | php | public function login($username = null, $password = null)
{
$this->_username = null !== $username ? $username : $this->_username;
$this->_password = null !== $password ? $password : $this->_password;
if (null === $this->_ssh_resource) {
throw new TransportException(sprintf('None... | [
"public",
"function",
"login",
"(",
"$",
"username",
"=",
"null",
",",
"$",
"password",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_username",
"=",
"null",
"!==",
"$",
"username",
"?",
"$",
"username",
":",
"$",
"this",
"->",
"_username",
";",
"$",
... | Authenticate on remote server.
@param string $username
@param string $password
@return \BackBee\Util\Transport\SFTP
@throws \BackBee\Util\Transport\Exception\TransportException Occures if authentication failed | [
"Authenticate",
"on",
"remote",
"server",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Transport/SFTP.php#L123-L147 |
192,130 | backbee/backbee-php | Util/Transport/SFTP.php | SFTP.disconnect | public function disconnect()
{
if (null !== $this->_ssh_resource) {
$this->exec('echo "EXITING" && exit;');
$this->_ssh_resource = null;
$this->_sftp_resource = null;
}
return $this;
} | php | public function disconnect()
{
if (null !== $this->_ssh_resource) {
$this->exec('echo "EXITING" && exit;');
$this->_ssh_resource = null;
$this->_sftp_resource = null;
}
return $this;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"_ssh_resource",
")",
"{",
"$",
"this",
"->",
"exec",
"(",
"'echo \"EXITING\" && exit;'",
")",
";",
"$",
"this",
"->",
"_ssh_resource",
"=",
"null",
";",
"$",... | Disconnect from the remote server and unset resources.
@return \BackBee\Util\Transport\SFTP | [
"Disconnect",
"from",
"the",
"remote",
"server",
"and",
"unset",
"resources",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Transport/SFTP.php#L418-L427 |
192,131 | backbee/backbee-php | Util/Transport/SFTP.php | SFTP.exec | private function exec($command)
{
if (null === $this->_ssh_resource) {
throw new TransportException(sprintf('None SSH connection available.'));
}
if (false === $stream = ssh2_exec($this->_ssh_resource, $command)) {
throw new TransportException(sprintf('SSH command `%... | php | private function exec($command)
{
if (null === $this->_ssh_resource) {
throw new TransportException(sprintf('None SSH connection available.'));
}
if (false === $stream = ssh2_exec($this->_ssh_resource, $command)) {
throw new TransportException(sprintf('SSH command `%... | [
"private",
"function",
"exec",
"(",
"$",
"command",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_ssh_resource",
")",
"{",
"throw",
"new",
"TransportException",
"(",
"sprintf",
"(",
"'None SSH connection available.'",
")",
")",
";",
"}",
"if",
"... | Executes a command on remote server.
@param string $command
@return string
@throws \BackBee\Util\Transport\Exception\TransportException Occures if SSH connection is invalid | [
"Executes",
"a",
"command",
"on",
"remote",
"server",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Transport/SFTP.php#L438-L456 |
192,132 | backbee/backbee-php | Event/Dispatcher.php | Dispatcher.addListeners | public function addListeners(array $events_config)
{
foreach ($events_config as $name => $listeners) {
if (false === array_key_exists('listeners', $listeners)) {
$this->application->warning("None listener found for `$name` event.");
continue;
}
... | php | public function addListeners(array $events_config)
{
foreach ($events_config as $name => $listeners) {
if (false === array_key_exists('listeners', $listeners)) {
$this->application->warning("None listener found for `$name` event.");
continue;
}
... | [
"public",
"function",
"addListeners",
"(",
"array",
"$",
"events_config",
")",
"{",
"foreach",
"(",
"$",
"events_config",
"as",
"$",
"name",
"=>",
"$",
"listeners",
")",
"{",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"'listeners'",
",",
"$",
"lis... | Add listener to events.
@param array $events_config | [
"Add",
"listener",
"to",
"events",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Event/Dispatcher.php#L114-L127 |
192,133 | backbee/backbee-php | Event/Dispatcher.php | Dispatcher.getEventNamePrefix | public function getEventNamePrefix($entity)
{
if (is_object($entity)) {
$eventPrefix = strtolower(str_replace(NAMESPACE_SEPARATOR, '.', get_class($entity)).'.');
} else {
$eventPrefix = strtolower(str_replace(NAMESPACE_SEPARATOR, '.', $entity).'.');
}
if ($ent... | php | public function getEventNamePrefix($entity)
{
if (is_object($entity)) {
$eventPrefix = strtolower(str_replace(NAMESPACE_SEPARATOR, '.', get_class($entity)).'.');
} else {
$eventPrefix = strtolower(str_replace(NAMESPACE_SEPARATOR, '.', $entity).'.');
}
if ($ent... | [
"public",
"function",
"getEventNamePrefix",
"(",
"$",
"entity",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"entity",
")",
")",
"{",
"$",
"eventPrefix",
"=",
"strtolower",
"(",
"str_replace",
"(",
"NAMESPACE_SEPARATOR",
",",
"'.'",
",",
"get_class",
"(",
"... | return the normalize prefix of the eventname depending on classname.
@param Object $entity
@return string | [
"return",
"the",
"normalize",
"prefix",
"of",
"the",
"eventname",
"depending",
"on",
"classname",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Event/Dispatcher.php#L204-L221 |
192,134 | backbee/backbee-php | Event/Dispatcher.php | Dispatcher.formatEventName | private function formatEventName($event_name, $entity)
{
if (is_object($entity)) {
$event_name = strtolower(str_replace(NAMESPACE_SEPARATOR, '.', get_class($entity)).'.'.$event_name);
if ($entity instanceof \Doctrine\ORM\Proxy\Proxy) {
$prefix = str_replace(
... | php | private function formatEventName($event_name, $entity)
{
if (is_object($entity)) {
$event_name = strtolower(str_replace(NAMESPACE_SEPARATOR, '.', get_class($entity)).'.'.$event_name);
if ($entity instanceof \Doctrine\ORM\Proxy\Proxy) {
$prefix = str_replace(
... | [
"private",
"function",
"formatEventName",
"(",
"$",
"event_name",
",",
"$",
"entity",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"entity",
")",
")",
"{",
"$",
"event_name",
"=",
"strtolower",
"(",
"str_replace",
"(",
"NAMESPACE_SEPARATOR",
",",
"'.'",
","... | Format the name of an event.
@param string $event_name
@param object $entity
@return string the formated event name | [
"Format",
"the",
"name",
"of",
"an",
"event",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Event/Dispatcher.php#L326-L348 |
192,135 | backbee/backbee-php | DependencyInjection/Listener/ContainerListener.php | ContainerListener.onApplicationInit | public static function onApplicationInit(Event $event)
{
$application = $event->getTarget();
$container = $application->getContainer();
if (false === $application->isDebugMode() && false === $container->isRestored()) {
$containerFilename = $container->getParameter('container.fil... | php | public static function onApplicationInit(Event $event)
{
$application = $event->getTarget();
$container = $application->getContainer();
if (false === $application->isDebugMode() && false === $container->isRestored()) {
$containerFilename = $container->getParameter('container.fil... | [
"public",
"static",
"function",
"onApplicationInit",
"(",
"Event",
"$",
"event",
")",
"{",
"$",
"application",
"=",
"$",
"event",
"->",
"getTarget",
"(",
")",
";",
"$",
"container",
"=",
"$",
"application",
"->",
"getContainer",
"(",
")",
";",
"if",
"(",... | Occurs on event ``bbapplication.init`` to dump application container if debug mode is false.
@param Event $event | [
"Occurs",
"on",
"event",
"bbapplication",
".",
"init",
"to",
"dump",
"application",
"container",
"if",
"debug",
"mode",
"is",
"false",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/Listener/ContainerListener.php#L47-L84 |
192,136 | backbee/backbee-php | ClassContent/Repository/Element/ImageRepository.php | ImageRepository.updateFile | public function updateFile(AbstractClassContent $file, $newfilename, $originalname = null, $src = null)
{
if (false === ($file instanceof Image)) {
throw new \BackBee\ClassContent\Exception\ClassContentException('Invalid content type');
}
if (false === $newfilename = parent::upd... | php | public function updateFile(AbstractClassContent $file, $newfilename, $originalname = null, $src = null)
{
if (false === ($file instanceof Image)) {
throw new \BackBee\ClassContent\Exception\ClassContentException('Invalid content type');
}
if (false === $newfilename = parent::upd... | [
"public",
"function",
"updateFile",
"(",
"AbstractClassContent",
"$",
"file",
",",
"$",
"newfilename",
",",
"$",
"originalname",
"=",
"null",
",",
"$",
"src",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"(",
"$",
"file",
"instanceof",
"Image",
")",... | Move an uploaded file to the temporary directory and update image content.
@param \BackBee\ClassContent\AbstractClassContent $file
@param string $newfilename
@param string $originalname
@param string ... | [
"Move",
"an",
"uploaded",
"file",
"to",
"the",
"temporary",
"directory",
"and",
"update",
"image",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/Element/ImageRepository.php#L50-L61 |
192,137 | backbee/backbee-php | Stream/ClassWrapper/AbstractClassWrapper.php | AbstractClassWrapper._buildClass | protected function _buildClass()
{
$defineData = $this->_extractData($this->elements);
$defineParam = $this->parameters;
$defineProps = $this->properties;
$docBlock = '';
foreach ($defineData as $key => $element) {
$type = $element['type'];
if ('scal... | php | protected function _buildClass()
{
$defineData = $this->_extractData($this->elements);
$defineParam = $this->parameters;
$defineProps = $this->properties;
$docBlock = '';
foreach ($defineData as $key => $element) {
$type = $element['type'];
if ('scal... | [
"protected",
"function",
"_buildClass",
"(",
")",
"{",
"$",
"defineData",
"=",
"$",
"this",
"->",
"_extractData",
"(",
"$",
"this",
"->",
"elements",
")",
";",
"$",
"defineParam",
"=",
"$",
"this",
"->",
"parameters",
";",
"$",
"defineProps",
"=",
"$",
... | Build the php code corresponding to the loading class.
@return string The generated php code | [
"Build",
"the",
"php",
"code",
"corresponding",
"to",
"the",
"loading",
"class",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Stream/ClassWrapper/AbstractClassWrapper.php#L209-L257 |
192,138 | backbee/backbee-php | Stream/ClassWrapper/AbstractClassWrapper.php | AbstractClassWrapper._normalizeVar | protected function _normalizeVar($var, $includeSeparator = false)
{
if ($includeSeparator) {
$var = explode(NAMESPACE_SEPARATOR, $var);
}
$vars = (array) $var;
$pattern = "/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/";
foreach ($vars as $var) {
if ($v... | php | protected function _normalizeVar($var, $includeSeparator = false)
{
if ($includeSeparator) {
$var = explode(NAMESPACE_SEPARATOR, $var);
}
$vars = (array) $var;
$pattern = "/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/";
foreach ($vars as $var) {
if ($v... | [
"protected",
"function",
"_normalizeVar",
"(",
"$",
"var",
",",
"$",
"includeSeparator",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"includeSeparator",
")",
"{",
"$",
"var",
"=",
"explode",
"(",
"NAMESPACE_SEPARATOR",
",",
"$",
"var",
")",
";",
"}",
"$",
... | Checks for a normalize var name.
@param string $var The var name to check
@throws ClassWrapperException Occurs for a syntax error | [
"Checks",
"for",
"a",
"normalize",
"var",
"name",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Stream/ClassWrapper/AbstractClassWrapper.php#L266-L283 |
192,139 | backbee/backbee-php | NestedNode/Repository/MediaFolderRepository.php | MediaFolderRepository.getMediaFolderByLevels | public function getMediaFolderByLevels($levels)
{
$qb = $this->createQueryBuilder('mf')
->andWhere('mf._level IN (:levels)')
->setParameter('levels', $levels)
->orderBy('mf._leftnode', 'asc');
return $qb->getQuery()->getResult();
} | php | public function getMediaFolderByLevels($levels)
{
$qb = $this->createQueryBuilder('mf')
->andWhere('mf._level IN (:levels)')
->setParameter('levels', $levels)
->orderBy('mf._leftnode', 'asc');
return $qb->getQuery()->getResult();
} | [
"public",
"function",
"getMediaFolderByLevels",
"(",
"$",
"levels",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'mf'",
")",
"->",
"andWhere",
"(",
"'mf._level IN (:levels)'",
")",
"->",
"setParameter",
"(",
"'levels'",
",",
"$",
... | Get media folder by levels.
@param $levels
@return array | [
"Get",
"media",
"folder",
"by",
"levels",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/MediaFolderRepository.php#L87-L95 |
192,140 | EloGank/lol-replay-downloader | examples/download-decode-and-parse-replay.php | MyReplayDownloader.onReplayFileDecrypted | protected function onReplayFileDecrypted(ReplayInterface $replay, $fileType, $fileId, $binary)
{
if (ReplayDownloader::FILETYPE_KEYFRAME == $fileType) {
echo PHP_EOL; // formatting, don't care
// Work with hex, easier
$hex = strtoupper(bin2hex($binary));
// S... | php | protected function onReplayFileDecrypted(ReplayInterface $replay, $fileType, $fileId, $binary)
{
if (ReplayDownloader::FILETYPE_KEYFRAME == $fileType) {
echo PHP_EOL; // formatting, don't care
// Work with hex, easier
$hex = strtoupper(bin2hex($binary));
// S... | [
"protected",
"function",
"onReplayFileDecrypted",
"(",
"ReplayInterface",
"$",
"replay",
",",
"$",
"fileType",
",",
"$",
"fileId",
",",
"$",
"binary",
")",
"{",
"if",
"(",
"ReplayDownloader",
"::",
"FILETYPE_KEYFRAME",
"==",
"$",
"fileType",
")",
"{",
"echo",
... | This method counts how many turrets were destroyed by a team
@param ReplayInterface $replay
@param string $fileType
@param int $fileId
@param string $binary
@return bool | [
"This",
"method",
"counts",
"how",
"many",
"turrets",
"were",
"destroyed",
"by",
"a",
"team"
] | f5e61deb331ac5a863dcb69af115aba75611bc0e | https://github.com/EloGank/lol-replay-downloader/blob/f5e61deb331ac5a863dcb69af115aba75611bc0e/examples/download-decode-and-parse-replay.php#L66-L123 |
192,141 | backbee/backbee-php | Console/Command/UpgradeToShortClassnameCommand.php | UpgradeToShortClassnameCommand.updateContentTable | private function updateContentTable()
{
$metadata = $this->em->getClassMetadata('BackBee\ClassContent\AbstractClassContent');
$table = $metadata->getTableName();
$field = $metadata->discriminatorColumn['name'];
return $this->executeUpdate($table, $field);
} | php | private function updateContentTable()
{
$metadata = $this->em->getClassMetadata('BackBee\ClassContent\AbstractClassContent');
$table = $metadata->getTableName();
$field = $metadata->discriminatorColumn['name'];
return $this->executeUpdate($table, $field);
} | [
"private",
"function",
"updateContentTable",
"(",
")",
"{",
"$",
"metadata",
"=",
"$",
"this",
"->",
"em",
"->",
"getClassMetadata",
"(",
"'BackBee\\ClassContent\\AbstractClassContent'",
")",
";",
"$",
"table",
"=",
"$",
"metadata",
"->",
"getTableName",
"(",
")... | Updates the `content` table.
@return UpgradeToShortClassnameCommand | [
"Updates",
"the",
"content",
"table",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToShortClassnameCommand.php#L98-L105 |
192,142 | backbee/backbee-php | Console/Command/UpgradeToShortClassnameCommand.php | UpgradeToShortClassnameCommand.updateRevisionTable | private function updateRevisionTable()
{
$metadata = $this->em->getClassMetadata('BackBee\ClassContent\Revision');
$table = $metadata->getTableName();
$field = $metadata->getColumnName('_classname');
return $this->executeUpdate($table, $field);
} | php | private function updateRevisionTable()
{
$metadata = $this->em->getClassMetadata('BackBee\ClassContent\Revision');
$table = $metadata->getTableName();
$field = $metadata->getColumnName('_classname');
return $this->executeUpdate($table, $field);
} | [
"private",
"function",
"updateRevisionTable",
"(",
")",
"{",
"$",
"metadata",
"=",
"$",
"this",
"->",
"em",
"->",
"getClassMetadata",
"(",
"'BackBee\\ClassContent\\Revision'",
")",
";",
"$",
"table",
"=",
"$",
"metadata",
"->",
"getTableName",
"(",
")",
";",
... | Updates the `revision` table.
@return UpgradeToShortClassnameCommand | [
"Updates",
"the",
"revision",
"table",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToShortClassnameCommand.php#L112-L119 |
192,143 | backbee/backbee-php | Console/Command/UpgradeToShortClassnameCommand.php | UpgradeToShortClassnameCommand.executeUpdate | private function executeUpdate($table, $field)
{
$result = $this->em->getConnection()->executeUpdate($this->getReplaceQuery($table, $field));
$this->output->writeln(sprintf(' - %d rows updated in `%s`.', $result, $table));
return $this;
} | php | private function executeUpdate($table, $field)
{
$result = $this->em->getConnection()->executeUpdate($this->getReplaceQuery($table, $field));
$this->output->writeln(sprintf(' - %d rows updated in `%s`.', $result, $table));
return $this;
} | [
"private",
"function",
"executeUpdate",
"(",
"$",
"table",
",",
"$",
"field",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"em",
"->",
"getConnection",
"(",
")",
"->",
"executeUpdate",
"(",
"$",
"this",
"->",
"getReplaceQuery",
"(",
"$",
"table",
"... | Executes an update query and output the number of affected rows.
@param string $table The table to update
@param string $field The field to update
@return UpgradeToShortClassnameCommand | [
"Executes",
"an",
"update",
"query",
"and",
"output",
"the",
"number",
"of",
"affected",
"rows",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToShortClassnameCommand.php#L143-L149 |
192,144 | backbee/backbee-php | Rest/Mapping/ActionMetadata.php | ActionMetadata.serialize | public function serialize()
{
return \serialize([
$this->class,
$this->name,
$this->queryParams,
$this->requestParams,
$this->default_start,
$this->default_count,
$this->max_count,
$this->min_count,
$... | php | public function serialize()
{
return \serialize([
$this->class,
$this->name,
$this->queryParams,
$this->requestParams,
$this->default_start,
$this->default_count,
$this->max_count,
$this->min_count,
$... | [
"public",
"function",
"serialize",
"(",
")",
"{",
"return",
"\\",
"serialize",
"(",
"[",
"$",
"this",
"->",
"class",
",",
"$",
"this",
"->",
"name",
",",
"$",
"this",
"->",
"queryParams",
",",
"$",
"this",
"->",
"requestParams",
",",
"$",
"this",
"->... | serialize current object.
@return string | [
"serialize",
"current",
"object",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Rest/Mapping/ActionMetadata.php#L85-L99 |
192,145 | backbee/backbee-php | Workflow/State.php | State.getListenerInstance | public function getListenerInstance()
{
if (null !== $this->_listener && null === $this->listenerInstance) {
$this->listenerInstance = new $this->_listener();
}
return $this->listenerInstance;
} | php | public function getListenerInstance()
{
if (null !== $this->_listener && null === $this->listenerInstance) {
$this->listenerInstance = new $this->_listener();
}
return $this->listenerInstance;
} | [
"public",
"function",
"getListenerInstance",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"_listener",
"&&",
"null",
"===",
"$",
"this",
"->",
"listenerInstance",
")",
"{",
"$",
"this",
"->",
"listenerInstance",
"=",
"new",
"$",
"this",
"-... | Creates an instance of the listener based on the provided namespace and return it or null
if listener namespace is not setted.
@return null|ListenerInterface | [
"Creates",
"an",
"instance",
"of",
"the",
"listener",
"based",
"on",
"the",
"provided",
"namespace",
"and",
"return",
"it",
"or",
"null",
"if",
"listener",
"namespace",
"is",
"not",
"setted",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Workflow/State.php#L209-L216 |
192,146 | backbee/backbee-php | Workflow/State.php | State.setListener | public function setListener($listener = null)
{
if (null !== $listener && !is_object($listener) && !is_string($listener)) {
throw new \InvalidArgumentException(sprintf(
'Workflow state listener must be type of null, object or string, %s given.',
gettype($listener)... | php | public function setListener($listener = null)
{
if (null !== $listener && !is_object($listener) && !is_string($listener)) {
throw new \InvalidArgumentException(sprintf(
'Workflow state listener must be type of null, object or string, %s given.',
gettype($listener)... | [
"public",
"function",
"setListener",
"(",
"$",
"listener",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"listener",
"&&",
"!",
"is_object",
"(",
"$",
"listener",
")",
"&&",
"!",
"is_string",
"(",
"$",
"listener",
")",
")",
"{",
"throw",
"new... | Sets the optional listener classname.
@param mixed $listener The listener; it must implement BackBee\Workflow\ListenerInterface
@return self
@throws \InvalidArgumentException if provided listener is not type of null, object or string
@throws \LogicException if provided listener does not implement BackBee\Workflow\List... | [
"Sets",
"the",
"optional",
"listener",
"classname",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Workflow/State.php#L255-L275 |
192,147 | backbee/backbee-php | Security/User.php | User.serialize | public function serialize()
{
$serialized = new \stdClass();
$serialized->username = $this->_login;
$serialized->commonname = trim($this->_firstname . ' ' . $this->_lastname);
return json_encode($serialized);
} | php | public function serialize()
{
$serialized = new \stdClass();
$serialized->username = $this->_login;
$serialized->commonname = trim($this->_firstname . ' ' . $this->_lastname);
return json_encode($serialized);
} | [
"public",
"function",
"serialize",
"(",
")",
"{",
"$",
"serialized",
"=",
"new",
"\\",
"stdClass",
"(",
")",
";",
"$",
"serialized",
"->",
"username",
"=",
"$",
"this",
"->",
"_login",
";",
"$",
"serialized",
"->",
"commonname",
"=",
"trim",
"(",
"$",
... | Serialize the user object.
@return Json_object | [
"Serialize",
"the",
"user",
"object",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/User.php#L268-L275 |
192,148 | backbee/backbee-php | Security/User.php | User.generateApiPublicKey | private function generateApiPublicKey()
{
if (null === $this->_api_key_private) {
return $this->generateRandomApiKey()->getApiKeyPublic();
}
return sha1($this->_created->format(\DateTime::ATOM) . $this->_api_key_private);
} | php | private function generateApiPublicKey()
{
if (null === $this->_api_key_private) {
return $this->generateRandomApiKey()->getApiKeyPublic();
}
return sha1($this->_created->format(\DateTime::ATOM) . $this->_api_key_private);
} | [
"private",
"function",
"generateApiPublicKey",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_api_key_private",
")",
"{",
"return",
"$",
"this",
"->",
"generateRandomApiKey",
"(",
")",
"->",
"getApiKeyPublic",
"(",
")",
";",
"}",
"return",
"... | Generate an REST api public key based on the private key
@return String Rest api public key | [
"Generate",
"an",
"REST",
"api",
"public",
"key",
"based",
"on",
"the",
"private",
"key"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/User.php#L613-L620 |
192,149 | backbee/backbee-php | Security/User.php | User.generateRandomApiKey | public function generateRandomApiKey()
{
$this->_api_key_private = md5($this->_id . uniqid());
$this->_api_key_public = $this->generateApiPublicKey();
return $this;
} | php | public function generateRandomApiKey()
{
$this->_api_key_private = md5($this->_id . uniqid());
$this->_api_key_public = $this->generateApiPublicKey();
return $this;
} | [
"public",
"function",
"generateRandomApiKey",
"(",
")",
"{",
"$",
"this",
"->",
"_api_key_private",
"=",
"md5",
"(",
"$",
"this",
"->",
"_id",
".",
"uniqid",
"(",
")",
")",
";",
"$",
"this",
"->",
"_api_key_public",
"=",
"$",
"this",
"->",
"generateApiPu... | Generate a random Api pulbic and private key
@return void | [
"Generate",
"a",
"random",
"Api",
"pulbic",
"and",
"private",
"key"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/User.php#L626-L633 |
192,150 | backbee/backbee-php | Routing/Route.php | Route._addHeaderRequirements | private function _addHeaderRequirements()
{
$this->_headerRequirements = array();
foreach ($this->getRequirements() as $key => $value) {
if (0 === strpos($key, 'HTTP-')) {
$this->_headerRequirements[substr($key, 5)] = $value;
}
}
return $this;... | php | private function _addHeaderRequirements()
{
$this->_headerRequirements = array();
foreach ($this->getRequirements() as $key => $value) {
if (0 === strpos($key, 'HTTP-')) {
$this->_headerRequirements[substr($key, 5)] = $value;
}
}
return $this;... | [
"private",
"function",
"_addHeaderRequirements",
"(",
")",
"{",
"$",
"this",
"->",
"_headerRequirements",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getRequirements",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
... | Extract header requirements.
@return Route The current Route instance | [
"Extract",
"header",
"requirements",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/Route.php#L66-L76 |
192,151 | backbee/backbee-php | Routing/Route.php | Route.getRequirements | public function getRequirements($startingWith = null)
{
if (null === $startingWith) {
return parent::getRequirements();
}
return ('HTTP-' == $startingWith) ? $this->_headerRequirements : array();
} | php | public function getRequirements($startingWith = null)
{
if (null === $startingWith) {
return parent::getRequirements();
}
return ('HTTP-' == $startingWith) ? $this->_headerRequirements : array();
} | [
"public",
"function",
"getRequirements",
"(",
"$",
"startingWith",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"startingWith",
")",
"{",
"return",
"parent",
"::",
"getRequirements",
"(",
")",
";",
"}",
"return",
"(",
"'HTTP-'",
"==",
"$",
"star... | Returns the requirements.
@return array The requirements | [
"Returns",
"the",
"requirements",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/Route.php#L100-L107 |
192,152 | backbee/backbee-php | Routing/Matcher/RequestMatcher.php | RequestMatcher.matchHeaders | public function matchHeaders($attributes)
{
$attributes = (array) $attributes;
foreach ($attributes as $key => $regexp) {
$this->matchHeader($key, $regexp);
}
} | php | public function matchHeaders($attributes)
{
$attributes = (array) $attributes;
foreach ($attributes as $key => $regexp) {
$this->matchHeader($key, $regexp);
}
} | [
"public",
"function",
"matchHeaders",
"(",
"$",
"attributes",
")",
"{",
"$",
"attributes",
"=",
"(",
"array",
")",
"$",
"attributes",
";",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"regexp",
")",
"{",
"$",
"this",
"->",
"matchHead... | Adds checks for header attributes.
@param array the header attributes to check array(attribute1 => regexp1, ettribute2 => regexp2, ...) | [
"Adds",
"checks",
"for",
"header",
"attributes",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/Matcher/RequestMatcher.php#L66-L72 |
192,153 | backbee/backbee-php | BBApplication.php | BBApplication.getBundles | public function getBundles()
{
$bundles = [];
foreach ($this->getContainer()->findTaggedServiceIds('bundle') as $id => $datas) {
$bundles[] = $this->getContainer()->get($id);
}
return $bundles;
} | php | public function getBundles()
{
$bundles = [];
foreach ($this->getContainer()->findTaggedServiceIds('bundle') as $id => $datas) {
$bundles[] = $this->getContainer()->get($id);
}
return $bundles;
} | [
"public",
"function",
"getBundles",
"(",
")",
"{",
"$",
"bundles",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"findTaggedServiceIds",
"(",
"'bundle'",
")",
"as",
"$",
"id",
"=>",
"$",
"datas",
")",
"{",
"$"... | returns every registered bundles.
@return array | [
"returns",
"every",
"registered",
"bundles",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L273-L281 |
192,154 | backbee/backbee-php | BBApplication.php | BBApplication.stop | public function stop()
{
if ($this->isStarted()) {
// trigger bbapplication.stop
$this->getEventDispatcher()->dispatch('bbapplication.stop', new Event($this));
$this->info('BackBee application ended');
}
} | php | public function stop()
{
if ($this->isStarted()) {
// trigger bbapplication.stop
$this->getEventDispatcher()->dispatch('bbapplication.stop', new Event($this));
$this->info('BackBee application ended');
}
} | [
"public",
"function",
"stop",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isStarted",
"(",
")",
")",
"{",
"// trigger bbapplication.stop",
"$",
"this",
"->",
"getEventDispatcher",
"(",
")",
"->",
"dispatch",
"(",
"'bbapplication.stop'",
",",
"new",
"Event"... | Stop the current BBApplication instance. | [
"Stop",
"the",
"current",
"BBApplication",
"instance",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L317-L324 |
192,155 | backbee/backbee-php | BBApplication.php | BBApplication.getCacheProvider | public function getCacheProvider()
{
$conf = $this->getConfig()->getCacheConfig();
return isset($conf['provider']) && is_subclass_of($conf['provider'], '\BackBee\Cache\AExtendedCache')
? $conf['provider']
: '\BackBee\Cache\DAO\Cache'
;
} | php | public function getCacheProvider()
{
$conf = $this->getConfig()->getCacheConfig();
return isset($conf['provider']) && is_subclass_of($conf['provider'], '\BackBee\Cache\AExtendedCache')
? $conf['provider']
: '\BackBee\Cache\DAO\Cache'
;
} | [
"public",
"function",
"getCacheProvider",
"(",
")",
"{",
"$",
"conf",
"=",
"$",
"this",
"->",
"getConfig",
"(",
")",
"->",
"getCacheConfig",
"(",
")",
";",
"return",
"isset",
"(",
"$",
"conf",
"[",
"'provider'",
"]",
")",
"&&",
"is_subclass_of",
"(",
"... | Get cache provider from config.
@return string Cache provider config name or \BackBee\Cache\DAO\Cache if not found | [
"Get",
"cache",
"provider",
"from",
"config",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L431-L439 |
192,156 | backbee/backbee-php | BBApplication.php | BBApplication.getRepository | public function getRepository()
{
if (null === $this->repository) {
$this->repository = $this->getBaseRepository();
if ($this->hasContext()) {
$this->repository .= DIRECTORY_SEPARATOR.$this->context;
}
}
return $this->repository;
} | php | public function getRepository()
{
if (null === $this->repository) {
$this->repository = $this->getBaseRepository();
if ($this->hasContext()) {
$this->repository .= DIRECTORY_SEPARATOR.$this->context;
}
}
return $this->repository;
} | [
"public",
"function",
"getRepository",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"repository",
")",
"{",
"$",
"this",
"->",
"repository",
"=",
"$",
"this",
"->",
"getBaseRepository",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"has... | get current repository directory path
@return string | [
"get",
"current",
"repository",
"directory",
"path"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L580-L590 |
192,157 | backbee/backbee-php | BBApplication.php | BBApplication.getBaseRepository | public function getBaseRepository()
{
if (null === $this->baseRepository) {
$this->baseRepository = $this->getBaseDir().DIRECTORY_SEPARATOR.'repository';
}
return $this->baseRepository;
} | php | public function getBaseRepository()
{
if (null === $this->baseRepository) {
$this->baseRepository = $this->getBaseDir().DIRECTORY_SEPARATOR.'repository';
}
return $this->baseRepository;
} | [
"public",
"function",
"getBaseRepository",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"baseRepository",
")",
"{",
"$",
"this",
"->",
"baseRepository",
"=",
"$",
"this",
"->",
"getBaseDir",
"(",
")",
".",
"DIRECTORY_SEPARATOR",
".",
"'repos... | get default repository directory path
@return string | [
"get",
"default",
"repository",
"directory",
"path"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L597-L604 |
192,158 | backbee/backbee-php | BBApplication.php | BBApplication.getClassContentDir | public function getClassContentDir()
{
if (null === $this->classcontentDir) {
$this->classcontentDir = [];
array_unshift($this->classcontentDir, $this->getBBDir().'/ClassContent');
array_unshift($this->classcontentDir, $this->getBaseRepository().'/ClassContent');
... | php | public function getClassContentDir()
{
if (null === $this->classcontentDir) {
$this->classcontentDir = [];
array_unshift($this->classcontentDir, $this->getBBDir().'/ClassContent');
array_unshift($this->classcontentDir, $this->getBaseRepository().'/ClassContent');
... | [
"public",
"function",
"getClassContentDir",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"classcontentDir",
")",
"{",
"$",
"this",
"->",
"classcontentDir",
"=",
"[",
"]",
";",
"array_unshift",
"(",
"$",
"this",
"->",
"classcontentDir",
",",
... | Return the classcontent repositories path for this instance.
@return array | [
"Return",
"the",
"classcontent",
"repositories",
"path",
"for",
"this",
"instance",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L611-L627 |
192,159 | backbee/backbee-php | BBApplication.php | BBApplication.pushClassContentDir | public function pushClassContentDir($dir)
{
File::resolveFilepath($dir);
$classcontentdir = $this->getClassContentDir();
array_push($classcontentdir, $dir);
$this->classcontentDir = array_unique($classcontentdir);
return $this;
} | php | public function pushClassContentDir($dir)
{
File::resolveFilepath($dir);
$classcontentdir = $this->getClassContentDir();
array_push($classcontentdir, $dir);
$this->classcontentDir = array_unique($classcontentdir);
return $this;
} | [
"public",
"function",
"pushClassContentDir",
"(",
"$",
"dir",
")",
"{",
"File",
"::",
"resolveFilepath",
"(",
"$",
"dir",
")",
";",
"$",
"classcontentdir",
"=",
"$",
"this",
"->",
"getClassContentDir",
"(",
")",
";",
"array_push",
"(",
"$",
"classcontentdir"... | Push one directory at the end of classcontent dirs.
@param string $dir
@return ApplicationInterface | [
"Push",
"one",
"directory",
"at",
"the",
"end",
"of",
"classcontent",
"dirs",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L636-L646 |
192,160 | backbee/backbee-php | BBApplication.php | BBApplication.unshiftClassContentDir | public function unshiftClassContentDir($dir)
{
File::resolveFilepath($dir);
$classcontentdir = $this->getClassContentDir();
array_unshift($classcontentdir, $dir);
$this->classcontentDir = array_unique($classcontentdir);
return $this;
} | php | public function unshiftClassContentDir($dir)
{
File::resolveFilepath($dir);
$classcontentdir = $this->getClassContentDir();
array_unshift($classcontentdir, $dir);
$this->classcontentDir = array_unique($classcontentdir);
return $this;
} | [
"public",
"function",
"unshiftClassContentDir",
"(",
"$",
"dir",
")",
"{",
"File",
"::",
"resolveFilepath",
"(",
"$",
"dir",
")",
";",
"$",
"classcontentdir",
"=",
"$",
"this",
"->",
"getClassContentDir",
"(",
")",
";",
"array_unshift",
"(",
"$",
"classconte... | Prepend one directory at the beginning of classcontent dirs.
@param type $dir
@return ApplicationInterface | [
"Prepend",
"one",
"directory",
"at",
"the",
"beginning",
"of",
"classcontent",
"dirs",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L655-L665 |
192,161 | backbee/backbee-php | BBApplication.php | BBApplication.initResourceDir | protected function initResourceDir()
{
$this->resourceDir = [];
$this->addResourceDir($this->getBBDir().'/Resources');
if (is_dir($this->getBaseRepository().'/Resources')) {
$this->addResourceDir($this->getBaseRepository().'/Resources');
}
if (is_dir($this->get... | php | protected function initResourceDir()
{
$this->resourceDir = [];
$this->addResourceDir($this->getBBDir().'/Resources');
if (is_dir($this->getBaseRepository().'/Resources')) {
$this->addResourceDir($this->getBaseRepository().'/Resources');
}
if (is_dir($this->get... | [
"protected",
"function",
"initResourceDir",
"(",
")",
"{",
"$",
"this",
"->",
"resourceDir",
"=",
"[",
"]",
";",
"$",
"this",
"->",
"addResourceDir",
"(",
"$",
"this",
"->",
"getBBDir",
"(",
")",
".",
"'/Resources'",
")",
";",
"if",
"(",
"is_dir",
"(",... | Init the default resource directories | [
"Init",
"the",
"default",
"resource",
"directories"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L684-L709 |
192,162 | backbee/backbee-php | BBApplication.php | BBApplication.pushResourceDir | public function pushResourceDir($dir)
{
File::resolveFilepath($dir);
$resourcedir = $this->getResourceDir();
array_push($resourcedir, $dir);
$this->resourceDir = $resourcedir;
return $this;
} | php | public function pushResourceDir($dir)
{
File::resolveFilepath($dir);
$resourcedir = $this->getResourceDir();
array_push($resourcedir, $dir);
$this->resourceDir = $resourcedir;
return $this;
} | [
"public",
"function",
"pushResourceDir",
"(",
"$",
"dir",
")",
"{",
"File",
"::",
"resolveFilepath",
"(",
"$",
"dir",
")",
";",
"$",
"resourcedir",
"=",
"$",
"this",
"->",
"getResourceDir",
"(",
")",
";",
"array_push",
"(",
"$",
"resourcedir",
",",
"$",
... | Push one directory at the end of resources dirs.
@param string $dir
@return ApplicationInterface | [
"Push",
"one",
"directory",
"at",
"the",
"end",
"of",
"resources",
"dirs",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L718-L728 |
192,163 | backbee/backbee-php | BBApplication.php | BBApplication.unshiftResourceDir | public function unshiftResourceDir($dir)
{
File::resolveFilepath($dir);
$resourcedir = $this->getResourceDir();
array_unshift($resourcedir, $dir);
$this->resourceDir = $resourcedir;
return $this;
} | php | public function unshiftResourceDir($dir)
{
File::resolveFilepath($dir);
$resourcedir = $this->getResourceDir();
array_unshift($resourcedir, $dir);
$this->resourceDir = $resourcedir;
return $this;
} | [
"public",
"function",
"unshiftResourceDir",
"(",
"$",
"dir",
")",
"{",
"File",
"::",
"resolveFilepath",
"(",
"$",
"dir",
")",
";",
"$",
"resourcedir",
"=",
"$",
"this",
"->",
"getResourceDir",
"(",
")",
";",
"array_unshift",
"(",
"$",
"resourcedir",
",",
... | Prepend one directory at the begining of resources dirs.
@param type $dir
@return ApplicationInterface | [
"Prepend",
"one",
"directory",
"at",
"the",
"begining",
"of",
"resources",
"dirs",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L737-L747 |
192,164 | backbee/backbee-php | BBApplication.php | BBApplication.addResourceDir | public function addResourceDir($dir)
{
if (null === $this->resourceDir) {
$this->initResourceDir();
}
if (!is_array($this->resourceDir)) {
throw new BBException(
'Misconfiguration of the BBApplication : resource dir has to be an array',
... | php | public function addResourceDir($dir)
{
if (null === $this->resourceDir) {
$this->initResourceDir();
}
if (!is_array($this->resourceDir)) {
throw new BBException(
'Misconfiguration of the BBApplication : resource dir has to be an array',
... | [
"public",
"function",
"addResourceDir",
"(",
"$",
"dir",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"resourceDir",
")",
"{",
"$",
"this",
"->",
"initResourceDir",
"(",
")",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"this",
"->",
"... | Prepend one directory of resources.
@param String $dir The new resource directory to add
@return ApplicationInterface The current BBApplication
@throws BBException Occur on invalid path or invalid resource directories | [
"Prepend",
"one",
"directory",
"of",
"resources",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L758-L781 |
192,165 | backbee/backbee-php | BBApplication.php | BBApplication.initAnnotationReader | private function initAnnotationReader()
{
AnnotationRegistry::registerFile(
$this->getVendorDir().'/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'
);
// annotations require custom autoloading
AnnotationRegistry::registerAutoloadNamespaces([
... | php | private function initAnnotationReader()
{
AnnotationRegistry::registerFile(
$this->getVendorDir().'/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'
);
// annotations require custom autoloading
AnnotationRegistry::registerAutoloadNamespaces([
... | [
"private",
"function",
"initAnnotationReader",
"(",
")",
"{",
"AnnotationRegistry",
"::",
"registerFile",
"(",
"$",
"this",
"->",
"getVendorDir",
"(",
")",
".",
"'/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'",
")",
";",
"// annotations require custom... | register all annotations and init the AnnotationReader
@return boolean | [
"register",
"all",
"annotations",
"and",
"init",
"the",
"AnnotationReader"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L1096-L1118 |
192,166 | backbee/backbee-php | BBApplication.php | BBApplication.initBundles | private function initBundles()
{
$bundleLoader = $this->getContainer()->get('bundle.loader');
if (!$bundleLoader->isRestored() && null !== $this->getConfig()->getBundlesConfig()) {
$bundleLoader->load($this->getConfig()->getBundlesConfig());
}
return $this;
} | php | private function initBundles()
{
$bundleLoader = $this->getContainer()->get('bundle.loader');
if (!$bundleLoader->isRestored() && null !== $this->getConfig()->getBundlesConfig()) {
$bundleLoader->load($this->getConfig()->getBundlesConfig());
}
return $this;
} | [
"private",
"function",
"initBundles",
"(",
")",
"{",
"$",
"bundleLoader",
"=",
"$",
"this",
"->",
"getContainer",
"(",
")",
"->",
"get",
"(",
"'bundle.loader'",
")",
";",
"if",
"(",
"!",
"$",
"bundleLoader",
"->",
"isRestored",
"(",
")",
"&&",
"null",
... | Loads every declared bundles into application.
@return ApplicationInterface | [
"Loads",
"every",
"declared",
"bundles",
"into",
"application",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L1215-L1223 |
192,167 | backbee/backbee-php | BBApplication.php | BBApplication.onFatalError | public function onFatalError()
{
$error = error_get_last();
if (null !== $error && in_array($error['type'], [E_ERROR, E_RECOVERABLE_ERROR])) {
$this->error($error['message']);
}
} | php | public function onFatalError()
{
$error = error_get_last();
if (null !== $error && in_array($error['type'], [E_ERROR, E_RECOVERABLE_ERROR])) {
$this->error($error['message']);
}
} | [
"public",
"function",
"onFatalError",
"(",
")",
"{",
"$",
"error",
"=",
"error_get_last",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"error",
"&&",
"in_array",
"(",
"$",
"error",
"[",
"'type'",
"]",
",",
"[",
"E_ERROR",
",",
"E_RECOVERABLE_ERROR",
"... | Registered function for execution on shutdown.
Logs fatal error message if exists. | [
"Registered",
"function",
"for",
"execution",
"on",
"shutdown",
".",
"Logs",
"fatal",
"error",
"message",
"if",
"exists",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/BBApplication.php#L1229-L1235 |
192,168 | Fakerino/Fakerino | src/Fakerino/Configuration/ConfigurationFile/XmlConfigurationFile.php | XmlConfigurationFile.xml2array | private function xml2array($xmlObject, $out = array())
{
foreach ($xmlObject->attributes() as $attr => $val) {
$out['@attributes'][$attr] = (string)$val;
}
$hasChilds = false;
foreach ($xmlObject as $index => $node) {
$hasChilds = true;
$out[$index... | php | private function xml2array($xmlObject, $out = array())
{
foreach ($xmlObject->attributes() as $attr => $val) {
$out['@attributes'][$attr] = (string)$val;
}
$hasChilds = false;
foreach ($xmlObject as $index => $node) {
$hasChilds = true;
$out[$index... | [
"private",
"function",
"xml2array",
"(",
"$",
"xmlObject",
",",
"$",
"out",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"xmlObject",
"->",
"attributes",
"(",
")",
"as",
"$",
"attr",
"=>",
"$",
"val",
")",
"{",
"$",
"out",
"[",
"'@attribu... | Converts an XML string in an array
@param \SimpleXMLElement $xmlObject
@param array $out
@return array | [
"Converts",
"an",
"XML",
"string",
"in",
"an",
"array"
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Configuration/ConfigurationFile/XmlConfigurationFile.php#L43-L66 |
192,169 | backbee/backbee-php | Config/Persistor/File.php | File.getConfigDumpRightDirectory | private function getConfigDumpRightDirectory($baseDir)
{
$configDumpDir = $this->app->getBaseRepository();
if ($this->persistPerContext && ApplicationInterface::DEFAULT_CONTEXT !== $this->app->getContext()) {
$configDumpDir .= DIRECTORY_SEPARATOR.$this->app->getContext();
}
... | php | private function getConfigDumpRightDirectory($baseDir)
{
$configDumpDir = $this->app->getBaseRepository();
if ($this->persistPerContext && ApplicationInterface::DEFAULT_CONTEXT !== $this->app->getContext()) {
$configDumpDir .= DIRECTORY_SEPARATOR.$this->app->getContext();
}
... | [
"private",
"function",
"getConfigDumpRightDirectory",
"(",
"$",
"baseDir",
")",
"{",
"$",
"configDumpDir",
"=",
"$",
"this",
"->",
"app",
"->",
"getBaseRepository",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"persistPerContext",
"&&",
"ApplicationInterface",
... | Returns path to the right directory to dump and save config.yml file.
@param string $baseDir config base directory
@return string | [
"Returns",
"path",
"to",
"the",
"right",
"directory",
"to",
"dump",
"and",
"save",
"config",
".",
"yml",
"file",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Config/Persistor/File.php#L91-L113 |
192,170 | backbee/backbee-php | ClassContent/ContentSet.php | ContentSet.postLoad | public function postLoad()
{
// Ensure class content are known
$data = (array) $this->_data;
foreach ($data as $dataEntry) {
$type = key($dataEntry);
$dataEntry = array_pop($dataEntry);
if (true === is_array($dataEntry)) {
$type = key($dat... | php | public function postLoad()
{
// Ensure class content are known
$data = (array) $this->_data;
foreach ($data as $dataEntry) {
$type = key($dataEntry);
$dataEntry = array_pop($dataEntry);
if (true === is_array($dataEntry)) {
$type = key($dat... | [
"public",
"function",
"postLoad",
"(",
")",
"{",
"// Ensure class content are known",
"$",
"data",
"=",
"(",
"array",
")",
"$",
"this",
"->",
"_data",
";",
"foreach",
"(",
"$",
"data",
"as",
"$",
"dataEntry",
")",
"{",
"$",
"type",
"=",
"key",
"(",
"$"... | Initialized data on postLoad doctrine event. | [
"Initialized",
"data",
"on",
"postLoad",
"doctrine",
"event",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ContentSet.php#L85-L103 |
192,171 | backbee/backbee-php | ClassContent/ContentSet.php | ContentSet.last | public function last()
{
return (null === $this->getDraft()) ? $this->getData($this->count() - 1) : $this->getDraft()->last();
} | php | public function last()
{
return (null === $this->getDraft()) ? $this->getData($this->count() - 1) : $this->getDraft()->last();
} | [
"public",
"function",
"last",
"(",
")",
"{",
"return",
"(",
"null",
"===",
"$",
"this",
"->",
"getDraft",
"(",
")",
")",
"?",
"$",
"this",
"->",
"getData",
"(",
"$",
"this",
"->",
"count",
"(",
")",
"-",
"1",
")",
":",
"$",
"this",
"->",
"getDr... | Return the last subcontent of the set.
@return AbstractClassContent the last element
@codeCoverageIgnore | [
"Return",
"the",
"last",
"subcontent",
"of",
"the",
"set",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/ContentSet.php#L337-L340 |
192,172 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.readFromContainer | private function readFromContainer(ContainerInterface $container)
{
$this->setValueIfParameterExists($container, $this->uriPrefixes[self::IMAGE_URL], 'bbapp.routing.image_uri_prefix')
->setValueIfParameterExists($container, $this->uriPrefixes[self::MEDIA_URL], 'bbapp.routing.media_uri_prefix... | php | private function readFromContainer(ContainerInterface $container)
{
$this->setValueIfParameterExists($container, $this->uriPrefixes[self::IMAGE_URL], 'bbapp.routing.image_uri_prefix')
->setValueIfParameterExists($container, $this->uriPrefixes[self::MEDIA_URL], 'bbapp.routing.media_uri_prefix... | [
"private",
"function",
"readFromContainer",
"(",
"ContainerInterface",
"$",
"container",
")",
"{",
"$",
"this",
"->",
"setValueIfParameterExists",
"(",
"$",
"container",
",",
"$",
"this",
"->",
"uriPrefixes",
"[",
"self",
"::",
"IMAGE_URL",
"]",
",",
"'bbapp.rou... | Reads varibles from the applicative container.
@param ContainerInterface $container | [
"Reads",
"varibles",
"from",
"the",
"applicative",
"container",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L125-L135 |
192,173 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.pushRouteCollection | public function pushRouteCollection(array $routes)
{
foreach ($routes as $name => $route) {
if (!array_key_exists('pattern', $route) || !array_key_exists('defaults', $route)) {
$this->log('warning', sprintf('Unable to parse the route definition `%s`.', $name));
co... | php | public function pushRouteCollection(array $routes)
{
foreach ($routes as $name => $route) {
if (!array_key_exists('pattern', $route) || !array_key_exists('defaults', $route)) {
$this->log('warning', sprintf('Unable to parse the route definition `%s`.', $name));
co... | [
"public",
"function",
"pushRouteCollection",
"(",
"array",
"$",
"routes",
")",
"{",
"foreach",
"(",
"$",
"routes",
"as",
"$",
"name",
"=>",
"$",
"route",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"'pattern'",
",",
"$",
"route",
")",
"||",
"!",... | Pushes an array of new routes in the collection.
@param array $routes The new routes to push. | [
"Pushes",
"an",
"array",
"of",
"new",
"routes",
"in",
"the",
"collection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L174-L186 |
192,174 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.getRoutePath | public function getRoutePath($name)
{
if (null !== $this->get($name)) {
return $this->get($name)->getPath();
}
return null;
} | php | public function getRoutePath($name)
{
if (null !== $this->get($name)) {
return $this->get($name)->getPath();
}
return null;
} | [
"public",
"function",
"getRoutePath",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"get",
"(",
"$",
"name",
")",
")",
"{",
"return",
"$",
"this",
"->",
"get",
"(",
"$",
"name",
")",
"->",
"getPath",
"(",
")",
";",
"}... | Returns the path associated to a route.
@param string $name The name of the route to look for.
@return string|null The path of the route if found, null otherwise. | [
"Returns",
"the",
"path",
"associated",
"to",
"a",
"route",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L195-L202 |
192,175 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.getUrlByRouteName | public function getUrlByRouteName($name, array $params = null, $baseUrl = null, $addExt = true, Site $site = null, $buildQuery = false)
{
$paramsToAdd = [];
$uri = $this->applyRouteParameters(
$this->getRoutePath($name),
(array) $params,
$paramsToAdd
... | php | public function getUrlByRouteName($name, array $params = null, $baseUrl = null, $addExt = true, Site $site = null, $buildQuery = false)
{
$paramsToAdd = [];
$uri = $this->applyRouteParameters(
$this->getRoutePath($name),
(array) $params,
$paramsToAdd
... | [
"public",
"function",
"getUrlByRouteName",
"(",
"$",
"name",
",",
"array",
"$",
"params",
"=",
"null",
",",
"$",
"baseUrl",
"=",
"null",
",",
"$",
"addExt",
"=",
"true",
",",
"Site",
"$",
"site",
"=",
"null",
",",
"$",
"buildQuery",
"=",
"false",
")"... | Returns complete url which match with routeName and routeParams; you can also customize
the base url; by default it use current site base url.
@param string $name The name of the route to look for.
@param array|null $params Optional, parameters to apply to the route.
@param string|null $baseUrl O... | [
"Returns",
"complete",
"url",
"which",
"match",
"with",
"routeName",
"and",
"routeParams",
";",
"you",
"can",
"also",
"customize",
"the",
"base",
"url",
";",
"by",
"default",
"it",
"use",
"current",
"site",
"base",
"url",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L217-L236 |
192,176 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.applyRouteParameters | private function applyRouteParameters($uri, array $parameters, array &$additionalParams = array())
{
$result = $uri;
foreach ($parameters as $key => $value) {
$count = 0;
$result = str_replace('{'.$key.'}', $value, $result, $count);
if (0 === $count) {
... | php | private function applyRouteParameters($uri, array $parameters, array &$additionalParams = array())
{
$result = $uri;
foreach ($parameters as $key => $value) {
$count = 0;
$result = str_replace('{'.$key.'}', $value, $result, $count);
if (0 === $count) {
... | [
"private",
"function",
"applyRouteParameters",
"(",
"$",
"uri",
",",
"array",
"$",
"parameters",
",",
"array",
"&",
"$",
"additionalParams",
"=",
"array",
"(",
")",
")",
"{",
"$",
"result",
"=",
"$",
"uri",
";",
"foreach",
"(",
"$",
"parameters",
"as",
... | Applies parameters to route pattern.
@param string $uri The route pattern.
@param array $parameters An array of parameters to apply.
@param array $additionalParams Optional, the parameters to found in the pattern.
@return string The route uri modified. | [
"Applies",
"parameters",
"to",
"route",
"pattern",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L247-L261 |
192,177 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.addRoute | private function addRoute($name, array $route)
{
$this->rawRoutes[$name] = $route;
$newRoute = new Route(
$route['pattern'],
$route['defaults'],
array_key_exists('requirements', $route) ? $route['requirements'] : []
);
$this->add($nam... | php | private function addRoute($name, array $route)
{
$this->rawRoutes[$name] = $route;
$newRoute = new Route(
$route['pattern'],
$route['defaults'],
array_key_exists('requirements', $route) ? $route['requirements'] : []
);
$this->add($nam... | [
"private",
"function",
"addRoute",
"(",
"$",
"name",
",",
"array",
"$",
"route",
")",
"{",
"$",
"this",
"->",
"rawRoutes",
"[",
"$",
"name",
"]",
"=",
"$",
"route",
";",
"$",
"newRoute",
"=",
"new",
"Route",
"(",
"$",
"route",
"[",
"'pattern'",
"]"... | Adds a new route to the collection.
@param string $name The name of the new route.
@param array $route The array description of the route. | [
"Adds",
"a",
"new",
"route",
"to",
"the",
"collection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L349-L362 |
192,178 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.moveDefaultRoute | private function moveDefaultRoute()
{
$defaultRoute = $this->get('default');
if (null !== $defaultRoute) {
$this->remove('default');
$this->add('default', $defaultRoute);
}
} | php | private function moveDefaultRoute()
{
$defaultRoute = $this->get('default');
if (null !== $defaultRoute) {
$this->remove('default');
$this->add('default', $defaultRoute);
}
} | [
"private",
"function",
"moveDefaultRoute",
"(",
")",
"{",
"$",
"defaultRoute",
"=",
"$",
"this",
"->",
"get",
"(",
"'default'",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"defaultRoute",
")",
"{",
"$",
"this",
"->",
"remove",
"(",
"'default'",
")",
";",
... | Ensures that the default route is always the last one in the collection. | [
"Ensures",
"that",
"the",
"default",
"route",
"is",
"always",
"the",
"last",
"one",
"in",
"the",
"collection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L367-L374 |
192,179 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.hasRequestAvailable | private function hasRequestAvailable()
{
return (
null !== $this->application
&& !$this->application->isClientSAPI()
&& $this->application->isStarted()
);
} | php | private function hasRequestAvailable()
{
return (
null !== $this->application
&& !$this->application->isClientSAPI()
&& $this->application->isStarted()
);
} | [
"private",
"function",
"hasRequestAvailable",
"(",
")",
"{",
"return",
"(",
"null",
"!==",
"$",
"this",
"->",
"application",
"&&",
"!",
"$",
"this",
"->",
"application",
"->",
"isClientSAPI",
"(",
")",
"&&",
"$",
"this",
"->",
"application",
"->",
"isStart... | Checks is a request is available.
@return boolean Returns true is a request is available, false otherwise. | [
"Checks",
"is",
"a",
"request",
"is",
"available",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L400-L407 |
192,180 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.getUriForSite | private function getUriForSite($pathinfo, Site $site = null)
{
$siteUsed = $this->getCurrentSite($site);
if (null === $siteUsed || null === $this->application) {
return $pathinfo;
}
$protocol = '';
if (null === parse_url($siteUsed->getServerName(), PHP_URL_SCHEME... | php | private function getUriForSite($pathinfo, Site $site = null)
{
$siteUsed = $this->getCurrentSite($site);
if (null === $siteUsed || null === $this->application) {
return $pathinfo;
}
$protocol = '';
if (null === parse_url($siteUsed->getServerName(), PHP_URL_SCHEME... | [
"private",
"function",
"getUriForSite",
"(",
"$",
"pathinfo",
",",
"Site",
"$",
"site",
"=",
"null",
")",
"{",
"$",
"siteUsed",
"=",
"$",
"this",
"->",
"getCurrentSite",
"(",
"$",
"site",
")",
";",
"if",
"(",
"null",
"===",
"$",
"siteUsed",
"||",
"nu... | Returns URI from pathinfo according to site to be reached.
@param string $pathinfo The pathinfo to treate.
@param Site|null $site Optional, the site to care of, if null get the current site.
@return string The computed URI. | [
"Returns",
"URI",
"from",
"pathinfo",
"according",
"to",
"site",
"to",
"be",
"reached",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L417-L431 |
192,181 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.getDefaultExtFromSite | private function getDefaultExtFromSite($pathinfo, $extension = null, Site $site = null)
{
if (strpos(basename($pathinfo), '.') || '/' === substr($pathinfo, -1)) {
return $pathinfo;
}
$siteUsed = $this->getCurrentSite($site);
$addExtension = $extension;
if (null =... | php | private function getDefaultExtFromSite($pathinfo, $extension = null, Site $site = null)
{
if (strpos(basename($pathinfo), '.') || '/' === substr($pathinfo, -1)) {
return $pathinfo;
}
$siteUsed = $this->getCurrentSite($site);
$addExtension = $extension;
if (null =... | [
"private",
"function",
"getDefaultExtFromSite",
"(",
"$",
"pathinfo",
",",
"$",
"extension",
"=",
"null",
",",
"Site",
"$",
"site",
"=",
"null",
")",
"{",
"if",
"(",
"strpos",
"(",
"basename",
"(",
"$",
"pathinfo",
")",
",",
"'.'",
")",
"||",
"'/'",
... | Adds the extension provided, pr the default one for a site.
@param string $pathinfo The pathinfo to change.
@param string|null $extension Optional, the extention to add.
@param Site|null $site Optional, the site from which the default extension will be got.
@return string The pathinfo ... | [
"Adds",
"the",
"extension",
"provided",
"pr",
"the",
"default",
"one",
"for",
"a",
"site",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L442-L455 |
192,182 | backbee/backbee-php | Routing/RouteCollection.php | RouteCollection.getCurrentSite | private function getCurrentSite(Site $site = null)
{
if (null !== $site) {
return $site;
}
if (null !== $this->application) {
return $this->application->getSite();
}
return null;
} | php | private function getCurrentSite(Site $site = null)
{
if (null !== $site) {
return $site;
}
if (null !== $this->application) {
return $this->application->getSite();
}
return null;
} | [
"private",
"function",
"getCurrentSite",
"(",
"Site",
"$",
"site",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"site",
")",
"{",
"return",
"$",
"site",
";",
"}",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"application",
")",
"{",
"retur... | Returns the current site if defined.
@param Site|null $site Optional, if provided, will be return.
@return Site|null | [
"Returns",
"the",
"current",
"site",
"if",
"defined",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Routing/RouteCollection.php#L464-L475 |
192,183 | Fakerino/Fakerino | src/Fakerino/Core/Entity/EntityInfo.php | EntityInfo.getProperties | public function getProperties($filter = \ReflectionProperty::IS_PUBLIC)
{
$properties = array();
$reflectionProperties = $this->reflectionEntity->getProperties($filter);
foreach ($reflectionProperties as $property) {
$properties[] = new Property($property->name, $property->isStat... | php | public function getProperties($filter = \ReflectionProperty::IS_PUBLIC)
{
$properties = array();
$reflectionProperties = $this->reflectionEntity->getProperties($filter);
foreach ($reflectionProperties as $property) {
$properties[] = new Property($property->name, $property->isStat... | [
"public",
"function",
"getProperties",
"(",
"$",
"filter",
"=",
"\\",
"ReflectionProperty",
"::",
"IS_PUBLIC",
")",
"{",
"$",
"properties",
"=",
"array",
"(",
")",
";",
"$",
"reflectionProperties",
"=",
"$",
"this",
"->",
"reflectionEntity",
"->",
"getProperti... | Gets the properties of the object provided.
@param int $filter
@return array | [
"Gets",
"the",
"properties",
"of",
"the",
"object",
"provided",
"."
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Core/Entity/EntityInfo.php#L50-L59 |
192,184 | Fakerino/Fakerino | src/Fakerino/Core/Entity/EntityInfo.php | EntityInfo.getSetters | public function getSetters($filter = \ReflectionProperty::IS_PUBLIC)
{
$setters = array();
$methods = $this->getMethods($filter);
foreach ($methods as $method) {
if (substr($method->getName(), 0, 3) === 'set') {
$setters[] = $method;
}
}
... | php | public function getSetters($filter = \ReflectionProperty::IS_PUBLIC)
{
$setters = array();
$methods = $this->getMethods($filter);
foreach ($methods as $method) {
if (substr($method->getName(), 0, 3) === 'set') {
$setters[] = $method;
}
}
... | [
"public",
"function",
"getSetters",
"(",
"$",
"filter",
"=",
"\\",
"ReflectionProperty",
"::",
"IS_PUBLIC",
")",
"{",
"$",
"setters",
"=",
"array",
"(",
")",
";",
"$",
"methods",
"=",
"$",
"this",
"->",
"getMethods",
"(",
"$",
"filter",
")",
";",
"fore... | Returns the public setters methods.
@param int $filter
@return array | [
"Returns",
"the",
"public",
"setters",
"methods",
"."
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Core/Entity/EntityInfo.php#L68-L79 |
192,185 | Fakerino/Fakerino | src/Fakerino/Core/Entity/EntityInfo.php | EntityInfo.getMethods | public function getMethods($filter = \ReflectionProperty::IS_PUBLIC)
{
$methods = array();
$reflectionMethods = $this->reflectionEntity->getMethods($filter);
foreach ($reflectionMethods as $method) {
$methods[] = new Method($method->name, $method->isStatic());
}
... | php | public function getMethods($filter = \ReflectionProperty::IS_PUBLIC)
{
$methods = array();
$reflectionMethods = $this->reflectionEntity->getMethods($filter);
foreach ($reflectionMethods as $method) {
$methods[] = new Method($method->name, $method->isStatic());
}
... | [
"public",
"function",
"getMethods",
"(",
"$",
"filter",
"=",
"\\",
"ReflectionProperty",
"::",
"IS_PUBLIC",
")",
"{",
"$",
"methods",
"=",
"array",
"(",
")",
";",
"$",
"reflectionMethods",
"=",
"$",
"this",
"->",
"reflectionEntity",
"->",
"getMethods",
"(",
... | Gets the methods of the object provided.
@param int $filter
@return array | [
"Gets",
"the",
"methods",
"of",
"the",
"object",
"provided",
"."
] | 920df67f1813950c56c011bb2b3c1bbbd42d9390 | https://github.com/Fakerino/Fakerino/blob/920df67f1813950c56c011bb2b3c1bbbd42d9390/src/Fakerino/Core/Entity/EntityInfo.php#L88-L97 |
192,186 | backbee/backbee-php | Console/Command/UpgradeToSectionHasChildrenCommand.php | UpgradeToSectionHasChildrenCommand.checksSectionTable | private function checksSectionTable()
{
$qb = $this->repo->createQueryBuilder('s');
$this->output->write(' - BackBee database version: - ');
try {
$qb->where('s._has_children = :true')
->orWhere('s._has_children = :false')
->setMaxResults(1)
... | php | private function checksSectionTable()
{
$qb = $this->repo->createQueryBuilder('s');
$this->output->write(' - BackBee database version: - ');
try {
$qb->where('s._has_children = :true')
->orWhere('s._has_children = :false')
->setMaxResults(1)
... | [
"private",
"function",
"checksSectionTable",
"(",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"repo",
"->",
"createQueryBuilder",
"(",
"'s'",
")",
";",
"$",
"this",
"->",
"output",
"->",
"write",
"(",
"' - BackBee database version: - '",
")",
";",
"try",
... | Checks for existing `has_children` attribut in table `section`, throw exception if `has_children` doesn't exists
@return \BackBee\Console\Command\UpgradeToPageSectionCommand
@throws BBException Raises if `has_children` doesn't exists | [
"Checks",
"for",
"existing",
"has_children",
"attribut",
"in",
"table",
"section",
"throw",
"exception",
"if",
"has_children",
"doesn",
"t",
"exists"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToSectionHasChildrenCommand.php#L134-L152 |
192,187 | backbee/backbee-php | Console/Command/UpgradeToSectionHasChildrenCommand.php | UpgradeToSectionHasChildrenCommand.updateSections | private function updateSections()
{
$sections = $this->repo->findAll();
foreach ($sections as $section) {
PageListener::setSectionHasChildren($this->em, $section);
}
$this->em->flush();
return $this;
} | php | private function updateSections()
{
$sections = $this->repo->findAll();
foreach ($sections as $section) {
PageListener::setSectionHasChildren($this->em, $section);
}
$this->em->flush();
return $this;
} | [
"private",
"function",
"updateSections",
"(",
")",
"{",
"$",
"sections",
"=",
"$",
"this",
"->",
"repo",
"->",
"findAll",
"(",
")",
";",
"foreach",
"(",
"$",
"sections",
"as",
"$",
"section",
")",
"{",
"PageListener",
"::",
"setSectionHasChildren",
"(",
... | Updates `has_section` data from existing section
@return \BackBee\Console\Command\UpgradeToPageSectionCommand | [
"Updates",
"has_section",
"data",
"from",
"existing",
"section"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Console/Command/UpgradeToSectionHasChildrenCommand.php#L160-L169 |
192,188 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.getParentContentUidByUid | public function getParentContentUidByUid($contentUid)
{
$q = $this->_em->getConnection()
->createQueryBuilder()
->select('c.parent_uid')
->from('content_has_subcontent', 'c')
->where('c.content_uid = :uid')
->setParameter('uid',... | php | public function getParentContentUidByUid($contentUid)
{
$q = $this->_em->getConnection()
->createQueryBuilder()
->select('c.parent_uid')
->from('content_has_subcontent', 'c')
->where('c.content_uid = :uid')
->setParameter('uid',... | [
"public",
"function",
"getParentContentUidByUid",
"(",
"$",
"contentUid",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"_em",
"->",
"getConnection",
"(",
")",
"->",
"createQueryBuilder",
"(",
")",
"->",
"select",
"(",
"'c.parent_uid'",
")",
"->",
"from",
"(... | Get all content uids owning the provided content.
@param string $contentUid
@return array | [
"Get",
"all",
"content",
"uids",
"owning",
"the",
"provided",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L53-L63 |
192,189 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.getParentContents | public function getParentContents(AbstractClassContent $content)
{
$result = $this->_em->getConnection()
->createQueryBuilder()
->select('p.parent_uid', 'c.classname')
->from('content_has_subcontent', 'p')
->leftJoin('p', 'content', 'c', 'p.parent_uid = c.uid'... | php | public function getParentContents(AbstractClassContent $content)
{
$result = $this->_em->getConnection()
->createQueryBuilder()
->select('p.parent_uid', 'c.classname')
->from('content_has_subcontent', 'p')
->leftJoin('p', 'content', 'c', 'p.parent_uid = c.uid'... | [
"public",
"function",
"getParentContents",
"(",
"AbstractClassContent",
"$",
"content",
")",
"{",
"$",
"result",
"=",
"$",
"this",
"->",
"_em",
"->",
"getConnection",
"(",
")",
"->",
"createQueryBuilder",
"(",
")",
"->",
"select",
"(",
"'p.parent_uid'",
",",
... | Returns provided content direct parents entity.
@param AbstractClassContent $content The content we want to get its direct parents
@return array | [
"Returns",
"provided",
"content",
"direct",
"parents",
"entity",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L71-L91 |
192,190 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.updateRootContentSetByPage | public function updateRootContentSetByPage(Page $page, ContentSet $oldContentSet, ContentSet $newContentSet, BBUserToken $userToken)
{
$em = $this->_em;
$q = $this->createQueryBuilder('c');
$results = $q->leftJoin('c._pages', 'p')
->leftJoin('p._section', 'sp')
... | php | public function updateRootContentSetByPage(Page $page, ContentSet $oldContentSet, ContentSet $newContentSet, BBUserToken $userToken)
{
$em = $this->_em;
$q = $this->createQueryBuilder('c');
$results = $q->leftJoin('c._pages', 'p')
->leftJoin('p._section', 'sp')
... | [
"public",
"function",
"updateRootContentSetByPage",
"(",
"Page",
"$",
"page",
",",
"ContentSet",
"$",
"oldContentSet",
",",
"ContentSet",
"$",
"newContentSet",
",",
"BBUserToken",
"$",
"userToken",
")",
"{",
"$",
"em",
"=",
"$",
"this",
"->",
"_em",
";",
"$"... | Replace root contentset for a page and its descendants.
@param \BackBee\NestedNode\Page $page
@param \BackBee\ClassContent\ContentSet $oldContentSet
@param \BackBee\ClassContent\ContentSet $newContentSet
@param \BackBee\Security\Token\BBUserToken $userToken | [
"Replace",
"root",
"contentset",
"for",
"a",
"page",
"and",
"its",
"descendants",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L113-L151 |
192,191 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.findContentsByClassname | public function findContentsByClassname($classnameArr = array(), $orderInfos = array(), $limitInfos = array())
{
$result = array();
if (!is_array($classnameArr)) {
return $result;
}
$db = $this->_em->getConnection();
$start = (is_array($limitInfos) && array_key_e... | php | public function findContentsByClassname($classnameArr = array(), $orderInfos = array(), $limitInfos = array())
{
$result = array();
if (!is_array($classnameArr)) {
return $result;
}
$db = $this->_em->getConnection();
$start = (is_array($limitInfos) && array_key_e... | [
"public",
"function",
"findContentsByClassname",
"(",
"$",
"classnameArr",
"=",
"array",
"(",
")",
",",
"$",
"orderInfos",
"=",
"array",
"(",
")",
",",
"$",
"limitInfos",
"=",
"array",
"(",
")",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"... | Returns a set of content by classname.
@param array $classnameArr
@param array $orderInfos
@param array $limitInfos
@return array | [
"Returns",
"a",
"set",
"of",
"content",
"by",
"classname",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L372-L396 |
192,192 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.findContentByUid | public function findContentByUid($uid)
{
$results = $this->findContentsByUids(array($uid));
if (0 < count($results)) {
return reset($results);
}
return;
} | php | public function findContentByUid($uid)
{
$results = $this->findContentsByUids(array($uid));
if (0 < count($results)) {
return reset($results);
}
return;
} | [
"public",
"function",
"findContentByUid",
"(",
"$",
"uid",
")",
"{",
"$",
"results",
"=",
"$",
"this",
"->",
"findContentsByUids",
"(",
"array",
"(",
"$",
"uid",
")",
")",
";",
"if",
"(",
"0",
"<",
"count",
"(",
"$",
"results",
")",
")",
"{",
"retu... | Returns the hydrated content by its uid.
@param string $uid
@return array|null the content if found | [
"Returns",
"the",
"hydrated",
"content",
"by",
"its",
"uid",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L405-L413 |
192,193 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.getDistinctClassnamesFromUids | private function getDistinctClassnamesFromUids(array $uids)
{
$classnames = array();
try {
if (0 < count($uids)) {
// Data protection
array_walk($uids, function (&$item) {
$item = addslashes($item);
});
... | php | private function getDistinctClassnamesFromUids(array $uids)
{
$classnames = array();
try {
if (0 < count($uids)) {
// Data protection
array_walk($uids, function (&$item) {
$item = addslashes($item);
});
... | [
"private",
"function",
"getDistinctClassnamesFromUids",
"(",
"array",
"$",
"uids",
")",
"{",
"$",
"classnames",
"=",
"array",
"(",
")",
";",
"try",
"{",
"if",
"(",
"0",
"<",
"count",
"(",
"$",
"uids",
")",
")",
"{",
"// Data protection",
"array_walk",
"(... | Return the classnames from content uids.
@param array $uids An array of content uids
@return array An array of the classnames | [
"Return",
"the",
"classnames",
"from",
"content",
"uids",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L422-L448 |
192,194 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.findContentsByUids | public function findContentsByUids(array $uids)
{
$result = array();
try {
if (0 < count($uids)) {
// Getting classnames for provided uids
$classnames = $this->getDistinctClassnamesFromUids($uids);
// Construct the DQL query
... | php | public function findContentsByUids(array $uids)
{
$result = array();
try {
if (0 < count($uids)) {
// Getting classnames for provided uids
$classnames = $this->getDistinctClassnamesFromUids($uids);
// Construct the DQL query
... | [
"public",
"function",
"findContentsByUids",
"(",
"array",
"$",
"uids",
")",
"{",
"$",
"result",
"=",
"array",
"(",
")",
";",
"try",
"{",
"if",
"(",
"0",
"<",
"count",
"(",
"$",
"uids",
")",
")",
"{",
"// Getting classnames for provided uids",
"$",
"class... | Returns the hydrated contents from their uids.
@param array $uids
@return array An array of AbstractClassContent | [
"Returns",
"the",
"hydrated",
"contents",
"from",
"their",
"uids",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L457-L480 |
192,195 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.load | public function load(AbstractClassContent $content, BBUserToken $token = null, $checkoutOnMissing = false)
{
$revision = null;
if (null !== $token) {
$revision = $this->_em->getRepository('BackBee\ClassContent\Revision')->getDraft(
$content,
$token,
... | php | public function load(AbstractClassContent $content, BBUserToken $token = null, $checkoutOnMissing = false)
{
$revision = null;
if (null !== $token) {
$revision = $this->_em->getRepository('BackBee\ClassContent\Revision')->getDraft(
$content,
$token,
... | [
"public",
"function",
"load",
"(",
"AbstractClassContent",
"$",
"content",
",",
"BBUserToken",
"$",
"token",
"=",
"null",
",",
"$",
"checkoutOnMissing",
"=",
"false",
")",
"{",
"$",
"revision",
"=",
"null",
";",
"if",
"(",
"null",
"!==",
"$",
"token",
")... | Load content if need, the user's revision is also set.
@param AbstractClassContent $content
@param BBUserToken $token
@param boolean $checkoutOnMissing If true, checks out a new revision if none was found
@return AbstractClassContent | [
"Load",
"content",
"if",
"need",
"the",
"user",
"s",
"revision",
"is",
"also",
"set",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L769-L790 |
192,196 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.findPagesByContent | public function findPagesByContent($content)
{
$contentUids = array_merge($this->getContentsParentUids($content->getUid()), [$content->getUid()]);
$contentUids = implode(', ', array_unique(array_map(function ($uid) {
return '"'.$uid.'"';
}, $contentUids)));
$pageUids = $... | php | public function findPagesByContent($content)
{
$contentUids = array_merge($this->getContentsParentUids($content->getUid()), [$content->getUid()]);
$contentUids = implode(', ', array_unique(array_map(function ($uid) {
return '"'.$uid.'"';
}, $contentUids)));
$pageUids = $... | [
"public",
"function",
"findPagesByContent",
"(",
"$",
"content",
")",
"{",
"$",
"contentUids",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"getContentsParentUids",
"(",
"$",
"content",
"->",
"getUid",
"(",
")",
")",
",",
"[",
"$",
"content",
"->",
"getUid"... | Find pages by Class content
@param \BackBee\ClassContent\AbstractClassContent $content
@return Collection<Page> | [
"Find",
"pages",
"by",
"Class",
"content"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L813-L832 |
192,197 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.getContentsParentUids | public function getContentsParentUids($contentUids)
{
$contentUids = (array) $contentUids;
if (0 === count($contentUids)) {
return [];
}
$contentUids = implode(', ', array_unique(array_map(function ($uid) {
return '"'.$uid.'"';
}, $contentUids)));
... | php | public function getContentsParentUids($contentUids)
{
$contentUids = (array) $contentUids;
if (0 === count($contentUids)) {
return [];
}
$contentUids = implode(', ', array_unique(array_map(function ($uid) {
return '"'.$uid.'"';
}, $contentUids)));
... | [
"public",
"function",
"getContentsParentUids",
"(",
"$",
"contentUids",
")",
"{",
"$",
"contentUids",
"=",
"(",
"array",
")",
"$",
"contentUids",
";",
"if",
"(",
"0",
"===",
"count",
"(",
"$",
"contentUids",
")",
")",
"{",
"return",
"[",
"]",
";",
"}",... | Returns all parents uid of provided contents.
@param string|array $contentUids Contents' uid we want to get all parents uid
@return array | [
"Returns",
"all",
"parents",
"uid",
"of",
"provided",
"contents",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L840-L856 |
192,198 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.getParentByClassName | public function getParentByClassName($childUid, $classname)
{
$q = $this->_em->getConnection()
->createQueryBuilder()
->select('j.parent_uid, c.classname')
->from('content_has_subcontent', 'j')
->from('content', 'c')
->andWhere(... | php | public function getParentByClassName($childUid, $classname)
{
$q = $this->_em->getConnection()
->createQueryBuilder()
->select('j.parent_uid, c.classname')
->from('content_has_subcontent', 'j')
->from('content', 'c')
->andWhere(... | [
"public",
"function",
"getParentByClassName",
"(",
"$",
"childUid",
",",
"$",
"classname",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"_em",
"->",
"getConnection",
"(",
")",
"->",
"createQueryBuilder",
"(",
")",
"->",
"select",
"(",
"'j.parent_uid, c.classn... | Returns an uid if parent with this classname found, false otherwise.
@param string $childUid
@param string $classname
@return mixed | [
"Returns",
"an",
"uid",
"if",
"parent",
"with",
"this",
"classname",
"found",
"false",
"otherwise",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L866-L889 |
192,199 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.deleteContent | public function deleteContent(AbstractClassContent $content, $mainContent = true)
{
if (!$this->getEntityManager()->contains($content)) {
// Ensure $content is managed
$content = $this->getEntityManager()
->getRepository(AbstractClassContent::getFullClassname($con... | php | public function deleteContent(AbstractClassContent $content, $mainContent = true)
{
if (!$this->getEntityManager()->contains($content)) {
// Ensure $content is managed
$content = $this->getEntityManager()
->getRepository(AbstractClassContent::getFullClassname($con... | [
"public",
"function",
"deleteContent",
"(",
"AbstractClassContent",
"$",
"content",
",",
"$",
"mainContent",
"=",
"true",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"contains",
"(",
"$",
"content",
")",
")",
"{",
"//... | Delete a Class Content
@param AbstractClassContent $content
@param bool $mainContent if it's a main content, delete recursively under contents
@return | [
"Delete",
"a",
"Class",
"Content"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L899-L950 |
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.