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,200 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.cleanUpContentHardDelete | protected function cleanUpContentHardDelete(AbstractClassContent $content)
{
$this->_em->getConnection()->executeUpdate(
'DELETE FROM indexation WHERE owner_uid = :uid',
[
'uid' => $content->getUid(),
]
);
$revisions = $this->_em->getRepos... | php | protected function cleanUpContentHardDelete(AbstractClassContent $content)
{
$this->_em->getConnection()->executeUpdate(
'DELETE FROM indexation WHERE owner_uid = :uid',
[
'uid' => $content->getUid(),
]
);
$revisions = $this->_em->getRepos... | [
"protected",
"function",
"cleanUpContentHardDelete",
"(",
"AbstractClassContent",
"$",
"content",
")",
"{",
"$",
"this",
"->",
"_em",
"->",
"getConnection",
"(",
")",
"->",
"executeUpdate",
"(",
"'DELETE FROM indexation WHERE owner_uid = :uid'",
",",
"[",
"'uid'",
"=>... | Performs custom process on hard delete of content.
@param AbstractClassContent $content
@return self | [
"Performs",
"custom",
"process",
"on",
"hard",
"delete",
"of",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L958-L973 |
192,201 | backbee/backbee-php | ClassContent/Repository/ClassContentRepository.php | ClassContentRepository.getClassnames | public function getClassnames(array $contentUids)
{
$contentUids = array_map(function ($uid) {
return '"'.$uid.'"';
}, array_filter($contentUids));
if (0 === count($contentUids)) {
return [];
}
$qb = $this->_em->getConnection()->createQueryBuilder();... | php | public function getClassnames(array $contentUids)
{
$contentUids = array_map(function ($uid) {
return '"'.$uid.'"';
}, array_filter($contentUids));
if (0 === count($contentUids)) {
return [];
}
$qb = $this->_em->getConnection()->createQueryBuilder();... | [
"public",
"function",
"getClassnames",
"(",
"array",
"$",
"contentUids",
")",
"{",
"$",
"contentUids",
"=",
"array_map",
"(",
"function",
"(",
"$",
"uid",
")",
"{",
"return",
"'\"'",
".",
"$",
"uid",
".",
"'\"'",
";",
"}",
",",
"array_filter",
"(",
"$"... | Returns distinct classnames for provided classcontent uids.
@param array $contentUids The array that contains every classcontent uids
@return array | [
"Returns",
"distinct",
"classnames",
"for",
"provided",
"classcontent",
"uids",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Repository/ClassContentRepository.php#L981-L1000 |
192,202 | backbee/backbee-php | Cache/AbstractCache.php | AbstractCache.setInstanceOptions | private function setInstanceOptions(array $options = array())
{
foreach ($options as $key => $value) {
if (true === array_key_exists($key, $this->_instance_options)) {
$this->_instance_options[$key] = $value;
} else {
throw new CacheException(sprintf('... | php | private function setInstanceOptions(array $options = array())
{
foreach ($options as $key => $value) {
if (true === array_key_exists($key, $this->_instance_options)) {
$this->_instance_options[$key] = $value;
} else {
throw new CacheException(sprintf('... | [
"private",
"function",
"setInstanceOptions",
"(",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
"{",
"foreach",
"(",
"$",
"options",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"true",
"===",
"array_key_exists",
"(",
"$",
"key",
... | Sets the cache adapter instance options.
@param array $options
@return \BackBee\Cache\CacheAdapterInterface
@throws \BackBee\Cache\Exception\CacheException Occurs if a provided option is unknown for this adapter. | [
"Sets",
"the",
"cache",
"adapter",
"instance",
"options",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/AbstractCache.php#L198-L209 |
192,203 | backbee/backbee-php | Cache/AbstractCache.php | AbstractCache.getControledLifetime | public function getControledLifetime($lifetime)
{
if (
null !== $this->_instance_options['min_lifetime']
&& $this->_instance_options['min_lifetime'] > $lifetime
) {
$lifetime = $this->_instance_options['min_lifetime'];
} elseif (
null !== $this... | php | public function getControledLifetime($lifetime)
{
if (
null !== $this->_instance_options['min_lifetime']
&& $this->_instance_options['min_lifetime'] > $lifetime
) {
$lifetime = $this->_instance_options['min_lifetime'];
} elseif (
null !== $this... | [
"public",
"function",
"getControledLifetime",
"(",
"$",
"lifetime",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"_instance_options",
"[",
"'min_lifetime'",
"]",
"&&",
"$",
"this",
"->",
"_instance_options",
"[",
"'min_lifetime'",
"]",
">",
"$",
"l... | Control the lifetime against min and max lifetime if provided.
@param int $lifetime
@return int | [
"Control",
"the",
"lifetime",
"against",
"min",
"and",
"max",
"lifetime",
"if",
"provided",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/AbstractCache.php#L264-L279 |
192,204 | backbee/backbee-php | Cache/AbstractCache.php | AbstractCache.getControledExpireTime | private function getControledExpireTime($expire)
{
$lifetime = $this->getControledLifetime($expire - time());
if (0 < $lifetime) {
return time() + $lifetime;
}
return $expire;
} | php | private function getControledExpireTime($expire)
{
$lifetime = $this->getControledLifetime($expire - time());
if (0 < $lifetime) {
return time() + $lifetime;
}
return $expire;
} | [
"private",
"function",
"getControledExpireTime",
"(",
"$",
"expire",
")",
"{",
"$",
"lifetime",
"=",
"$",
"this",
"->",
"getControledLifetime",
"(",
"$",
"expire",
"-",
"time",
"(",
")",
")",
";",
"if",
"(",
"0",
"<",
"$",
"lifetime",
")",
"{",
"return... | Control the expiration time against min and max lifetime if provided.
@param int $expire
@return int | [
"Control",
"the",
"expiration",
"time",
"against",
"min",
"and",
"max",
"lifetime",
"if",
"provided",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/AbstractCache.php#L288-L297 |
192,205 | backbee/backbee-php | Security/Repository/UserRepository.php | UserRepository.loadUserByPublicKey | public function loadUserByPublicKey($publicApiKey)
{
if (null === $user = $this->findOneBy(array('_api_key_public' => $publicApiKey))) {
throw new UsernameNotFoundException(sprintf('Unknown public API key `%s`.', $publicApiKey));
}
return $this->checkActivatedStatus($user);
... | php | public function loadUserByPublicKey($publicApiKey)
{
if (null === $user = $this->findOneBy(array('_api_key_public' => $publicApiKey))) {
throw new UsernameNotFoundException(sprintf('Unknown public API key `%s`.', $publicApiKey));
}
return $this->checkActivatedStatus($user);
... | [
"public",
"function",
"loadUserByPublicKey",
"(",
"$",
"publicApiKey",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"user",
"=",
"$",
"this",
"->",
"findOneBy",
"(",
"array",
"(",
"'_api_key_public'",
"=>",
"$",
"publicApiKey",
")",
")",
")",
"{",
"throw",
"... | Loads the user for the given public API key.
@param string $publicApiKey The username
@return UserInterface
@throws UsernameNotFoundException if the user is not found | [
"Loads",
"the",
"user",
"for",
"the",
"given",
"public",
"API",
"key",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Repository/UserRepository.php#L62-L69 |
192,206 | backbee/backbee-php | Security/Repository/UserRepository.php | UserRepository.checkActivatedStatus | private function checkActivatedStatus(User $user)
{
if (!$user->isActivated()) {
throw new DisabledException(sprintf('Account `%s`is disabled.', $user->getUsername()));
}
return $user;
} | php | private function checkActivatedStatus(User $user)
{
if (!$user->isActivated()) {
throw new DisabledException(sprintf('Account `%s`is disabled.', $user->getUsername()));
}
return $user;
} | [
"private",
"function",
"checkActivatedStatus",
"(",
"User",
"$",
"user",
")",
"{",
"if",
"(",
"!",
"$",
"user",
"->",
"isActivated",
"(",
")",
")",
"{",
"throw",
"new",
"DisabledException",
"(",
"sprintf",
"(",
"'Account `%s`is disabled.'",
",",
"$",
"user",... | Checks that the user is activated
@param User $user The user
@return User
@throws DisabledException if the user is not activated | [
"Checks",
"that",
"the",
"user",
"is",
"activated"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Repository/UserRepository.php#L98-L105 |
192,207 | backbee/backbee-php | ClassContent/Revision.php | Revision.setContent | public function setContent(AbstractClassContent $content = null)
{
$this->_content = $content;
if (null !== $this->_content) {
$this->setClassname(ClassUtils::getRealClass($this->_content));
}
return $this->getContentInstance();
} | php | public function setContent(AbstractClassContent $content = null)
{
$this->_content = $content;
if (null !== $this->_content) {
$this->setClassname(ClassUtils::getRealClass($this->_content));
}
return $this->getContentInstance();
} | [
"public",
"function",
"setContent",
"(",
"AbstractClassContent",
"$",
"content",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_content",
"=",
"$",
"content",
";",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"_content",
")",
"{",
"$",
"this",
"->",
"setC... | Sets the attached revisionned content.
@param AbstractClassContent $content
@return AbstractClassContent the current instance content | [
"Sets",
"the",
"attached",
"revisionned",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Revision.php#L294-L303 |
192,208 | backbee/backbee-php | ClassContent/Revision.php | Revision.setOwner | public function setOwner(UserInterface $user)
{
$this->_owner = UserSecurityIdentity::fromAccount($user);
return $this->getContentInstance();
} | php | public function setOwner(UserInterface $user)
{
$this->_owner = UserSecurityIdentity::fromAccount($user);
return $this->getContentInstance();
} | [
"public",
"function",
"setOwner",
"(",
"UserInterface",
"$",
"user",
")",
"{",
"$",
"this",
"->",
"_owner",
"=",
"UserSecurityIdentity",
"::",
"fromAccount",
"(",
"$",
"user",
")",
";",
"return",
"$",
"this",
"->",
"getContentInstance",
"(",
")",
";",
"}"
... | Sets the owner of the revision.
@param UserInterface $user
@return AbstractClassContent the current instance content
@codeCoverageIgnore | [
"Sets",
"the",
"owner",
"of",
"the",
"revision",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Revision.php#L328-L333 |
192,209 | backbee/backbee-php | ClassContent/Revision.php | Revision.getSerializedRevisionData | private function getSerializedRevisionData()
{
return [
'type' => $this->getShortClassname($this->getContent()),
'content_uid' => $this->getContent()->getUid(),
'owner' => $this->getOwner(),
'comment' => $this->getComment()
];
} | php | private function getSerializedRevisionData()
{
return [
'type' => $this->getShortClassname($this->getContent()),
'content_uid' => $this->getContent()->getUid(),
'owner' => $this->getOwner(),
'comment' => $this->getComment()
];
} | [
"private",
"function",
"getSerializedRevisionData",
"(",
")",
"{",
"return",
"[",
"'type'",
"=>",
"$",
"this",
"->",
"getShortClassname",
"(",
"$",
"this",
"->",
"getContent",
"(",
")",
")",
",",
"'content_uid'",
"=>",
"$",
"this",
"->",
"getContent",
"(",
... | Returns an array of information to be returned on JSON_REVISON_FORMAT serialization.
@return array | [
"Returns",
"an",
"array",
"of",
"information",
"to",
"be",
"returned",
"on",
"JSON_REVISON_FORMAT",
"serialization",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Revision.php#L613-L621 |
192,210 | backbee/backbee-php | ClassContent/Revision.php | Revision.getSerializedDraftData | private function getSerializedDraftData()
{
$currentDraft = $this->getContent()->getDraft();
$this->getContent()->setDraft(null);
$sourceData = $this->getContent()->jsonSerialize(self::JSON_CONCISE_FORMAT);
$this->getContent()->setDraft($currentDraft);
$draftData = parent::j... | php | private function getSerializedDraftData()
{
$currentDraft = $this->getContent()->getDraft();
$this->getContent()->setDraft(null);
$sourceData = $this->getContent()->jsonSerialize(self::JSON_CONCISE_FORMAT);
$this->getContent()->setDraft($currentDraft);
$draftData = parent::j... | [
"private",
"function",
"getSerializedDraftData",
"(",
")",
"{",
"$",
"currentDraft",
"=",
"$",
"this",
"->",
"getContent",
"(",
")",
"->",
"getDraft",
"(",
")",
";",
"$",
"this",
"->",
"getContent",
"(",
")",
"->",
"setDraft",
"(",
"null",
")",
";",
"$... | Returns an array of information to be returned on not JSON_REVISON_FORMAT serialization.
@return array | [
"Returns",
"an",
"array",
"of",
"information",
"to",
"be",
"returned",
"on",
"not",
"JSON_REVISON_FORMAT",
"serialization",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Revision.php#L628-L658 |
192,211 | backbee/backbee-php | ClassContent/Revision.php | Revision.commit | public function commit()
{
if (self::STATE_ADDED === $this->getState() || self::STATE_MODIFIED === $this->getState()) {
$this->setRevision($this->getRevision() + 1);
$this->setState(self::STATE_COMMITTED);
} elseif (self::STATE_CONFLICTED === $this->getState()) {
... | php | public function commit()
{
if (self::STATE_ADDED === $this->getState() || self::STATE_MODIFIED === $this->getState()) {
$this->setRevision($this->getRevision() + 1);
$this->setState(self::STATE_COMMITTED);
} elseif (self::STATE_CONFLICTED === $this->getState()) {
... | [
"public",
"function",
"commit",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"STATE_ADDED",
"===",
"$",
"this",
"->",
"getState",
"(",
")",
"||",
"self",
"::",
"STATE_MODIFIED",
"===",
"$",
"this",
"->",
"getState",
"(",
")",
")",
"{",
"$",
"this",
"->",
... | Updates current revision state and revision to be ready for commit.
@return self | [
"Updates",
"current",
"revision",
"state",
"and",
"revision",
"to",
"be",
"ready",
"for",
"commit",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Revision.php#L665-L683 |
192,212 | backbee/backbee-php | ClassContent/Revision.php | Revision.setOptions | protected function setOptions($options = null)
{
if ($options instanceof TokenInterface) {
$this->_owner = UserSecurityIdentity::fromToken($options);
}
return $this;
} | php | protected function setOptions($options = null)
{
if ($options instanceof TokenInterface) {
$this->_owner = UserSecurityIdentity::fromToken($options);
}
return $this;
} | [
"protected",
"function",
"setOptions",
"(",
"$",
"options",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"options",
"instanceof",
"TokenInterface",
")",
"{",
"$",
"this",
"->",
"_owner",
"=",
"UserSecurityIdentity",
"::",
"fromToken",
"(",
"$",
"options",
")",
"... | Sets options at the construction of a new revision.
@param mixed $options
@return \BackBee\ClassContent\AContent
@return \BackBee\ClassContent\AbstractClassContent | [
"Sets",
"options",
"at",
"the",
"construction",
"of",
"a",
"new",
"revision",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Revision.php#L712-L719 |
192,213 | backbee/backbee-php | ClassContent/Revision.php | Revision.getContentByDataValue | protected function getContentByDataValue($type, $value)
{
$element = new $type($value);
if (null !== $this->em) {
$element = $this->em->getRepository($type)->load($element, $this->token);
}
return $element;
} | php | protected function getContentByDataValue($type, $value)
{
$element = new $type($value);
if (null !== $this->em) {
$element = $this->em->getRepository($type)->load($element, $this->token);
}
return $element;
} | [
"protected",
"function",
"getContentByDataValue",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"$",
"element",
"=",
"new",
"$",
"type",
"(",
"$",
"value",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"em",
")",
"{",
"$",
"element",
"=",... | Return a subcontent instance by its type and value, FALSE if not found.
@param string $type The classname of the subcontent
@param string $value The value of the subcontent (uid)
@return AbstractClassContent | [
"Return",
"a",
"subcontent",
"instance",
"by",
"its",
"type",
"and",
"value",
"FALSE",
"if",
"not",
"found",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Revision.php#L729-L738 |
192,214 | backbee/backbee-php | ClassContent/Revision.php | Revision.computeElements | private function computeElements(array $sourceElements, array $draftElements)
{
$elements = [];
if ($this->getContent() instanceof ContentSet) {
$elements = [
'current' => $sourceElements,
'draft' => $draftElements,
];
} else {
... | php | private function computeElements(array $sourceElements, array $draftElements)
{
$elements = [];
if ($this->getContent() instanceof ContentSet) {
$elements = [
'current' => $sourceElements,
'draft' => $draftElements,
];
} else {
... | [
"private",
"function",
"computeElements",
"(",
"array",
"$",
"sourceElements",
",",
"array",
"$",
"draftElements",
")",
"{",
"$",
"elements",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"this",
"->",
"getContent",
"(",
")",
"instanceof",
"ContentSet",
")",
"{",
... | Computes and returns elements data.
@param array $sourceElements
@param array $draftElements
@return array | [
"Computes",
"and",
"returns",
"elements",
"data",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/Revision.php#L748-L768 |
192,215 | backbee/backbee-php | Workflow/Repository/StateRepository.php | StateRepository.getWorkflowStatesForLayout | public function getWorkflowStatesForLayout(Layout $layout)
{
$states = array();
foreach ($this->findBy(array('_layout' => null)) as $state) {
$states[$state->getCode()] = $state;
}
foreach ($this->findBy(array('_layout' => $layout)) as $state) {
$states[$stat... | php | public function getWorkflowStatesForLayout(Layout $layout)
{
$states = array();
foreach ($this->findBy(array('_layout' => null)) as $state) {
$states[$state->getCode()] = $state;
}
foreach ($this->findBy(array('_layout' => $layout)) as $state) {
$states[$stat... | [
"public",
"function",
"getWorkflowStatesForLayout",
"(",
"Layout",
"$",
"layout",
")",
"{",
"$",
"states",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"findBy",
"(",
"array",
"(",
"'_layout'",
"=>",
"null",
")",
")",
"as",
"$",
"sta... | Returns an array of available workflow states for the provided layout.
@param \BackBee\Site\Layout $layout
@return array | [
"Returns",
"an",
"array",
"of",
"available",
"workflow",
"states",
"for",
"the",
"provided",
"layout",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Workflow/Repository/StateRepository.php#L46-L60 |
192,216 | backbee/backbee-php | Bundle/Registry/Builder.php | Builder.buildEntity | private function buildEntity()
{
$classname = $this->classname;
if (class_exists($classname) && $this->isRegistryEntity(new $classname())) {
$this->entity = new $classname();
$this->buildEntityClass();
} else {
$this->entity = new \stdClass();
... | php | private function buildEntity()
{
$classname = $this->classname;
if (class_exists($classname) && $this->isRegistryEntity(new $classname())) {
$this->entity = new $classname();
$this->buildEntityClass();
} else {
$this->entity = new \stdClass();
... | [
"private",
"function",
"buildEntity",
"(",
")",
"{",
"$",
"classname",
"=",
"$",
"this",
"->",
"classname",
";",
"if",
"(",
"class_exists",
"(",
"$",
"classname",
")",
"&&",
"$",
"this",
"->",
"isRegistryEntity",
"(",
"new",
"$",
"classname",
"(",
")",
... | build the entity from the registry. | [
"build",
"the",
"entity",
"from",
"the",
"registry",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/Registry/Builder.php#L57-L67 |
192,217 | backbee/backbee-php | Bundle/Registry/Builder.php | Builder.setRegistries | public function setRegistries(array $registries, $classname)
{
$this->classname = $classname;
$this->registries = $registries;
return $this;
} | php | public function setRegistries(array $registries, $classname)
{
$this->classname = $classname;
$this->registries = $registries;
return $this;
} | [
"public",
"function",
"setRegistries",
"(",
"array",
"$",
"registries",
",",
"$",
"classname",
")",
"{",
"$",
"this",
"->",
"classname",
"=",
"$",
"classname",
";",
"$",
"this",
"->",
"registries",
"=",
"$",
"registries",
";",
"return",
"$",
"this",
";",... | Add registries elements.
@param array $registries
@return self | [
"Add",
"registries",
"elements",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/Registry/Builder.php#L107-L113 |
192,218 | backbee/backbee-php | Bundle/Registry/Builder.php | Builder.buildEntityClass | private function buildEntityClass()
{
foreach ($this->registries as $registry) {
if ($registry->getKey() === 'identifier') {
$this->entity->setObjectIdentifier($registry->getValue());
} else {
$this->entity->setObjectProperty($registry->getKey(), $regi... | php | private function buildEntityClass()
{
foreach ($this->registries as $registry) {
if ($registry->getKey() === 'identifier') {
$this->entity->setObjectIdentifier($registry->getValue());
} else {
$this->entity->setObjectProperty($registry->getKey(), $regi... | [
"private",
"function",
"buildEntityClass",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"registries",
"as",
"$",
"registry",
")",
"{",
"if",
"(",
"$",
"registry",
"->",
"getKey",
"(",
")",
"===",
"'identifier'",
")",
"{",
"$",
"this",
"->",
"entit... | Automatique entity builder from the registries elements. | [
"Automatique",
"entity",
"builder",
"from",
"the",
"registries",
"elements",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/Registry/Builder.php#L132-L141 |
192,219 | backbee/backbee-php | Bundle/Registry/Builder.php | Builder.buildStdClass | private function buildStdClass()
{
foreach ($this->registries as $registry) {
$this->entity->{$registry->getKey()} = $registry->getValue();
}
} | php | private function buildStdClass()
{
foreach ($this->registries as $registry) {
$this->entity->{$registry->getKey()} = $registry->getValue();
}
} | [
"private",
"function",
"buildStdClass",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"registries",
"as",
"$",
"registry",
")",
"{",
"$",
"this",
"->",
"entity",
"->",
"{",
"$",
"registry",
"->",
"getKey",
"(",
")",
"}",
"=",
"$",
"registry",
"->... | Automatique stdClass builder from the registries elements. | [
"Automatique",
"stdClass",
"builder",
"from",
"the",
"registries",
"elements",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/Registry/Builder.php#L146-L151 |
192,220 | backbee/backbee-php | Bundle/Registry/Builder.php | Builder.buildRegistries | private function buildRegistries()
{
if (is_object($this->entity) && $this->isRegistryEntity($this->entity)) {
$this->buildRegistryFromObject();
} else {
throw new \InvalidArgumentException(sprintf(
'Cannot build registries: current entity must be an instance ... | php | private function buildRegistries()
{
if (is_object($this->entity) && $this->isRegistryEntity($this->entity)) {
$this->buildRegistryFromObject();
} else {
throw new \InvalidArgumentException(sprintf(
'Cannot build registries: current entity must be an instance ... | [
"private",
"function",
"buildRegistries",
"(",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"this",
"->",
"entity",
")",
"&&",
"$",
"this",
"->",
"isRegistryEntity",
"(",
"$",
"this",
"->",
"entity",
")",
")",
"{",
"$",
"this",
"->",
"buildRegistryFromObj... | Automatique registry builder from the current entity. | [
"Automatique",
"registry",
"builder",
"from",
"the",
"current",
"entity",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/Registry/Builder.php#L156-L171 |
192,221 | backbee/backbee-php | Bundle/Registry/Builder.php | Builder.buildRegistryFromObject | private function buildRegistryFromObject()
{
if (!($this->entity instanceof DomainObjectInterface)) {
throw new \Exception('EntityRegistry have to implement DomainObjectInterface', 1);
}
$this->classname = get_class($this->entity);
$identifier = new Registry();
$... | php | private function buildRegistryFromObject()
{
if (!($this->entity instanceof DomainObjectInterface)) {
throw new \Exception('EntityRegistry have to implement DomainObjectInterface', 1);
}
$this->classname = get_class($this->entity);
$identifier = new Registry();
$... | [
"private",
"function",
"buildRegistryFromObject",
"(",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"this",
"->",
"entity",
"instanceof",
"DomainObjectInterface",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'EntityRegistry have to implement DomainObjectInterface'",... | Automatique registry builder from the current entity object. | [
"Automatique",
"registry",
"builder",
"from",
"the",
"current",
"entity",
"object",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/Registry/Builder.php#L176-L190 |
192,222 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.load | public function load(array $config)
{
foreach ($config as $id => $classname) {
$serviceId = $this->generateBundleServiceId($id);
if (false === $this->container->hasDefinition($serviceId)) {
$baseDir = $this->buildBundleBaseDirectoryFromClassname($classname);
... | php | public function load(array $config)
{
foreach ($config as $id => $classname) {
$serviceId = $this->generateBundleServiceId($id);
if (false === $this->container->hasDefinition($serviceId)) {
$baseDir = $this->buildBundleBaseDirectoryFromClassname($classname);
... | [
"public",
"function",
"load",
"(",
"array",
"$",
"config",
")",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"id",
"=>",
"$",
"classname",
")",
"{",
"$",
"serviceId",
"=",
"$",
"this",
"->",
"generateBundleServiceId",
"(",
"$",
"id",
")",
";",
"if"... | Loads bundles into application.
@param array $config bundle configurations | [
"Loads",
"bundles",
"into",
"application",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L108-L131 |
192,223 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.getBundleIdByBaseDir | public function getBundleIdByBaseDir($path)
{
$bundleId = null;
foreach ($this->bundleInfos as $id => $data) {
if (0 === strpos($path, $data['base_dir'])) {
$bundleId = $id;
break;
}
}
return $bundleId;
} | php | public function getBundleIdByBaseDir($path)
{
$bundleId = null;
foreach ($this->bundleInfos as $id => $data) {
if (0 === strpos($path, $data['base_dir'])) {
$bundleId = $id;
break;
}
}
return $bundleId;
} | [
"public",
"function",
"getBundleIdByBaseDir",
"(",
"$",
"path",
")",
"{",
"$",
"bundleId",
"=",
"null",
";",
"foreach",
"(",
"$",
"this",
"->",
"bundleInfos",
"as",
"$",
"id",
"=>",
"$",
"data",
")",
"{",
"if",
"(",
"0",
"===",
"strpos",
"(",
"$",
... | Returns bundle id if provided path is matched with any bundle base directory.
@param string $path
@return string | [
"Returns",
"bundle",
"id",
"if",
"provided",
"path",
"is",
"matched",
"with",
"any",
"bundle",
"base",
"directory",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L140-L151 |
192,224 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.buildBundleBaseDirectoryFromClassname | public function buildBundleBaseDirectoryFromClassname($classname)
{
if (false === array_key_exists($classname, $this->reflectionClasses)) {
$this->reflectionClasses[$classname] = new \ReflectionClass($classname);
}
$baseDir = dirname($this->reflectionClasses[$classname]->getFile... | php | public function buildBundleBaseDirectoryFromClassname($classname)
{
if (false === array_key_exists($classname, $this->reflectionClasses)) {
$this->reflectionClasses[$classname] = new \ReflectionClass($classname);
}
$baseDir = dirname($this->reflectionClasses[$classname]->getFile... | [
"public",
"function",
"buildBundleBaseDirectoryFromClassname",
"(",
"$",
"classname",
")",
"{",
"if",
"(",
"false",
"===",
"array_key_exists",
"(",
"$",
"classname",
",",
"$",
"this",
"->",
"reflectionClasses",
")",
")",
"{",
"$",
"this",
"->",
"reflectionClasse... | Computes and returns bundle base directory.
@param string $classname
@return string | [
"Computes",
"and",
"returns",
"bundle",
"base",
"directory",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L160-L173 |
192,225 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.loadConfigDefinition | public function loadConfigDefinition($configId, $baseDir)
{
if (false === $this->container->hasDefinition($configId)) {
$this->container->setDefinition($configId, $this->buildConfigDefinition($baseDir));
}
} | php | public function loadConfigDefinition($configId, $baseDir)
{
if (false === $this->container->hasDefinition($configId)) {
$this->container->setDefinition($configId, $this->buildConfigDefinition($baseDir));
}
} | [
"public",
"function",
"loadConfigDefinition",
"(",
"$",
"configId",
",",
"$",
"baseDir",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"container",
"->",
"hasDefinition",
"(",
"$",
"configId",
")",
")",
"{",
"$",
"this",
"->",
"container",
"->"... | Sets bundle's Config definition into dependency injection container.
@param string $configId
@param string $baseDir | [
"Sets",
"bundle",
"s",
"Config",
"definition",
"into",
"dependency",
"injection",
"container",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L181-L186 |
192,226 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.loadBundlesRoutes | public function loadBundlesRoutes()
{
$loadedBundles = array_keys($this->container->findTaggedServiceIds('bundle.config'));
foreach ($loadedBundles as $serviceId) {
$config = $this->container->get($serviceId);
$recipes = $this->getLoaderRecipesByConfig($config);
... | php | public function loadBundlesRoutes()
{
$loadedBundles = array_keys($this->container->findTaggedServiceIds('bundle.config'));
foreach ($loadedBundles as $serviceId) {
$config = $this->container->get($serviceId);
$recipes = $this->getLoaderRecipesByConfig($config);
... | [
"public",
"function",
"loadBundlesRoutes",
"(",
")",
"{",
"$",
"loadedBundles",
"=",
"array_keys",
"(",
"$",
"this",
"->",
"container",
"->",
"findTaggedServiceIds",
"(",
"'bundle.config'",
")",
")",
";",
"foreach",
"(",
"$",
"loadedBundles",
"as",
"$",
"servi... | Loads bundles routes into application's router. | [
"Loads",
"bundles",
"routes",
"into",
"application",
"s",
"router",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L191-L200 |
192,227 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.createEntitiesSchema | private function createEntitiesSchema(BundleInterface $bundle, $force = false)
{
if (!is_dir($entityDir = $this->getBundleEntityDir($bundle))) {
return [];
}
$bundleEntityManager = $bundle->getEntityManager();
$bundleEntityManager
->getConfiguration()
... | php | private function createEntitiesSchema(BundleInterface $bundle, $force = false)
{
if (!is_dir($entityDir = $this->getBundleEntityDir($bundle))) {
return [];
}
$bundleEntityManager = $bundle->getEntityManager();
$bundleEntityManager
->getConfiguration()
... | [
"private",
"function",
"createEntitiesSchema",
"(",
"BundleInterface",
"$",
"bundle",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"entityDir",
"=",
"$",
"this",
"->",
"getBundleEntityDir",
"(",
"$",
"bundle",
")",
")",
... | Creates SQL requests to create your bundle entities and executes them against application database
if force is equal to true.
@param BundleInterface $bundle
@param boolean $force
@return array | [
"Creates",
"SQL",
"requests",
"to",
"create",
"your",
"bundle",
"entities",
"and",
"executes",
"them",
"against",
"application",
"database",
"if",
"force",
"is",
"equal",
"to",
"true",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L270-L293 |
192,228 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.updateEntitiesSchema | private function updateEntitiesSchema(BundleInterface $bundle, $force = false)
{
if (!is_dir($entityDir = $this->getBundleEntityDir($bundle))) {
return [];
}
$bundleEntityManager = $bundle->getEntityManager();
$bundleEntityManager
->getConfiguration()
... | php | private function updateEntitiesSchema(BundleInterface $bundle, $force = false)
{
if (!is_dir($entityDir = $this->getBundleEntityDir($bundle))) {
return [];
}
$bundleEntityManager = $bundle->getEntityManager();
$bundleEntityManager
->getConfiguration()
... | [
"private",
"function",
"updateEntitiesSchema",
"(",
"BundleInterface",
"$",
"bundle",
",",
"$",
"force",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"entityDir",
"=",
"$",
"this",
"->",
"getBundleEntityDir",
"(",
"$",
"bundle",
")",
")",
... | Creates SQL requests to update your bundle entities and executes them against application database
if force is equal to true.
@param BundleInterface $bundle
@param boolean $force
@return array | [
"Creates",
"SQL",
"requests",
"to",
"update",
"your",
"bundle",
"entities",
"and",
"executes",
"them",
"against",
"application",
"database",
"if",
"force",
"is",
"equal",
"to",
"true",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L303-L326 |
192,229 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.buildBundleDefinition | private function buildBundleDefinition($classname, $bundleId, $baseDir)
{
if (false === is_subclass_of($classname, 'BackBee\Bundle\BundleInterface')) {
throw new InvalidArgumentException(
"Bundles must implement `BackBee\Bundle\BundleInterface`, `$classname` does not."
... | php | private function buildBundleDefinition($classname, $bundleId, $baseDir)
{
if (false === is_subclass_of($classname, 'BackBee\Bundle\BundleInterface')) {
throw new InvalidArgumentException(
"Bundles must implement `BackBee\Bundle\BundleInterface`, `$classname` does not."
... | [
"private",
"function",
"buildBundleDefinition",
"(",
"$",
"classname",
",",
"$",
"bundleId",
",",
"$",
"baseDir",
")",
"{",
"if",
"(",
"false",
"===",
"is_subclass_of",
"(",
"$",
"classname",
",",
"'BackBee\\Bundle\\BundleInterface'",
")",
")",
"{",
"throw",
"... | Builds and return bundle definition.
@param string $classname The bundle entry point classname
@param string $bundleId The bundle id/name
@param string $baseDir The bundle base directory
@return \Symfony\Component\DependencyInjection\Definition
@throws InvalidArgumentException if provided classname does not imple... | [
"Builds",
"and",
"return",
"bundle",
"definition",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L362-L376 |
192,230 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.loadFullBundles | private function loadFullBundles()
{
$data = [];
foreach ($this->bundlesBaseDir as $serviceId => $baseDir) {
$config = $this->loadAndGetBundleConfigByBaseDir($serviceId, $baseDir);
$bundleConfig = $config->getSection('bundle');
if (isset($bundleConfig['enable']) &... | php | private function loadFullBundles()
{
$data = [];
foreach ($this->bundlesBaseDir as $serviceId => $baseDir) {
$config = $this->loadAndGetBundleConfigByBaseDir($serviceId, $baseDir);
$bundleConfig = $config->getSection('bundle');
if (isset($bundleConfig['enable']) &... | [
"private",
"function",
"loadFullBundles",
"(",
")",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"bundlesBaseDir",
"as",
"$",
"serviceId",
"=>",
"$",
"baseDir",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"loadAndGetBun... | Executes full bundle's loading process into application's dependency injection container. | [
"Executes",
"full",
"bundle",
"s",
"loading",
"process",
"into",
"application",
"s",
"dependency",
"injection",
"container",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L381-L410 |
192,231 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.loadAndGetBundleConfigByBaseDir | private function loadAndGetBundleConfigByBaseDir($serviceId, $baseDir)
{
$configId = str_replace('%bundle_service_id%', $serviceId, BundleInterface::CONFIG_SERVICE_ID_PATTERN);
$this->loadConfigDefinition($configId, $baseDir);
$bundleConfig = $this->container->get($configId)->getBundleConfi... | php | private function loadAndGetBundleConfigByBaseDir($serviceId, $baseDir)
{
$configId = str_replace('%bundle_service_id%', $serviceId, BundleInterface::CONFIG_SERVICE_ID_PATTERN);
$this->loadConfigDefinition($configId, $baseDir);
$bundleConfig = $this->container->get($configId)->getBundleConfi... | [
"private",
"function",
"loadAndGetBundleConfigByBaseDir",
"(",
"$",
"serviceId",
",",
"$",
"baseDir",
")",
"{",
"$",
"configId",
"=",
"str_replace",
"(",
"'%bundle_service_id%'",
",",
"$",
"serviceId",
",",
"BundleInterface",
"::",
"CONFIG_SERVICE_ID_PATTERN",
")",
... | Loads and returns bundle's Config.
@param string $serviceId
@param string $baseDir
@return | [
"Loads",
"and",
"returns",
"bundle",
"s",
"Config",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L420-L432 |
192,232 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.buildConfigDefinition | private function buildConfigDefinition($baseDir)
{
$definition = new Definition('BackBee\Config\Config', array(
$this->getConfigDirByBundleBaseDir($baseDir),
new Reference('cache.bootstrap'),
null,
'%debug%',
'%config.yml_files_to_ignore%',
... | php | private function buildConfigDefinition($baseDir)
{
$definition = new Definition('BackBee\Config\Config', array(
$this->getConfigDirByBundleBaseDir($baseDir),
new Reference('cache.bootstrap'),
null,
'%debug%',
'%config.yml_files_to_ignore%',
... | [
"private",
"function",
"buildConfigDefinition",
"(",
"$",
"baseDir",
")",
"{",
"$",
"definition",
"=",
"new",
"Definition",
"(",
"'BackBee\\Config\\Config'",
",",
"array",
"(",
"$",
"this",
"->",
"getConfigDirByBundleBaseDir",
"(",
"$",
"baseDir",
")",
",",
"new... | Builds bundle Config definition.
@param string $baseDir The bundle base directory
@return \Symfony\Component\DependencyInjection\Definition | [
"Builds",
"bundle",
"Config",
"definition",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L441-L461 |
192,233 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.getConfigDirByBundleBaseDir | private function getConfigDirByBundleBaseDir($baseDir)
{
$directory = $baseDir.DIRECTORY_SEPARATOR.BundleInterface::CONFIG_DIRECTORY_NAME;
if (!is_dir($directory)) {
$directory = $baseDir.DIRECTORY_SEPARATOR.BundleInterface::OLD_CONFIG_DIRECTORY_NAME;
}
return $directory... | php | private function getConfigDirByBundleBaseDir($baseDir)
{
$directory = $baseDir.DIRECTORY_SEPARATOR.BundleInterface::CONFIG_DIRECTORY_NAME;
if (!is_dir($directory)) {
$directory = $baseDir.DIRECTORY_SEPARATOR.BundleInterface::OLD_CONFIG_DIRECTORY_NAME;
}
return $directory... | [
"private",
"function",
"getConfigDirByBundleBaseDir",
"(",
"$",
"baseDir",
")",
"{",
"$",
"directory",
"=",
"$",
"baseDir",
".",
"DIRECTORY_SEPARATOR",
".",
"BundleInterface",
"::",
"CONFIG_DIRECTORY_NAME",
";",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",
"... | Computes and returns Config base diretory.
@param string $baseDir The bundle base directory
@return string | [
"Computes",
"and",
"returns",
"Config",
"base",
"diretory",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L470-L478 |
192,234 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.getLoaderRecipesByConfig | private function getLoaderRecipesByConfig(Config $config)
{
$recipes = null;
$bundleConfig = $config->getBundleConfig();
if (null !== $bundleConfig && isset($bundleConfig['bundle_loader_recipes'])) {
$recipes = $bundleConfig['bundle_loader_recipes'];
}
return $re... | php | private function getLoaderRecipesByConfig(Config $config)
{
$recipes = null;
$bundleConfig = $config->getBundleConfig();
if (null !== $bundleConfig && isset($bundleConfig['bundle_loader_recipes'])) {
$recipes = $bundleConfig['bundle_loader_recipes'];
}
return $re... | [
"private",
"function",
"getLoaderRecipesByConfig",
"(",
"Config",
"$",
"config",
")",
"{",
"$",
"recipes",
"=",
"null",
";",
"$",
"bundleConfig",
"=",
"$",
"config",
"->",
"getBundleConfig",
"(",
")",
";",
"if",
"(",
"null",
"!==",
"$",
"bundleConfig",
"&&... | Extracts and returns bundle loader recipes from Config.
@param Config $config
@return array|null | [
"Extracts",
"and",
"returns",
"bundle",
"loader",
"recipes",
"from",
"Config",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L487-L496 |
192,235 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.getCallbackFromRecipes | private function getCallbackFromRecipes($key, array $recipes = null)
{
$recipe = null;
if (isset($recipes[$key]) && is_callable($recipes[$key])) {
$recipe = $recipes[$key];
}
return $recipe;
} | php | private function getCallbackFromRecipes($key, array $recipes = null)
{
$recipe = null;
if (isset($recipes[$key]) && is_callable($recipes[$key])) {
$recipe = $recipes[$key];
}
return $recipe;
} | [
"private",
"function",
"getCallbackFromRecipes",
"(",
"$",
"key",
",",
"array",
"$",
"recipes",
"=",
"null",
")",
"{",
"$",
"recipe",
"=",
"null",
";",
"if",
"(",
"isset",
"(",
"$",
"recipes",
"[",
"$",
"key",
"]",
")",
"&&",
"is_callable",
"(",
"$",... | Extracts and returns callback from recipes if there is one which matchs with provided key.
@param string $key
@param array $recipes
@return null|callable | [
"Extracts",
"and",
"returns",
"callback",
"from",
"recipes",
"if",
"there",
"is",
"one",
"which",
"matchs",
"with",
"provided",
"key",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L506-L514 |
192,236 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.loadServices | private function loadServices(Config $config, $serviceId, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$directories = array_unique(array_merge(
BundleConfigDirectory::getDirectories(
$this->applicat... | php | private function loadServices(Config $config, $serviceId, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$directories = array_unique(array_merge(
BundleConfigDirectory::getDirectories(
$this->applicat... | [
"private",
"function",
"loadServices",
"(",
"Config",
"$",
"config",
",",
"$",
"serviceId",
",",
"callable",
"$",
"recipe",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"runRecipe",
"(",
"$",
"config",
",",
"$",
"recipe",
")",
... | Loads bundle services into application's dependency injection container.
@param Config $config
@param string $serviceId
@param callable|null $recipe | [
"Loads",
"bundle",
"services",
"into",
"application",
"s",
"dependency",
"injection",
"container",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L523-L560 |
192,237 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.loadEvents | private function loadEvents(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$events = $config->getRawSection('events');
if (true === is_array($events) && 0 < count($events)) {
$this->application->getEventDispatcher()->add... | php | private function loadEvents(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$events = $config->getRawSection('events');
if (true === is_array($events) && 0 < count($events)) {
$this->application->getEventDispatcher()->add... | [
"private",
"function",
"loadEvents",
"(",
"Config",
"$",
"config",
",",
"callable",
"$",
"recipe",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"runRecipe",
"(",
"$",
"config",
",",
"$",
"recipe",
")",
")",
"{",
"$",
"events",... | Loads bundle's events into application's event dispatcher.
@param Config $config
@param callable|null $recipe | [
"Loads",
"bundle",
"s",
"events",
"into",
"application",
"s",
"event",
"dispatcher",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L568-L576 |
192,238 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.addClassContentDir | private function addClassContentDir(Config $config, callable $recipe = null)
{
if (null !== $recipe) {
$this->runRecipe($config, $recipe);
} else {
$directory = realpath(dirname($config->getBaseDir()).DIRECTORY_SEPARATOR.'ClassContent');
if (false !== $directory) ... | php | private function addClassContentDir(Config $config, callable $recipe = null)
{
if (null !== $recipe) {
$this->runRecipe($config, $recipe);
} else {
$directory = realpath(dirname($config->getBaseDir()).DIRECTORY_SEPARATOR.'ClassContent');
if (false !== $directory) ... | [
"private",
"function",
"addClassContentDir",
"(",
"Config",
"$",
"config",
",",
"callable",
"$",
"recipe",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"recipe",
")",
"{",
"$",
"this",
"->",
"runRecipe",
"(",
"$",
"config",
",",
"$",
"recipe",... | Adds bundle's classcontent directory into application.
@param Config $config
@param callable|null $recipe | [
"Adds",
"bundle",
"s",
"classcontent",
"directory",
"into",
"application",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L584-L594 |
192,239 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.addTemplatesDir | private function addTemplatesDir(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$directory = realpath(
dirname($config->getBaseDir()).DIRECTORY_SEPARATOR
.'Templates'.DIRECTORY_SEPARATOR.'scripts'
);
... | php | private function addTemplatesDir(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$directory = realpath(
dirname($config->getBaseDir()).DIRECTORY_SEPARATOR
.'Templates'.DIRECTORY_SEPARATOR.'scripts'
);
... | [
"private",
"function",
"addTemplatesDir",
"(",
"Config",
"$",
"config",
",",
"callable",
"$",
"recipe",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"runRecipe",
"(",
"$",
"config",
",",
"$",
"recipe",
")",
")",
"{",
"$",
"dir... | Adds bundle's templates base directory into application's renderer.
@param Config $config
@param callable|null $recipe | [
"Adds",
"bundle",
"s",
"templates",
"base",
"directory",
"into",
"application",
"s",
"renderer",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L602-L613 |
192,240 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.addHelpersDir | private function addHelpersDir(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$directory = realpath(
dirname($config->getBaseDir()).DIRECTORY_SEPARATOR
.'Templates'.DIRECTORY_SEPARATOR.'helpers'
);
... | php | private function addHelpersDir(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$directory = realpath(
dirname($config->getBaseDir()).DIRECTORY_SEPARATOR
.'Templates'.DIRECTORY_SEPARATOR.'helpers'
);
... | [
"private",
"function",
"addHelpersDir",
"(",
"Config",
"$",
"config",
",",
"callable",
"$",
"recipe",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"runRecipe",
"(",
"$",
"config",
",",
"$",
"recipe",
")",
")",
"{",
"$",
"direc... | Adds bundle's helpers directory into application's renderer.
@param Config $config
@param callable|null $recipe | [
"Adds",
"bundle",
"s",
"helpers",
"directory",
"into",
"application",
"s",
"renderer",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L621-L633 |
192,241 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.loadRoutes | private function loadRoutes(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$route = $config->getRouteConfig();
if (true === is_array($route) && 0 < count($route)) {
$this->application->getController()->registerRoutes(
... | php | private function loadRoutes(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$route = $config->getRouteConfig();
if (true === is_array($route) && 0 < count($route)) {
$this->application->getController()->registerRoutes(
... | [
"private",
"function",
"loadRoutes",
"(",
"Config",
"$",
"config",
",",
"callable",
"$",
"recipe",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"runRecipe",
"(",
"$",
"config",
",",
"$",
"recipe",
")",
")",
"{",
"$",
"route",
... | Executes loading of bundle's routes into application's front controller.
@param Config $config
@param callable|null $recipe | [
"Executes",
"loading",
"of",
"bundle",
"s",
"routes",
"into",
"application",
"s",
"front",
"controller",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L641-L652 |
192,242 | backbee/backbee-php | Bundle/BundleLoader.php | BundleLoader.addResourcesDir | private function addResourcesDir(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$baseDir = dirname($config->getBaseDir()).DIRECTORY_SEPARATOR;
$directory = realpath($baseDir.DIRECTORY_SEPARATOR.'Resources');
if (false === $... | php | private function addResourcesDir(Config $config, callable $recipe = null)
{
if (false === $this->runRecipe($config, $recipe)) {
$baseDir = dirname($config->getBaseDir()).DIRECTORY_SEPARATOR;
$directory = realpath($baseDir.DIRECTORY_SEPARATOR.'Resources');
if (false === $... | [
"private",
"function",
"addResourcesDir",
"(",
"Config",
"$",
"config",
",",
"callable",
"$",
"recipe",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"$",
"this",
"->",
"runRecipe",
"(",
"$",
"config",
",",
"$",
"recipe",
")",
")",
"{",
"$",
"bas... | Adds bundle's resources directory into application.
@param Config $config
@param callable|null $recipe | [
"Adds",
"bundle",
"s",
"resources",
"directory",
"into",
"application",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/BundleLoader.php#L660-L674 |
192,243 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.prepareCommitDraft | public function prepareCommitDraft()
{
if (null === $revision = $this->getDraft()) {
throw new Exception\RevisionMissingException('Enable to commit: missing draft');
}
switch ($revision->getState()) {
case Revision::STATE_ADDED:
case Revision::STATE_MODIF... | php | public function prepareCommitDraft()
{
if (null === $revision = $this->getDraft()) {
throw new Exception\RevisionMissingException('Enable to commit: missing draft');
}
switch ($revision->getState()) {
case Revision::STATE_ADDED:
case Revision::STATE_MODIF... | [
"public",
"function",
"prepareCommitDraft",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"revision",
"=",
"$",
"this",
"->",
"getDraft",
"(",
")",
")",
"{",
"throw",
"new",
"Exception",
"\\",
"RevisionMissingException",
"(",
"'Enable to commit: missing draft'",... | Prepares to commit an user's draft data for current content.
@return \BackBee\ClassContent\AbstractClassContent the current instance
@throws \BackBee\ClassContent\Exception\RevisionMissingException Occurs if none draft is defined
@throws \BackBee\ClassContent\Exception\RevisionConflictedExce... | [
"Prepares",
"to",
"commit",
"an",
"user",
"s",
"draft",
"data",
"for",
"current",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L316-L348 |
192,244 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.postLoad | public function postLoad()
{
$tmpModified = $this->_modified;
$this->isloaded = true;
$this->initData();
$this->_modified = $tmpModified;
} | php | public function postLoad()
{
$tmpModified = $this->_modified;
$this->isloaded = true;
$this->initData();
$this->_modified = $tmpModified;
} | [
"public",
"function",
"postLoad",
"(",
")",
"{",
"$",
"tmpModified",
"=",
"$",
"this",
"->",
"_modified",
";",
"$",
"this",
"->",
"isloaded",
"=",
"true",
";",
"$",
"this",
"->",
"initData",
"(",
")",
";",
"$",
"this",
"->",
"_modified",
"=",
"$",
... | Initialized datas on postLoad doctrine event.
@codeCoverageIgnore | [
"Initialized",
"datas",
"on",
"postLoad",
"doctrine",
"event",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L366-L372 |
192,245 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.defineData | protected function defineData($var, $type = 'scalar', $options = null, $updateAccept = true)
{
if (true === $updateAccept) {
$this->_addAcceptedType($type, $var);
}
if (!empty($options)) {
$this->defaultOptions[$var] = $options;
}
if (!array_key_exis... | php | protected function defineData($var, $type = 'scalar', $options = null, $updateAccept = true)
{
if (true === $updateAccept) {
$this->_addAcceptedType($type, $var);
}
if (!empty($options)) {
$this->defaultOptions[$var] = $options;
}
if (!array_key_exis... | [
"protected",
"function",
"defineData",
"(",
"$",
"var",
",",
"$",
"type",
"=",
"'scalar'",
",",
"$",
"options",
"=",
"null",
",",
"$",
"updateAccept",
"=",
"true",
")",
"{",
"if",
"(",
"true",
"===",
"$",
"updateAccept",
")",
"{",
"$",
"this",
"->",
... | Dynamically adds and sets new element to this content.
@param string $var The name of the element
@param string $type Optional, the type of the element, scalar by default
@param array $options Optional, initial options for the content (see this constructor)
@param Boolean $updateAccept Option... | [
"Dynamically",
"adds",
"and",
"sets",
"new",
"element",
"to",
"this",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L502-L539 |
192,246 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.defineParam | protected function defineParam($var, $default = null)
{
$values = ['value' => null];
if (!is_array($default) || !array_key_exists('value', $default)) {
$values['value'] = $default;
} else {
$values = $default;
}
if (isset($this->defaultParams[$var])) ... | php | protected function defineParam($var, $default = null)
{
$values = ['value' => null];
if (!is_array($default) || !array_key_exists('value', $default)) {
$values['value'] = $default;
} else {
$values = $default;
}
if (isset($this->defaultParams[$var])) ... | [
"protected",
"function",
"defineParam",
"(",
"$",
"var",
",",
"$",
"default",
"=",
"null",
")",
"{",
"$",
"values",
"=",
"[",
"'value'",
"=>",
"null",
"]",
";",
"if",
"(",
"!",
"is_array",
"(",
"$",
"default",
")",
"||",
"!",
"array_key_exists",
"(",... | Dynamically add and set new parameter to this content.
@param string $var the name of the element
@param string $type the type
@param array $default default option for the parameter
@return AbstractClassContent | [
"Dynamically",
"add",
"and",
"set",
"new",
"parameter",
"to",
"this",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L550-L566 |
192,247 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent._addSubcontent | protected function _addSubcontent(AbstractClassContent $value)
{
if (!$this->_subcontent->indexOf($value)) {
$this->_subcontent->add($value);
}
$this->subcontentmap[$value->getUid()] = $this->_subcontent->indexOf($value);
return $value->getUid();
} | php | protected function _addSubcontent(AbstractClassContent $value)
{
if (!$this->_subcontent->indexOf($value)) {
$this->_subcontent->add($value);
}
$this->subcontentmap[$value->getUid()] = $this->_subcontent->indexOf($value);
return $value->getUid();
} | [
"protected",
"function",
"_addSubcontent",
"(",
"AbstractClassContent",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"_subcontent",
"->",
"indexOf",
"(",
"$",
"value",
")",
")",
"{",
"$",
"this",
"->",
"_subcontent",
"->",
"add",
"(",
"$",
... | Adds a subcontent to the collection.
@param \BackBee\ClassContent\AbstractClassContent $value
@return string the unique identifier of the add subcontent | [
"Adds",
"a",
"subcontent",
"to",
"the",
"collection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L607-L616 |
192,248 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.updateSubcontentMap | private function updateSubcontentMap()
{
$this->subcontentmap = array();
$index = 0;
foreach ($this->_subcontent as $subcontent) {
$this->subcontentmap[$subcontent->getUid()] = $index++;
}
} | php | private function updateSubcontentMap()
{
$this->subcontentmap = array();
$index = 0;
foreach ($this->_subcontent as $subcontent) {
$this->subcontentmap[$subcontent->getUid()] = $index++;
}
} | [
"private",
"function",
"updateSubcontentMap",
"(",
")",
"{",
"$",
"this",
"->",
"subcontentmap",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
"->",
"_subcontent",
"as",
"$",
"subcontent",
")",
"{",
"$",
"this",... | Updates the associationing map between subcontent and uid. | [
"Updates",
"the",
"associationing",
"map",
"between",
"subcontent",
"and",
"uid",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L650-L658 |
192,249 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.getData | public function getData($var = null, $forceArray = false)
{
return null !== $this->getDraft()
? $this->getDraft()->getData($var, $forceArray)
: parent::getData($var, $forceArray)
;
} | php | public function getData($var = null, $forceArray = false)
{
return null !== $this->getDraft()
? $this->getDraft()->getData($var, $forceArray)
: parent::getData($var, $forceArray)
;
} | [
"public",
"function",
"getData",
"(",
"$",
"var",
"=",
"null",
",",
"$",
"forceArray",
"=",
"false",
")",
"{",
"return",
"null",
"!==",
"$",
"this",
"->",
"getDraft",
"(",
")",
"?",
"$",
"this",
"->",
"getDraft",
"(",
")",
"->",
"getData",
"(",
"$"... | Return the data of this content.
@param string $var The element to be return, if NULL, all datas are returned
@param Boolean $forceArray Force the return as array
@return mixed Could be either one or array of scalar, array, AbstractClassContent instance
@th... | [
"Return",
"the",
"data",
"of",
"this",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L857-L863 |
192,250 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.setParam | public function setParam($key, $value = null)
{
return null !== $this->getDraft() ? $this->getDraft()->setParam($key, $value) : parent::setParam($key, $value);
} | php | public function setParam($key, $value = null)
{
return null !== $this->getDraft() ? $this->getDraft()->setParam($key, $value) : parent::setParam($key, $value);
} | [
"public",
"function",
"setParam",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"return",
"null",
"!==",
"$",
"this",
"->",
"getDraft",
"(",
")",
"?",
"$",
"this",
"->",
"getDraft",
"(",
")",
"->",
"setParam",
"(",
"$",
"key",
",",
"... | Parameters setter.
@param string $key the parameter name to set, if NULL all the parameters array wil be set
@param mixed $value the parameter value or all the parameters if $key is NULL
@return AbstractClassContent | [
"Parameters",
"setter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L873-L877 |
192,251 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.unsetSubContent | public function unsetSubContent(AbstractClassContent $subContent)
{
foreach ($this->_data as $key => $value) {
if (is_array($value)) {
$totalContent = count($value);
foreach ($value as $cKey => $cValue) {
$contentUid = $cValue;
... | php | public function unsetSubContent(AbstractClassContent $subContent)
{
foreach ($this->_data as $key => $value) {
if (is_array($value)) {
$totalContent = count($value);
foreach ($value as $cKey => $cValue) {
$contentUid = $cValue;
... | [
"public",
"function",
"unsetSubContent",
"(",
"AbstractClassContent",
"$",
"subContent",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"_data",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
")",
"{",
"$",... | Unsets a subcontent to the current collection.
@param \BackBee\ClassContent\AbstractClassContent $subContent
@return \BackBee\ClassContent\AbstractClassContent | [
"Unsets",
"a",
"subcontent",
"to",
"the",
"current",
"collection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L923-L949 |
192,252 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.getContentByDataValue | protected function getContentByDataValue($type, $value)
{
if (class_exists($type) && null !== $value) {
$index = 0;
foreach ($this->_subcontent as $subcontent) {
$this->subcontentmap[$subcontent->getUid()] = $index++;
if ($subcontent->getUid() === $val... | php | protected function getContentByDataValue($type, $value)
{
if (class_exists($type) && null !== $value) {
$index = 0;
foreach ($this->_subcontent as $subcontent) {
$this->subcontentmap[$subcontent->getUid()] = $index++;
if ($subcontent->getUid() === $val... | [
"protected",
"function",
"getContentByDataValue",
"(",
"$",
"type",
",",
"$",
"value",
")",
"{",
"if",
"(",
"class_exists",
"(",
"$",
"type",
")",
"&&",
"null",
"!==",
"$",
"value",
")",
"{",
"$",
"index",
"=",
"0",
";",
"foreach",
"(",
"$",
"this",
... | Returns a subcontent instance by its type and value, FALSE if not found.
@param string $type The classname of the subcontent
@param string $value The value of the subcontent (uid)
@return \BackBee\ClassContent\AbstractClassContent|FALSE | [
"Returns",
"a",
"subcontent",
"instance",
"by",
"its",
"type",
"and",
"value",
"FALSE",
"if",
"not",
"found",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L959-L973 |
192,253 | backbee/backbee-php | ClassContent/AbstractClassContent.php | AbstractClassContent.getAcceptedType | public function getAcceptedType($var)
{
$accepts = ($this->getAccept());
if (isset($accepts[$var]) && !empty($accepts[$var])) {
return reset($accepts[$var]);
} else {
throw new ClassContentException(
sprintf('Unknown element %s in %s.', $var, get_class... | php | public function getAcceptedType($var)
{
$accepts = ($this->getAccept());
if (isset($accepts[$var]) && !empty($accepts[$var])) {
return reset($accepts[$var]);
} else {
throw new ClassContentException(
sprintf('Unknown element %s in %s.', $var, get_class... | [
"public",
"function",
"getAcceptedType",
"(",
"$",
"var",
")",
"{",
"$",
"accepts",
"=",
"(",
"$",
"this",
"->",
"getAccept",
"(",
")",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"accepts",
"[",
"$",
"var",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
... | Check if a variable is part of accepted types
@param mixed $var the variable to be checked
@return boolean|ClassContentException | [
"Check",
"if",
"a",
"variable",
"is",
"part",
"of",
"accepted",
"types"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractClassContent.php#L982-L993 |
192,254 | backbee/backbee-php | Cache/DAO/Entity.php | Entity.setExpire | public function setExpire(\DateTime $expire = null)
{
$this->_expire = ($expire) ? $expire : null;
return $this;
} | php | public function setExpire(\DateTime $expire = null)
{
$this->_expire = ($expire) ? $expire : null;
return $this;
} | [
"public",
"function",
"setExpire",
"(",
"\\",
"DateTime",
"$",
"expire",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_expire",
"=",
"(",
"$",
"expire",
")",
"?",
"$",
"expire",
":",
"null",
";",
"return",
"$",
"this",
";",
"}"
] | Sets the expire date time.
@param \DateTime $expire
@return \BackBee\Cache\DAO\Entity
@codeCoverageIgnore | [
"Sets",
"the",
"expire",
"date",
"time",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Cache/DAO/Entity.php#L133-L138 |
192,255 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.__isset | public function __isset($var)
{
if ($this->getContentInstance() instanceof ContentSet) {
throw new UnknownPropertyException(sprintf(
'Unknown property %s in %s.',
$var,
ClassUtils::getRealClass($this->getContentInstance())
));
}... | php | public function __isset($var)
{
if ($this->getContentInstance() instanceof ContentSet) {
throw new UnknownPropertyException(sprintf(
'Unknown property %s in %s.',
$var,
ClassUtils::getRealClass($this->getContentInstance())
));
}... | [
"public",
"function",
"__isset",
"(",
"$",
"var",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getContentInstance",
"(",
")",
"instanceof",
"ContentSet",
")",
"{",
"throw",
"new",
"UnknownPropertyException",
"(",
"sprintf",
"(",
"'Unknown property %s in %s.'",
",",
... | Magical function to check the setting of an element.
@param string $var The name of the element
@return boolean TRUE if an element is set for $var, FALSE otherwise
@throws UnknownPropertyException Occurs when $var does not match an element | [
"Magical",
"function",
"to",
"check",
"the",
"setting",
"of",
"an",
"element",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L310-L321 |
192,256 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.setParam | public function setParam($key, $value = null)
{
if (!$this->hasParam($key)) {
throw new \InvalidArgumentException(sprintf('Cannot set %s as parameter cause this key does not exist.', $key));
}
if (is_object($value)) {
throw new \InvalidArgumentException('Parameter\'s... | php | public function setParam($key, $value = null)
{
if (!$this->hasParam($key)) {
throw new \InvalidArgumentException(sprintf('Cannot set %s as parameter cause this key does not exist.', $key));
}
if (is_object($value)) {
throw new \InvalidArgumentException('Parameter\'s... | [
"public",
"function",
"setParam",
"(",
"$",
"key",
",",
"$",
"value",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasParam",
"(",
"$",
"key",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"sprintf",
"(",
"'Canno... | Sets one parameter.
@param string $key the parameter name to set
@param mixed $value the parameter value, if null is passed it will unset provided key parameter
@return AbstractContent The current instance | [
"Sets",
"one",
"parameter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L513-L549 |
192,257 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.setAllParams | public function setAllParams(array $params)
{
foreach ($params as $key => $value) {
$this->setParam($key, $value);
}
return $this;
} | php | public function setAllParams(array $params)
{
foreach ($params as $key => $value) {
$this->setParam($key, $value);
}
return $this;
} | [
"public",
"function",
"setAllParams",
"(",
"array",
"$",
"params",
")",
"{",
"foreach",
"(",
"$",
"params",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"setParam",
"(",
"$",
"key",
",",
"$",
"value",
")",
";",
"}",
"return",
... | Sets all parameters.
@param array $params
@return AbstractContent | [
"Sets",
"all",
"parameters",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L558-L565 |
192,258 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.setCreated | public function setCreated(\DateTime $created = null)
{
$this->_created = null === $created ? new \DateTime() : $created;
return $this->getContentInstance();
} | php | public function setCreated(\DateTime $created = null)
{
$this->_created = null === $created ? new \DateTime() : $created;
return $this->getContentInstance();
} | [
"public",
"function",
"setCreated",
"(",
"\\",
"DateTime",
"$",
"created",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_created",
"=",
"null",
"===",
"$",
"created",
"?",
"new",
"\\",
"DateTime",
"(",
")",
":",
"$",
"created",
";",
"return",
"$",
"thi... | Sets creation date.
@param \DateTime $created Current date time by default
@return \BackBee\ClassContent\AbstractContent The current instance
@codeCoverageIgnore | [
"Sets",
"creation",
"date",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L605-L610 |
192,259 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.setModified | public function setModified(\DateTime $modified = null)
{
$this->_modified = null === $modified ? new \DateTime() : $modified;
return $this->getContentInstance();
} | php | public function setModified(\DateTime $modified = null)
{
$this->_modified = null === $modified ? new \DateTime() : $modified;
return $this->getContentInstance();
} | [
"public",
"function",
"setModified",
"(",
"\\",
"DateTime",
"$",
"modified",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"_modified",
"=",
"null",
"===",
"$",
"modified",
"?",
"new",
"\\",
"DateTime",
"(",
")",
":",
"$",
"modified",
";",
"return",
"$",
... | Sets the last modification date.
@param DateTime $modified Current date time by default
@return \BackBee\ClassContent\AbstractContent The current instance
@codeCoverageIgnore | [
"Sets",
"the",
"last",
"modification",
"date",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L620-L625 |
192,260 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.acceptSubcontent | public function acceptSubcontent($var)
{
if (!array_key_exists($var, $this->_accept)) {
return false;
}
foreach ($this->_accept[$var] as $type) {
if (!in_array($type, ['scalar', 'array'])) {
return true;
}
}
return false;
... | php | public function acceptSubcontent($var)
{
if (!array_key_exists($var, $this->_accept)) {
return false;
}
foreach ($this->_accept[$var] as $type) {
if (!in_array($type, ['scalar', 'array'])) {
return true;
}
}
return false;
... | [
"public",
"function",
"acceptSubcontent",
"(",
"$",
"var",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"var",
",",
"$",
"this",
"->",
"_accept",
")",
")",
"{",
"return",
"false",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"_accept",
"["... | Checks if the element accept subcontent.
@param string $var the element
@return Boolean TRUE if a subcontents are accepted, FALSE otherwise | [
"Checks",
"if",
"the",
"element",
"accept",
"subcontent",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L678-L691 |
192,261 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.isAccepted | public function isAccepted($value, $var = null)
{
if ($this->getContentInstance() instanceof ContentSet) {
if (!($value instanceof AbstractClassContent)) {
// ContentSet accepts only AbstractClassContent elements
return false;
}
if (in_arr... | php | public function isAccepted($value, $var = null)
{
if ($this->getContentInstance() instanceof ContentSet) {
if (!($value instanceof AbstractClassContent)) {
// ContentSet accepts only AbstractClassContent elements
return false;
}
if (in_arr... | [
"public",
"function",
"isAccepted",
"(",
"$",
"value",
",",
"$",
"var",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getContentInstance",
"(",
")",
"instanceof",
"ContentSet",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"value",
"instanceof",
"Abstrac... | Checks for an accepted type.
@param mixed $value the value from which the type will be checked
@param string $var the element to be checks
@return Boolean | [
"Checks",
"for",
"an",
"accepted",
"type",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L708-L739 |
192,262 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent._getType | protected function _getType($value)
{
if (is_object($value)) {
try {
return self::getShortClassname($value);
} catch (\InvalidArgumentException $e) {
return null;
}
}
if (is_array($value)) {
return 'array';
... | php | protected function _getType($value)
{
if (is_object($value)) {
try {
return self::getShortClassname($value);
} catch (\InvalidArgumentException $e) {
return null;
}
}
if (is_array($value)) {
return 'array';
... | [
"protected",
"function",
"_getType",
"(",
"$",
"value",
")",
"{",
"if",
"(",
"is_object",
"(",
"$",
"value",
")",
")",
"{",
"try",
"{",
"return",
"self",
"::",
"getShortClassname",
"(",
"$",
"value",
")",
";",
"}",
"catch",
"(",
"\\",
"InvalidArgumentE... | Returns the type of a given value, either classname, array or scalar.
@param mixed $value
@return string | [
"Returns",
"the",
"type",
"of",
"a",
"given",
"value",
"either",
"classname",
"array",
"or",
"scalar",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L793-L808 |
192,263 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.equals | public function equals(ObjectIdentifiableInterface $identity)
{
return ($this->getType() === $identity->getType() && $this->getIdentifier() === $identity->getIdentifier());
} | php | public function equals(ObjectIdentifiableInterface $identity)
{
return ($this->getType() === $identity->getType() && $this->getIdentifier() === $identity->getIdentifier());
} | [
"public",
"function",
"equals",
"(",
"ObjectIdentifiableInterface",
"$",
"identity",
")",
"{",
"return",
"(",
"$",
"this",
"->",
"getType",
"(",
")",
"===",
"$",
"identity",
"->",
"getType",
"(",
")",
"&&",
"$",
"this",
"->",
"getIdentifier",
"(",
")",
"... | Checks for an explicit objects equality.
@param \BackBee\Security\Acl\Domain\ObjectIdentifiableInterface $identity
@return Boolean
@see \BackBee\Security\Acl\Domain\IObjectIdentifiable
@codeCoverageIgnore | [
"Checks",
"for",
"an",
"explicit",
"objects",
"equality",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L881-L884 |
192,264 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.getData | public function getData($var = null, $forceArray = false)
{
if (null === $var) {
$datas = array();
foreach (array_keys($this->_data) as $key) {
$datas[$key] = $this->getData($key);
}
return $datas;
}
if (!array_key_exists($var... | php | public function getData($var = null, $forceArray = false)
{
if (null === $var) {
$datas = array();
foreach (array_keys($this->_data) as $key) {
$datas[$key] = $this->getData($key);
}
return $datas;
}
if (!array_key_exists($var... | [
"public",
"function",
"getData",
"(",
"$",
"var",
"=",
"null",
",",
"$",
"forceArray",
"=",
"false",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"var",
")",
"{",
"$",
"datas",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"array_keys",
"(",
"$",
"thi... | Returns the set of data.
@param string $var The element to be return, if NULL, all datas are returned
@param boolean $forceArray Force the return as array
@return mixed Could be either one or array of scalar, array, AbstractClassContent instance
@throws UnknownPropertyException Occurs when $var does not match... | [
"Returns",
"the",
"set",
"of",
"data",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L908-L974 |
192,265 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.getFirstElementOfType | public function getFirstElementOfType($classnames)
{
if (!is_array($classnames)) {
$classnames = array($classnames);
}
foreach (array_keys($this->_data) as $key) {
$element = $this->getData($key);
if (!is_object($element)) {
continue;
... | php | public function getFirstElementOfType($classnames)
{
if (!is_array($classnames)) {
$classnames = array($classnames);
}
foreach (array_keys($this->_data) as $key) {
$element = $this->getData($key);
if (!is_object($element)) {
continue;
... | [
"public",
"function",
"getFirstElementOfType",
"(",
"$",
"classnames",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"classnames",
")",
")",
"{",
"$",
"classnames",
"=",
"array",
"(",
"$",
"classnames",
")",
";",
"}",
"foreach",
"(",
"array_keys",
"(",... | Returns the first element of one of the provided class is exists.
@param mixed $classnames
@return AbstractClassContent|NULL | [
"Returns",
"the",
"first",
"element",
"of",
"one",
"of",
"the",
"provided",
"class",
"is",
"exists",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L995-L1014 |
192,266 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.getParam | public function getParam($key)
{
if (!$this->hasParam($key)) {
return null;
}
$param = $this->getDefaultParams()[$key];
$value = null;
if (isset($this->_parameters[$key])) {
$value = $this->_parameters[$key];
if (!is_array($value) || !arr... | php | public function getParam($key)
{
if (!$this->hasParam($key)) {
return null;
}
$param = $this->getDefaultParams()[$key];
$value = null;
if (isset($this->_parameters[$key])) {
$value = $this->_parameters[$key];
if (!is_array($value) || !arr... | [
"public",
"function",
"getParam",
"(",
"$",
"key",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasParam",
"(",
"$",
"key",
")",
")",
"{",
"return",
"null",
";",
"}",
"$",
"param",
"=",
"$",
"this",
"->",
"getDefaultParams",
"(",
")",
"[",
"$",
... | Returns parameters if requested key exist.
@param string $key The parameter to be return, if NULL, all parameters are returned
@return null|array The parameter value or NULL if unfound
@throws MalformedParameterException Raises if the parameter is malformed. | [
"Returns",
"parameters",
"if",
"requested",
"key",
"exist",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L1038-L1059 |
192,267 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.getParamValue | public function getParamValue($key)
{
$value = null;
if (is_array($param = $this->getParam($key))) {
$value = $param['value'];
}
return $value;
} | php | public function getParamValue($key)
{
$value = null;
if (is_array($param = $this->getParam($key))) {
$value = $param['value'];
}
return $value;
} | [
"public",
"function",
"getParamValue",
"(",
"$",
"key",
")",
"{",
"$",
"value",
"=",
"null",
";",
"if",
"(",
"is_array",
"(",
"$",
"param",
"=",
"$",
"this",
"->",
"getParam",
"(",
"$",
"key",
")",
")",
")",
"{",
"$",
"value",
"=",
"$",
"param",
... | Returns the parameter's value.
@param string $key
@return mixed | [
"Returns",
"the",
"parameter",
"s",
"value",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L1068-L1076 |
192,268 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.getAllParams | public function getAllParams()
{
$params = [];
foreach ($this->getDefaultParams() as $key => $value) {
$params[$key] = $value;
if (isset($this->_parameters[$key]['value'])) {
$params[$key]['value'] = $this->_parameters[$key]['value'];
}
}
... | php | public function getAllParams()
{
$params = [];
foreach ($this->getDefaultParams() as $key => $value) {
$params[$key] = $value;
if (isset($this->_parameters[$key]['value'])) {
$params[$key]['value'] = $this->_parameters[$key]['value'];
}
}
... | [
"public",
"function",
"getAllParams",
"(",
")",
"{",
"$",
"params",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getDefaultParams",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"$",
"params",
"[",
"$",
"key",
"]",
"=",
"$"... | Returns all parameters.
@return array | [
"Returns",
"all",
"parameters",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L1083-L1095 |
192,269 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.getProperty | public function getProperty($var = null)
{
if (null === $var) {
return $this->properties;
}
if (isset($this->properties[$var])) {
return $this->properties[$var];
}
return;
} | php | public function getProperty($var = null)
{
if (null === $var) {
return $this->properties;
}
if (isset($this->properties[$var])) {
return $this->properties[$var];
}
return;
} | [
"public",
"function",
"getProperty",
"(",
"$",
"var",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"var",
")",
"{",
"return",
"$",
"this",
"->",
"properties",
";",
"}",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"properties",
"[",
"$",
... | Returns defined property of the content or all the properties.
@param string $var the property to be return, if NULL, all properties are returned
@return mixed The property value or NULL if unfound | [
"Returns",
"defined",
"property",
"of",
"the",
"content",
"or",
"all",
"the",
"properties",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L1150-L1161 |
192,270 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.defineProperty | protected function defineProperty($var, $value)
{
if (!array_key_exists($var, $this->properties)) {
$this->properties[$var] = $value;
}
return $this->setOptions($this->properties);
} | php | protected function defineProperty($var, $value)
{
if (!array_key_exists($var, $this->properties)) {
$this->properties[$var] = $value;
}
return $this->setOptions($this->properties);
} | [
"protected",
"function",
"defineProperty",
"(",
"$",
"var",
",",
"$",
"value",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"var",
",",
"$",
"this",
"->",
"properties",
")",
")",
"{",
"$",
"this",
"->",
"properties",
"[",
"$",
"var",
"]",
... | Dynamically adds and sets new property to this content.
@param string $var the name of the property
@param mixed $value the value of the property
@return \BackBee\ClassContent\AbstractClassContent The current instance | [
"Dynamically",
"adds",
"and",
"sets",
"new",
"property",
"to",
"this",
"content",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L1186-L1193 |
192,271 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.jsonSerialize | public function jsonSerialize($format = self::JSON_DEFAULT_FORMAT)
{
$data = [
'uid' => $this->_uid,
'label' => $this->_label,
'type' => $this->getContentType(),
'state' => $this->_state,
'created' => $this->_created->getT... | php | public function jsonSerialize($format = self::JSON_DEFAULT_FORMAT)
{
$data = [
'uid' => $this->_uid,
'label' => $this->_label,
'type' => $this->getContentType(),
'state' => $this->_state,
'created' => $this->_created->getT... | [
"public",
"function",
"jsonSerialize",
"(",
"$",
"format",
"=",
"self",
"::",
"JSON_DEFAULT_FORMAT",
")",
"{",
"$",
"data",
"=",
"[",
"'uid'",
"=>",
"$",
"this",
"->",
"_uid",
",",
"'label'",
"=>",
"$",
"this",
"->",
"_label",
",",
"'type'",
"=>",
"$",... | Computes an array that contains current content data; it can also lighten result according to
requested format.
@param integer $format
@return array | [
"Computes",
"an",
"array",
"that",
"contains",
"current",
"content",
"data",
";",
"it",
"can",
"also",
"lighten",
"result",
"according",
"to",
"requested",
"format",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L1203-L1232 |
192,272 | backbee/backbee-php | ClassContent/AbstractContent.php | AbstractContent.formatJsonData | private function formatJsonData(array $data, $format)
{
if (self::JSON_DEFINITION_FORMAT === $format || self::JSON_CONCISE_FORMAT === $format) {
unset($data['state'], $data['created'], $data['modified'], $data['revision']);
}
if (self::JSON_INFO_FORMAT === $format || self::JSON_... | php | private function formatJsonData(array $data, $format)
{
if (self::JSON_DEFINITION_FORMAT === $format || self::JSON_CONCISE_FORMAT === $format) {
unset($data['state'], $data['created'], $data['modified'], $data['revision']);
}
if (self::JSON_INFO_FORMAT === $format || self::JSON_... | [
"private",
"function",
"formatJsonData",
"(",
"array",
"$",
"data",
",",
"$",
"format",
")",
"{",
"if",
"(",
"self",
"::",
"JSON_DEFINITION_FORMAT",
"===",
"$",
"format",
"||",
"self",
"::",
"JSON_CONCISE_FORMAT",
"===",
"$",
"format",
")",
"{",
"unset",
"... | This method will lighten provided data into requested format, if format is equal to 0 this method
won't transform anything.
@param array $data
@param integer $format
@return array | [
"This",
"method",
"will",
"lighten",
"provided",
"data",
"into",
"requested",
"format",
"if",
"format",
"is",
"equal",
"to",
"0",
"this",
"method",
"won",
"t",
"transform",
"anything",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/ClassContent/AbstractContent.php#L1270-L1291 |
192,273 | backbee/backbee-php | Security/Context/RestfulContext.php | RestfulContext.getApiUserRole | private function getApiUserRole()
{
$apiUserRole = null;
$container = $this->_context->getApplication()->getContainer();
if ($container->hasParameter('bbapp.securitycontext.role.apiuser')) {
$apiUserRole = $container->getParameter('bbapp.securitycontext.role.apiuser');
... | php | private function getApiUserRole()
{
$apiUserRole = null;
$container = $this->_context->getApplication()->getContainer();
if ($container->hasParameter('bbapp.securitycontext.role.apiuser')) {
$apiUserRole = $container->getParameter('bbapp.securitycontext.role.apiuser');
... | [
"private",
"function",
"getApiUserRole",
"(",
")",
"{",
"$",
"apiUserRole",
"=",
"null",
";",
"$",
"container",
"=",
"$",
"this",
"->",
"_context",
"->",
"getApplication",
"(",
")",
"->",
"getContainer",
"(",
")",
";",
"if",
"(",
"$",
"container",
"->",
... | Gets the API user role from container
@return string | [
"Gets",
"the",
"API",
"user",
"role",
"from",
"container"
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Context/RestfulContext.php#L101-L115 |
192,274 | backbee/backbee-php | Security/Context/RestfulContext.php | RestfulContext.loadLogoutListener | private function loadLogoutListener(AuthenticationProviderInterface $bbProvider)
{
if (null === $this->_context->getLogoutListener()) {
$httpUtils = new HttpUtils();
$this->_context->setLogoutListener(
new LogoutListener($this->_context, $httpUtils, new BBLogoutSucces... | php | private function loadLogoutListener(AuthenticationProviderInterface $bbProvider)
{
if (null === $this->_context->getLogoutListener()) {
$httpUtils = new HttpUtils();
$this->_context->setLogoutListener(
new LogoutListener($this->_context, $httpUtils, new BBLogoutSucces... | [
"private",
"function",
"loadLogoutListener",
"(",
"AuthenticationProviderInterface",
"$",
"bbProvider",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"_context",
"->",
"getLogoutListener",
"(",
")",
")",
"{",
"$",
"httpUtils",
"=",
"new",
"HttpUtils",
... | Load LogoutListener into security context.
@param AuthenticationProviderInterface $bbProvider | [
"Load",
"LogoutListener",
"into",
"security",
"context",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Context/RestfulContext.php#L122-L132 |
192,275 | backbee/backbee-php | Security/Context/RestfulContext.php | RestfulContext.getRegistryRepository | private function getRegistryRepository()
{
$repository = null;
if (null !== $em = $this->_context->getApplication()->getEntityManager()) {
$repository = $em->getRepository('BackBee\Bundle\Registry');
}
return $repository;
} | php | private function getRegistryRepository()
{
$repository = null;
if (null !== $em = $this->_context->getApplication()->getEntityManager()) {
$repository = $em->getRepository('BackBee\Bundle\Registry');
}
return $repository;
} | [
"private",
"function",
"getRegistryRepository",
"(",
")",
"{",
"$",
"repository",
"=",
"null",
";",
"if",
"(",
"null",
"!==",
"$",
"em",
"=",
"$",
"this",
"->",
"_context",
"->",
"getApplication",
"(",
")",
"->",
"getEntityManager",
"(",
")",
")",
"{",
... | Returns the repository to Registry entities.
@return \BackBuillder\Bundle\Registry\Repository | [
"Returns",
"the",
"repository",
"to",
"Registry",
"entities",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Security/Context/RestfulContext.php#L151-L159 |
192,276 | backbee/backbee-php | Util/Ftp.php | Ftp.doChangeDir | protected function doChangeDir($dir)
{
$connection = $this->connection;
return $this->retry(function () use ($connection, $dir) {
$res = @ftp_chdir($connection, $dir);
if (false === $res) {
throw new \RuntimeException("Changing directory failed: ".$dir);
... | php | protected function doChangeDir($dir)
{
$connection = $this->connection;
return $this->retry(function () use ($connection, $dir) {
$res = @ftp_chdir($connection, $dir);
if (false === $res) {
throw new \RuntimeException("Changing directory failed: ".$dir);
... | [
"protected",
"function",
"doChangeDir",
"(",
"$",
"dir",
")",
"{",
"$",
"connection",
"=",
"$",
"this",
"->",
"connection",
";",
"return",
"$",
"this",
"->",
"retry",
"(",
"function",
"(",
")",
"use",
"(",
"$",
"connection",
",",
"$",
"dir",
")",
"{"... | Change current working directory.
@param string dir name
@return bool | [
"Change",
"current",
"working",
"directory",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Ftp.php#L322-L333 |
192,277 | backbee/backbee-php | Util/Ftp.php | Ftp.isDir | protected function isDir($dir)
{
try {
$this->doChangeDir($dir);
$this->doCdUp();
return true;
} catch (\Exception $ex) {
return false;
}
return false;
} | php | protected function isDir($dir)
{
try {
$this->doChangeDir($dir);
$this->doCdUp();
return true;
} catch (\Exception $ex) {
return false;
}
return false;
} | [
"protected",
"function",
"isDir",
"(",
"$",
"dir",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"doChangeDir",
"(",
"$",
"dir",
")",
";",
"$",
"this",
"->",
"doCdUp",
"(",
")",
";",
"return",
"true",
";",
"}",
"catch",
"(",
"\\",
"Exception",
"$",
"e... | Check if is dir.
@param string path to folder
@return bool | [
"Check",
"if",
"is",
"dir",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Ftp.php#L342-L354 |
192,278 | backbee/backbee-php | Util/Ftp.php | Ftp.disconnect | public function disconnect()
{
for ($i = 0; $i < $this->getParam('retryAttempts') + 1; $i++) {
$res = @ftp_close($this->connection);
if (false !== $res) {
$this->connection = null;
break;
}
}
return $this;
} | php | public function disconnect()
{
for ($i = 0; $i < $this->getParam('retryAttempts') + 1; $i++) {
$res = @ftp_close($this->connection);
if (false !== $res) {
$this->connection = null;
break;
}
}
return $this;
} | [
"public",
"function",
"disconnect",
"(",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"0",
";",
"$",
"i",
"<",
"$",
"this",
"->",
"getParam",
"(",
"'retryAttempts'",
")",
"+",
"1",
";",
"$",
"i",
"++",
")",
"{",
"$",
"res",
"=",
"@",
"ftp_close",
"(",
... | Close ftp connection.
@return self | [
"Close",
"ftp",
"connection",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Util/Ftp.php#L370-L382 |
192,279 | backbee/backbee-php | DependencyInjection/Util/ServiceLoader.php | ServiceLoader.loadServicesFromYamlFile | public static function loadServicesFromYamlFile(Container $container, $dir, $service_filename = null)
{
if (null === $service_filename) {
$service_filename = ContainerBuilder::SERVICE_FILENAME;
}
(new YamlFileLoader($container, new FileLocator((array) $dir)))->load($service_file... | php | public static function loadServicesFromYamlFile(Container $container, $dir, $service_filename = null)
{
if (null === $service_filename) {
$service_filename = ContainerBuilder::SERVICE_FILENAME;
}
(new YamlFileLoader($container, new FileLocator((array) $dir)))->load($service_file... | [
"public",
"static",
"function",
"loadServicesFromYamlFile",
"(",
"Container",
"$",
"container",
",",
"$",
"dir",
",",
"$",
"service_filename",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"service_filename",
")",
"{",
"$",
"service_filename",
"=",
"... | Load services from yaml file into your container.
@param Container $container the container we want to load services into
@param string|array $dir directory (or directories) in where we can find services files
@param string|null $service_filename define the service's filename we want to load,
d... | [
"Load",
"services",
"from",
"yaml",
"file",
"into",
"your",
"container",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/Util/ServiceLoader.php#L50-L57 |
192,280 | backbee/backbee-php | DependencyInjection/Util/ServiceLoader.php | ServiceLoader.loadServicesFromXmlFile | public static function loadServicesFromXmlFile(Container $container, $dir, $service_filename = null)
{
if (null === $service_filename) {
$service_filename = ContainerBuilder::SERVICE_FILENAME;
}
(new XmlFileLoader($container, new FileLocator((array) $dir)))->load($service_filena... | php | public static function loadServicesFromXmlFile(Container $container, $dir, $service_filename = null)
{
if (null === $service_filename) {
$service_filename = ContainerBuilder::SERVICE_FILENAME;
}
(new XmlFileLoader($container, new FileLocator((array) $dir)))->load($service_filena... | [
"public",
"static",
"function",
"loadServicesFromXmlFile",
"(",
"Container",
"$",
"container",
",",
"$",
"dir",
",",
"$",
"service_filename",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"service_filename",
")",
"{",
"$",
"service_filename",
"=",
"C... | Load services from xml file into your container.
@param Container $container the container we want to load services into
@param string|array $dir directory (or directories) in where we can find services files
@param string|null $service_filename define the service's filename we want to load,
de... | [
"Load",
"services",
"from",
"xml",
"file",
"into",
"your",
"container",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/DependencyInjection/Util/ServiceLoader.php#L67-L74 |
192,281 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.findBy | public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
{
if (
false === PageQueryBuilder::hasJoinCriteria($criteria) &&
false === PageQueryBuilder::hasJoinCriteria($orderBy)
) {
return parent::findBy($criteria, $order... | php | public function findBy(array $criteria, array $orderBy = null, $limit = null, $offset = null)
{
if (
false === PageQueryBuilder::hasJoinCriteria($criteria) &&
false === PageQueryBuilder::hasJoinCriteria($orderBy)
) {
return parent::findBy($criteria, $order... | [
"public",
"function",
"findBy",
"(",
"array",
"$",
"criteria",
",",
"array",
"$",
"orderBy",
"=",
"null",
",",
"$",
"limit",
"=",
"null",
",",
"$",
"offset",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"PageQueryBuilder",
"::",
"hasJoinCriteria",
... | Finds entities by a set of criteria with automatic join on section if need due to retro-compatibility.
@param array $criteria An array of criteria ( field => value ).
@param array|null $orderBy Optional, an array of ordering criteria ( [field => direction] ).
@param int... | [
"Finds",
"entities",
"by",
"a",
"set",
"of",
"criteria",
"with",
"automatic",
"join",
"on",
"section",
"if",
"need",
"due",
"to",
"retro",
"-",
"compatibility",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L73-L93 |
192,282 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.findOneBy | public function findOneBy(array $criteria, array $orderBy = null)
{
if (
false === PageQueryBuilder::hasJoinCriteria($criteria) &&
false === PageQueryBuilder::hasJoinCriteria($orderBy)
) {
return parent::findOneBy($criteria, $orderBy);
}
$... | php | public function findOneBy(array $criteria, array $orderBy = null)
{
if (
false === PageQueryBuilder::hasJoinCriteria($criteria) &&
false === PageQueryBuilder::hasJoinCriteria($orderBy)
) {
return parent::findOneBy($criteria, $orderBy);
}
$... | [
"public",
"function",
"findOneBy",
"(",
"array",
"$",
"criteria",
",",
"array",
"$",
"orderBy",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"===",
"PageQueryBuilder",
"::",
"hasJoinCriteria",
"(",
"$",
"criteria",
")",
"&&",
"false",
"===",
"PageQueryBuilder"... | Finds a single entity by a set of criteria with automatic join on section if need due to retro-compatibility.
@param array $criteria An array of criteria.
@param array|null $orderBy Optional, an array of ordering criteria.
@return object|null ... | [
"Finds",
"a",
"single",
"entity",
"by",
"a",
"set",
"of",
"criteria",
"with",
"automatic",
"join",
"on",
"section",
"if",
"need",
"due",
"to",
"retro",
"-",
"compatibility",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L103-L121 |
192,283 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.getAncestors | public function getAncestors(Page $page, $depth = null, $includeNode = false)
{
$q = $this->createQueryBuilder('p')
->andIsAncestorOf($page, !$includeNode, null === $depth ? null : $page->getLevel() - $depth);
$results = $q->orderBy($q->getSectionAlias().'._leftnode', 'asc')
... | php | public function getAncestors(Page $page, $depth = null, $includeNode = false)
{
$q = $this->createQueryBuilder('p')
->andIsAncestorOf($page, !$includeNode, null === $depth ? null : $page->getLevel() - $depth);
$results = $q->orderBy($q->getSectionAlias().'._leftnode', 'asc')
... | [
"public",
"function",
"getAncestors",
"(",
"Page",
"$",
"page",
",",
"$",
"depth",
"=",
"null",
",",
"$",
"includeNode",
"=",
"false",
")",
"{",
"$",
"q",
"=",
"$",
"this",
"->",
"createQueryBuilder",
"(",
"'p'",
")",
"->",
"andIsAncestorOf",
"(",
"$",... | Returns the ancestors of the provided page.
@param Page $page The page to look for ancestors.
@param integer|null $depth Optional, limits results to ancestors from $depth number of generation.
@param boolean $includeNode Optional, include the no... | [
"Returns",
"the",
"ancestors",
"of",
"the",
"provided",
"page",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L156-L170 |
192,284 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.insertNodeAsFirstChildOf | public function insertNodeAsFirstChildOf(Page $page, Page $parent, $section = false)
{
return $this->insertNode($page, $parent, 1, $section);
} | php | public function insertNodeAsFirstChildOf(Page $page, Page $parent, $section = false)
{
return $this->insertNode($page, $parent, 1, $section);
} | [
"public",
"function",
"insertNodeAsFirstChildOf",
"(",
"Page",
"$",
"page",
",",
"Page",
"$",
"parent",
",",
"$",
"section",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"insertNode",
"(",
"$",
"page",
",",
"$",
"parent",
",",
"1",
",",
"$",
... | Inserts a page in a tree at first position.
@param Page $page The page to be inserted.
@param Page $parent The parent node.
@param boolean $section If true, the page is inserted with a section (false by default).
@return Page ... | [
"Inserts",
"a",
"page",
"in",
"a",
"tree",
"at",
"first",
"position",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L265-L268 |
192,285 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.insertNodeAsLastChildOf | public function insertNodeAsLastChildOf(Page $page, Page $parent, $section = false)
{
return $this->insertNode($page, $parent, $this->getMaxPosition($parent) + 1, $section);
} | php | public function insertNodeAsLastChildOf(Page $page, Page $parent, $section = false)
{
return $this->insertNode($page, $parent, $this->getMaxPosition($parent) + 1, $section);
} | [
"public",
"function",
"insertNodeAsLastChildOf",
"(",
"Page",
"$",
"page",
",",
"Page",
"$",
"parent",
",",
"$",
"section",
"=",
"false",
")",
"{",
"return",
"$",
"this",
"->",
"insertNode",
"(",
"$",
"page",
",",
"$",
"parent",
",",
"$",
"this",
"->",... | Inserts a page in a tree at last position.
@param Page $page The page to be inserted.
@param Page $parent The parent node.
@param boolean $section If true, the page is inserted with a section (false by default).
@return Page ... | [
"Inserts",
"a",
"page",
"in",
"a",
"tree",
"at",
"last",
"position",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L279-L282 |
192,286 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.insertNode | public function insertNode(Page $page, Page $parent, $position, $section = false)
{
if (!$parent->hasMainSection()) {
throw new InvalidArgumentException('Parent page is not a section.');
}
$current_parent = $page->getSection();
$page->setParent($parent)
-... | php | public function insertNode(Page $page, Page $parent, $position, $section = false)
{
if (!$parent->hasMainSection()) {
throw new InvalidArgumentException('Parent page is not a section.');
}
$current_parent = $page->getSection();
$page->setParent($parent)
-... | [
"public",
"function",
"insertNode",
"(",
"Page",
"$",
"page",
",",
"Page",
"$",
"parent",
",",
"$",
"position",
",",
"$",
"section",
"=",
"false",
")",
"{",
"if",
"(",
"!",
"$",
"parent",
"->",
"hasMainSection",
"(",
")",
")",
"{",
"throw",
"new",
... | Inserts a page in a tree.
@param Page $page The page to be inserted.
@param Page $parent The parent node.
@param integer $position The position of the inserted page
@param boolean $section If true, the page is ... | [
"Inserts",
"a",
"page",
"in",
"a",
"tree",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L296-L316 |
192,287 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.getOrderingDescendants | private function getOrderingDescendants($depth = null, $order = [])
{
if (1 === $depth && true === empty($order)) {
$order = [
'_position' => 'ASC',
'_leftnode' => 'ASC',
];
} elseif (true === empty($order)) {
$order = [
... | php | private function getOrderingDescendants($depth = null, $order = [])
{
if (1 === $depth && true === empty($order)) {
$order = [
'_position' => 'ASC',
'_leftnode' => 'ASC',
];
} elseif (true === empty($order)) {
$order = [
... | [
"private",
"function",
"getOrderingDescendants",
"(",
"$",
"depth",
"=",
"null",
",",
"$",
"order",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"1",
"===",
"$",
"depth",
"&&",
"true",
"===",
"empty",
"(",
"$",
"order",
")",
")",
"{",
"$",
"order",
"=",
"... | Returns default ordering criteria for descendants if none provided.
@param integer|null $depth Optional, limit to $depth number of generation.
@param array $order Optional, the ordering criteria ( [] by default ).
@return array If n... | [
"Returns",
"default",
"ordering",
"criteria",
"for",
"descendants",
"if",
"none",
"provided",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L330-L346 |
192,288 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.copy | private function copy(Page $page, $title = null, Page $parent = null)
{
if (Page::STATE_DELETED & $page->getState()) {
throw new InvalidArgumentException('Cannot duplicate a deleted page.');
}
// Cloning the page
$new_page = clone $page;
$new_page->setTitle((null... | php | private function copy(Page $page, $title = null, Page $parent = null)
{
if (Page::STATE_DELETED & $page->getState()) {
throw new InvalidArgumentException('Cannot duplicate a deleted page.');
}
// Cloning the page
$new_page = clone $page;
$new_page->setTitle((null... | [
"private",
"function",
"copy",
"(",
"Page",
"$",
"page",
",",
"$",
"title",
"=",
"null",
",",
"Page",
"$",
"parent",
"=",
"null",
")",
"{",
"if",
"(",
"Page",
"::",
"STATE_DELETED",
"&",
"$",
"page",
"->",
"getState",
"(",
")",
")",
"{",
"throw",
... | Copy a page to a new one.
@param Page $page The page to be copied.
@param string|null $title Optional, the title of the copy, if null (default) the title of the copied page.
@param Page|null $parent Optional, the parent of the copy, if null ... | [
"Copy",
"a",
"page",
"to",
"a",
"new",
"one",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L835-L855 |
192,289 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.updateRelatedPostCloning | private function updateRelatedPostCloning(AbstractClassContent $content, array $cloningData, BBUserToken $token = null)
{
if (
$content instanceof ContentSet &&
true === array_key_exists('pages', $cloningData) &&
true === array_key_exists('contents', $cloningD... | php | private function updateRelatedPostCloning(AbstractClassContent $content, array $cloningData, BBUserToken $token = null)
{
if (
$content instanceof ContentSet &&
true === array_key_exists('pages', $cloningData) &&
true === array_key_exists('contents', $cloningD... | [
"private",
"function",
"updateRelatedPostCloning",
"(",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"cloningData",
",",
"BBUserToken",
"$",
"token",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"content",
"instanceof",
"ContentSet",
"&&",
"true",
"===",... | Replace subcontent of ContentSet by their clone if exist.
@param AbstractClassContent $content The cloned content.
@param array $cloningData The cloned data array.
@param BBUserToken|null $token Optional, the BBuser token to allow the update of revisions if set.
@r... | [
"Replace",
"subcontent",
"of",
"ContentSet",
"by",
"their",
"clone",
"if",
"exist",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L866-L904 |
192,290 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.updateMainNodePostCloning | private function updateMainNodePostCloning(AbstractClassContent $content, array $cloningPages, BBUserToken $token = null)
{
$mainnode = $content->getMainNode();
if (
null !== $mainnode &&
0 < count($cloningPages) &&
true === in_array($mainnode->getUid... | php | private function updateMainNodePostCloning(AbstractClassContent $content, array $cloningPages, BBUserToken $token = null)
{
$mainnode = $content->getMainNode();
if (
null !== $mainnode &&
0 < count($cloningPages) &&
true === in_array($mainnode->getUid... | [
"private",
"function",
"updateMainNodePostCloning",
"(",
"AbstractClassContent",
"$",
"content",
",",
"array",
"$",
"cloningPages",
",",
"BBUserToken",
"$",
"token",
"=",
"null",
")",
"{",
"$",
"mainnode",
"=",
"$",
"content",
"->",
"getMainNode",
"(",
")",
";... | Update mainnode of the content if need during clonage.
@param AbstractClassContent $content The cloned content.
@param array $cloningPages The cloned pages array.
@param BBUserToken|null $token Optional, the BBuser token to allow the update of revisions if set.
@ret... | [
"Update",
"mainnode",
"of",
"the",
"content",
"if",
"need",
"during",
"clonage",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L915-L935 |
192,291 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.duplicateRecursively | private function duplicateRecursively(Page $page, $title = null, Page $parent = null)
{
if (null !== $parent && true === $parent->isDescendantOf($page)) {
throw new InvalidArgumentException('Cannot recursively duplicate a page in itself');
}
// Storing current children before cl... | php | private function duplicateRecursively(Page $page, $title = null, Page $parent = null)
{
if (null !== $parent && true === $parent->isDescendantOf($page)) {
throw new InvalidArgumentException('Cannot recursively duplicate a page in itself');
}
// Storing current children before cl... | [
"private",
"function",
"duplicateRecursively",
"(",
"Page",
"$",
"page",
",",
"$",
"title",
"=",
"null",
",",
"Page",
"$",
"parent",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"parent",
"&&",
"true",
"===",
"$",
"parent",
"->",
"isDescendant... | Duplicate a page and its descendants.
@param Page $page The page to be duplicated.
@param string|null $title Optional, the title of the copy, if null (default) the title of the copied page.
@param Page|null $parent Optional, the parent of th... | [
"Duplicate",
"a",
"page",
"and",
"its",
"descendants",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L948-L970 |
192,292 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.duplicate | public function duplicate(Page $page, $title = null, Page $parent = null, $recursive = true, BBUserToken $token = null)
{
if (false === $recursive || false === $page->hasMainSection()) {
$new_page = $this->copy($page, $title, $parent);
} else {
// Recursive cloning
... | php | public function duplicate(Page $page, $title = null, Page $parent = null, $recursive = true, BBUserToken $token = null)
{
if (false === $recursive || false === $page->hasMainSection()) {
$new_page = $this->copy($page, $title, $parent);
} else {
// Recursive cloning
... | [
"public",
"function",
"duplicate",
"(",
"Page",
"$",
"page",
",",
"$",
"title",
"=",
"null",
",",
"Page",
"$",
"parent",
"=",
"null",
",",
"$",
"recursive",
"=",
"true",
",",
"BBUserToken",
"$",
"token",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"... | Duplicate a page and optionnaly its descendants.
@param Page $page The page to be duplicated.
@param string|null $title Optional, the title of the copy, if null (default) the title of the copied page.
@param Page|null $parent Optional, the p... | [
"Duplicate",
"a",
"page",
"and",
"optionnaly",
"its",
"descendants",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L985-L1002 |
192,293 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.deletePage | public function deletePage(Page $page)
{
if ($page->hasMainSection()) {
$this->getEntityManager()
->getRepository('BackBee\NestedNode\Section')
->deleteSection($page->getSection());
}
if (null !== $page->getContentSet()) {
$thi... | php | public function deletePage(Page $page)
{
if ($page->hasMainSection()) {
$this->getEntityManager()
->getRepository('BackBee\NestedNode\Section')
->deleteSection($page->getSection());
}
if (null !== $page->getContentSet()) {
$thi... | [
"public",
"function",
"deletePage",
"(",
"Page",
"$",
"page",
")",
"{",
"if",
"(",
"$",
"page",
"->",
"hasMainSection",
"(",
")",
")",
"{",
"$",
"this",
"->",
"getEntityManager",
"(",
")",
"->",
"getRepository",
"(",
"'BackBee\\NestedNode\\Section'",
")",
... | Remove a page from databse.
@param Page $page | [
"Remove",
"a",
"page",
"from",
"databse",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L1030-L1065 |
192,294 | backbee/backbee-php | NestedNode/Repository/PageRepository.php | PageRepository.saveWithSection | public function saveWithSection(Page $page, Section $currentParent = null)
{
if ($page->hasMainSection()) {
return $page;
}
if (false === $this->_em->contains($page)) {
$this->_em->persist($page);
}
$parent = $page->getSection();
if (null !==... | php | public function saveWithSection(Page $page, Section $currentParent = null)
{
if ($page->hasMainSection()) {
return $page;
}
if (false === $this->_em->contains($page)) {
$this->_em->persist($page);
}
$parent = $page->getSection();
if (null !==... | [
"public",
"function",
"saveWithSection",
"(",
"Page",
"$",
"page",
",",
"Section",
"$",
"currentParent",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"page",
"->",
"hasMainSection",
"(",
")",
")",
"{",
"return",
"$",
"page",
";",
"}",
"if",
"(",
"false",
"... | Saves a page with a section and returns it.
@param Page $page The page to be saved with section.
@param Section|null $currentParent Optional, if provided the parent section of the new one.
@return Page The newly page with section. | [
"Saves",
"a",
"page",
"with",
"a",
"section",
"and",
"returns",
"it",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/NestedNode/Repository/PageRepository.php#L1075-L1098 |
192,295 | backbee/backbee-php | Bundle/AbstractBundle.php | AbstractBundle.getConfigServiceId | public function getConfigServiceId()
{
return strtolower(str_replace(
'%bundle_service_id%',
str_replace('%bundle_name%', $this->id, BundleInterface::BUNDLE_SERVICE_ID_PATTERN),
BundleInterface::CONFIG_SERVICE_ID_PATTERN
));
} | php | public function getConfigServiceId()
{
return strtolower(str_replace(
'%bundle_service_id%',
str_replace('%bundle_name%', $this->id, BundleInterface::BUNDLE_SERVICE_ID_PATTERN),
BundleInterface::CONFIG_SERVICE_ID_PATTERN
));
} | [
"public",
"function",
"getConfigServiceId",
"(",
")",
"{",
"return",
"strtolower",
"(",
"str_replace",
"(",
"'%bundle_service_id%'",
",",
"str_replace",
"(",
"'%bundle_name%'",
",",
"$",
"this",
"->",
"id",
",",
"BundleInterface",
"::",
"BUNDLE_SERVICE_ID_PATTERN",
... | Bundle's config service id getter.
@return string | [
"Bundle",
"s",
"config",
"service",
"id",
"getter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/AbstractBundle.php#L165-L172 |
192,296 | backbee/backbee-php | Bundle/AbstractBundle.php | AbstractBundle.getConfigDirectory | public function getConfigDirectory()
{
$directory = $this->baseDir.DIRECTORY_SEPARATOR.BundleInterface::CONFIG_DIRECTORY_NAME;
if (false === is_dir($directory)) {
$directory = $this->baseDir.DIRECTORY_SEPARATOR.BundleInterface::OLD_CONFIG_DIRECTORY_NAME;
}
return $direct... | php | public function getConfigDirectory()
{
$directory = $this->baseDir.DIRECTORY_SEPARATOR.BundleInterface::CONFIG_DIRECTORY_NAME;
if (false === is_dir($directory)) {
$directory = $this->baseDir.DIRECTORY_SEPARATOR.BundleInterface::OLD_CONFIG_DIRECTORY_NAME;
}
return $direct... | [
"public",
"function",
"getConfigDirectory",
"(",
")",
"{",
"$",
"directory",
"=",
"$",
"this",
"->",
"baseDir",
".",
"DIRECTORY_SEPARATOR",
".",
"BundleInterface",
"::",
"CONFIG_DIRECTORY_NAME",
";",
"if",
"(",
"false",
"===",
"is_dir",
"(",
"$",
"directory",
... | Bundle base directory getter.
@return string | [
"Bundle",
"base",
"directory",
"getter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/AbstractBundle.php#L179-L187 |
192,297 | backbee/backbee-php | Bundle/AbstractBundle.php | AbstractBundle.setEnable | public function setEnable($enable)
{
$properties = $this->getProperty();
$properties['enable'] = (boolean) $enable;
$this->getConfig()->setSection('bundle', $properties, true);
return $this;
} | php | public function setEnable($enable)
{
$properties = $this->getProperty();
$properties['enable'] = (boolean) $enable;
$this->getConfig()->setSection('bundle', $properties, true);
return $this;
} | [
"public",
"function",
"setEnable",
"(",
"$",
"enable",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"getProperty",
"(",
")",
";",
"$",
"properties",
"[",
"'enable'",
"]",
"=",
"(",
"boolean",
")",
"$",
"enable",
";",
"$",
"this",
"->",
"getCo... | enable property setter.
@param boolean $enable
@return self | [
"enable",
"property",
"setter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/AbstractBundle.php#L254-L261 |
192,298 | backbee/backbee-php | Bundle/AbstractBundle.php | AbstractBundle.setCategory | public function setCategory($category)
{
$properties = $this->getProperty();
$properties['category'] = (array) $category;
$this->getConfig()->setSection('bundle', $properties, true);
return $this;
} | php | public function setCategory($category)
{
$properties = $this->getProperty();
$properties['category'] = (array) $category;
$this->getConfig()->setSection('bundle', $properties, true);
return $this;
} | [
"public",
"function",
"setCategory",
"(",
"$",
"category",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"getProperty",
"(",
")",
";",
"$",
"properties",
"[",
"'category'",
"]",
"=",
"(",
"array",
")",
"$",
"category",
";",
"$",
"this",
"->",
... | category property setter.
@param string|array $category
@return self | [
"category",
"property",
"setter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/AbstractBundle.php#L270-L277 |
192,299 | backbee/backbee-php | Bundle/AbstractBundle.php | AbstractBundle.setConfigPerSite | public function setConfigPerSite($v)
{
$properties = $this->getProperty();
$properties['config_per_site'] = (boolean) $v;
$this->getConfig()->setSection('bundle', $properties, true);
return $this;
} | php | public function setConfigPerSite($v)
{
$properties = $this->getProperty();
$properties['config_per_site'] = (boolean) $v;
$this->getConfig()->setSection('bundle', $properties, true);
return $this;
} | [
"public",
"function",
"setConfigPerSite",
"(",
"$",
"v",
")",
"{",
"$",
"properties",
"=",
"$",
"this",
"->",
"getProperty",
"(",
")",
";",
"$",
"properties",
"[",
"'config_per_site'",
"]",
"=",
"(",
"boolean",
")",
"$",
"v",
";",
"$",
"this",
"->",
... | config_per_site property setter.
@param boolean $v
@return self | [
"config_per_site",
"property",
"setter",
"."
] | d752ec7b609e538de60fb0bfcac478f6c9ed607c | https://github.com/backbee/backbee-php/blob/d752ec7b609e538de60fb0bfcac478f6c9ed607c/Bundle/AbstractBundle.php#L286-L293 |
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.