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 |
|---|---|---|---|---|---|---|---|---|---|---|---|
223,600 | nilportugues/php-sitemap | src/SubmitSitemap.php | SubmitSitemap.submitSitemap | protected static function submitSitemap($url)
{
$response = [];
foreach (self::$sites as $site => $baseUrl) {
$submitUrl = \str_replace('{{sitemap}}', $url, $baseUrl);
$response = self::executeCurl($submitUrl, $response, $site);
}
return $response;
} | php | protected static function submitSitemap($url)
{
$response = [];
foreach (self::$sites as $site => $baseUrl) {
$submitUrl = \str_replace('{{sitemap}}', $url, $baseUrl);
$response = self::executeCurl($submitUrl, $response, $site);
}
return $response;
} | [
"protected",
"static",
"function",
"submitSitemap",
"(",
"$",
"url",
")",
"{",
"$",
"response",
"=",
"[",
"]",
";",
"foreach",
"(",
"self",
"::",
"$",
"sites",
"as",
"$",
"site",
"=>",
"$",
"baseUrl",
")",
"{",
"$",
"submitUrl",
"=",
"\\",
"str_repla... | Submits a sitemap to the search engines using file_get_contents.
@param $url string Valid URL being submitted.
@return array Array with the search engine submission success status as a boolean. | [
"Submits",
"a",
"sitemap",
"to",
"the",
"search",
"engines",
"using",
"file_get_contents",
"."
] | b1c7109d6e0c30ee9a0f9ef3b73bac406add9bfd | https://github.com/nilportugues/php-sitemap/blob/b1c7109d6e0c30ee9a0f9ef3b73bac406add9bfd/src/SubmitSitemap.php#L51-L61 |
223,601 | madeyourday/contao-rocksolid-frontend-helper | src/FrontendHooks.php | FrontendHooks.checkLogin | public static function checkLogin()
{
// Only try to authenticate in the front end
if (TL_MODE !== 'FE') {
return false;
}
// Do not create a user instance if there is no authentication cookie
if (! is_subclass_of('BackendUser', UserInterface::class) && ! \Input::cookie('BE_USER_AUTH')) {
return false... | php | public static function checkLogin()
{
// Only try to authenticate in the front end
if (TL_MODE !== 'FE') {
return false;
}
// Do not create a user instance if there is no authentication cookie
if (! is_subclass_of('BackendUser', UserInterface::class) && ! \Input::cookie('BE_USER_AUTH')) {
return false... | [
"public",
"static",
"function",
"checkLogin",
"(",
")",
"{",
"// Only try to authenticate in the front end",
"if",
"(",
"TL_MODE",
"!==",
"'FE'",
")",
"{",
"return",
"false",
";",
"}",
"// Do not create a user instance if there is no authentication cookie",
"if",
"(",
"!"... | checks if a Backend User is logged in
@return array|boolean false if the user isn't logged in otherwise the permissions array | [
"checks",
"if",
"a",
"Backend",
"User",
"is",
"logged",
"in"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/FrontendHooks.php#L652-L694 |
223,602 | madeyourday/contao-rocksolid-frontend-helper | src/FrontendHooks.php | FrontendHooks.getBackendModuleLabel | public function getBackendModuleLabel($config, $id = null, $withParentTable = false)
{
if ($withParentTable) {
\Controller::loadDataContainer($config['table']);
if (!empty($GLOBALS['TL_DCA'][$config['table']]['config']['ptable'])) {
$ptable = $GLOBALS['TL_DCA'][$config['table']]['config']['ptable'];
\S... | php | public function getBackendModuleLabel($config, $id = null, $withParentTable = false)
{
if ($withParentTable) {
\Controller::loadDataContainer($config['table']);
if (!empty($GLOBALS['TL_DCA'][$config['table']]['config']['ptable'])) {
$ptable = $GLOBALS['TL_DCA'][$config['table']]['config']['ptable'];
\S... | [
"public",
"function",
"getBackendModuleLabel",
"(",
"$",
"config",
",",
"$",
"id",
"=",
"null",
",",
"$",
"withParentTable",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"withParentTable",
")",
"{",
"\\",
"Controller",
"::",
"loadDataContainer",
"(",
"$",
"conf... | get the label for a backend module link
@param array $config backend module configuration
@param int $id id of the entry to edit
@param boolean $withParentTable use the edit label from the parent table if possible
@return string the label | [
"get",
"the",
"label",
"for",
"a",
"backend",
"module",
"link"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/FrontendHooks.php#L704-L736 |
223,603 | madeyourday/contao-rocksolid-frontend-helper | src/FrontendHooks.php | FrontendHooks.addTemplateURL | protected static function addTemplateURL($data)
{
if (substr($data['templatePath'], 0, 10) === 'templates/') {
$data['templateURL'] = static::getBackendURL('tpl_editor', null, $data['templatePath'], 'source');
\System::loadLanguageFile('tl_files');
$data['templateLabel'] = sprintf($GLOBALS['TL_LANG']['tl_... | php | protected static function addTemplateURL($data)
{
if (substr($data['templatePath'], 0, 10) === 'templates/') {
$data['templateURL'] = static::getBackendURL('tpl_editor', null, $data['templatePath'], 'source');
\System::loadLanguageFile('tl_files');
$data['templateLabel'] = sprintf($GLOBALS['TL_LANG']['tl_... | [
"protected",
"static",
"function",
"addTemplateURL",
"(",
"$",
"data",
")",
"{",
"if",
"(",
"substr",
"(",
"$",
"data",
"[",
"'templatePath'",
"]",
",",
"0",
",",
"10",
")",
"===",
"'templates/'",
")",
"{",
"$",
"data",
"[",
"'templateURL'",
"]",
"=",
... | Add templateURL and templateLabel to data array
@param array $data data array
@return array modified data array | [
"Add",
"templateURL",
"and",
"templateLabel",
"to",
"data",
"array"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/FrontendHooks.php#L744-L768 |
223,604 | madeyourday/contao-rocksolid-frontend-helper | src/FrontendHooks.php | FrontendHooks.getThemeAssistantStylesheet | protected function getThemeAssistantStylesheet()
{
if (!$GLOBALS['objPage'] || !$GLOBALS['objPage']->getRelated('layout')) {
return null;
}
if (!$stylesheets = $GLOBALS['objPage']->getRelated('layout')->external) {
return null;
}
$stylesheets = \StringUtil::deserialize($stylesheets);
foreach ($style... | php | protected function getThemeAssistantStylesheet()
{
if (!$GLOBALS['objPage'] || !$GLOBALS['objPage']->getRelated('layout')) {
return null;
}
if (!$stylesheets = $GLOBALS['objPage']->getRelated('layout')->external) {
return null;
}
$stylesheets = \StringUtil::deserialize($stylesheets);
foreach ($style... | [
"protected",
"function",
"getThemeAssistantStylesheet",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"GLOBALS",
"[",
"'objPage'",
"]",
"||",
"!",
"$",
"GLOBALS",
"[",
"'objPage'",
"]",
"->",
"getRelated",
"(",
"'layout'",
")",
")",
"{",
"return",
"null",
";",
"}"... | Get path to the .css.base file of the current layout
@return string|null Path to the .css.base file or null | [
"Get",
"path",
"to",
"the",
".",
"css",
".",
"base",
"file",
"of",
"the",
"current",
"layout"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/FrontendHooks.php#L775-L793 |
223,605 | madeyourday/contao-rocksolid-frontend-helper | src/FrontendHooks.php | FrontendHooks.getBackendURL | protected static function getBackendURL($do, $table, $id, $act = 'edit', array $params = array())
{
$addParams = array();
foreach (array('do', 'table', 'act', 'id') as $key) {
if ($$key) {
$addParams[$key] = $$key;
}
}
// This is necessary because Contao wants the parameters to be in the right order... | php | protected static function getBackendURL($do, $table, $id, $act = 'edit', array $params = array())
{
$addParams = array();
foreach (array('do', 'table', 'act', 'id') as $key) {
if ($$key) {
$addParams[$key] = $$key;
}
}
// This is necessary because Contao wants the parameters to be in the right order... | [
"protected",
"static",
"function",
"getBackendURL",
"(",
"$",
"do",
",",
"$",
"table",
",",
"$",
"id",
",",
"$",
"act",
"=",
"'edit'",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"$",
"addParams",
"=",
"array",
"(",
")",
";",
"... | create backend edit URL
@param string $do
@param string $table
@param string $id
@param string $act
@return string | [
"create",
"backend",
"edit",
"URL"
] | 1a0bf45a3d3913f8436ccd284965e7c37a463f28 | https://github.com/madeyourday/contao-rocksolid-frontend-helper/blob/1a0bf45a3d3913f8436ccd284965e7c37a463f28/src/FrontendHooks.php#L804-L826 |
223,606 | puli/manager | src/Transaction/Transaction.php | Transaction.rollback | public function rollback()
{
for ($i = count($this->completedOperations) - 1; $i >= 0; --$i) {
$this->completedOperations[$i]->rollback();
}
$this->completedOperations = array();
} | php | public function rollback()
{
for ($i = count($this->completedOperations) - 1; $i >= 0; --$i) {
$this->completedOperations[$i]->rollback();
}
$this->completedOperations = array();
} | [
"public",
"function",
"rollback",
"(",
")",
"{",
"for",
"(",
"$",
"i",
"=",
"count",
"(",
"$",
"this",
"->",
"completedOperations",
")",
"-",
"1",
";",
"$",
"i",
">=",
"0",
";",
"--",
"$",
"i",
")",
"{",
"$",
"this",
"->",
"completedOperations",
... | Rolls back all executed operations.
Only operations that executed successfully are rolled back. | [
"Rolls",
"back",
"all",
"executed",
"operations",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Transaction/Transaction.php#L53-L60 |
223,607 | puli/manager | src/Api/Server/ServerCollection.php | ServerCollection.get | public function get($serverName)
{
if (!isset($this->servers[$serverName])) {
throw NoSuchServerException::forServerName($serverName);
}
return $this->servers[$serverName];
} | php | public function get($serverName)
{
if (!isset($this->servers[$serverName])) {
throw NoSuchServerException::forServerName($serverName);
}
return $this->servers[$serverName];
} | [
"public",
"function",
"get",
"(",
"$",
"serverName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"servers",
"[",
"$",
"serverName",
"]",
")",
")",
"{",
"throw",
"NoSuchServerException",
"::",
"forServerName",
"(",
"$",
"serverName",
")",
... | Returns the server with the given name.
@param string $serverName The server name.
@return Server The server.
@throws NoSuchServerException If the server does not exist. | [
"Returns",
"the",
"server",
"with",
"the",
"given",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Server/ServerCollection.php#L64-L71 |
223,608 | bitverseio/identicon | src/Bitverse/Identicon/Color/Color.php | Color.parseHex | public static function parseHex($color)
{
if (!preg_match('/^#[A-Fa-f0-9]{6}$/', $color)) {
throw new WrongColorFormatException($color);
}
return new Color(
hexdec(substr($color, 1, 2)),
hexdec(substr($color, 3, 2)),
hexdec(substr($color, 5, 2... | php | public static function parseHex($color)
{
if (!preg_match('/^#[A-Fa-f0-9]{6}$/', $color)) {
throw new WrongColorFormatException($color);
}
return new Color(
hexdec(substr($color, 1, 2)),
hexdec(substr($color, 3, 2)),
hexdec(substr($color, 5, 2... | [
"public",
"static",
"function",
"parseHex",
"(",
"$",
"color",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"'/^#[A-Fa-f0-9]{6}$/'",
",",
"$",
"color",
")",
")",
"{",
"throw",
"new",
"WrongColorFormatException",
"(",
"$",
"color",
")",
";",
"}",
"return",
... | Parses a hex string to create a Color object.
@throws WrongColorFormatException Thrown if the given string is in the wrong format.
@param string $color
@return Color | [
"Parses",
"a",
"hex",
"string",
"to",
"create",
"a",
"Color",
"object",
"."
] | 5a015546e7f29d537807e0877446e2cd704ca438 | https://github.com/bitverseio/identicon/blob/5a015546e7f29d537807e0877446e2cd704ca438/src/Bitverse/Identicon/Color/Color.php#L30-L41 |
223,609 | apoutchika/MediaBundle | Filesystem/BaseFilesystem.php | BaseFilesystem.makeFilesystem | public function makeFilesystem(array $configs)
{
$adapter = $this->getAdapter($configs);
if (!$adapter instanceof Adapter) {
throw new \Exception('The adapter must has instance of Gaufrette\Adapter');
}
$this->filesystem = new Filesystem($adapter);
return $this... | php | public function makeFilesystem(array $configs)
{
$adapter = $this->getAdapter($configs);
if (!$adapter instanceof Adapter) {
throw new \Exception('The adapter must has instance of Gaufrette\Adapter');
}
$this->filesystem = new Filesystem($adapter);
return $this... | [
"public",
"function",
"makeFilesystem",
"(",
"array",
"$",
"configs",
")",
"{",
"$",
"adapter",
"=",
"$",
"this",
"->",
"getAdapter",
"(",
"$",
"configs",
")",
";",
"if",
"(",
"!",
"$",
"adapter",
"instanceof",
"Adapter",
")",
"{",
"throw",
"new",
"\\"... | Make Gaufrette filesystem.
@param array $configs Parameters in filesystems name, injected in gaufrette adapter
@return FilesystemInterface | [
"Make",
"Gaufrette",
"filesystem",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Filesystem/BaseFilesystem.php#L58-L69 |
223,610 | apoutchika/MediaBundle | Filesystem/BaseFilesystem.php | BaseFilesystem.setUrl | public function setUrl($url)
{
$this->urlAbsolute = preg_replace('#/$#', '', $url);
if ($this->urlRelative === null) {
$this->urlRelative = $this->urlAbsolute;
}
return $this;
} | php | public function setUrl($url)
{
$this->urlAbsolute = preg_replace('#/$#', '', $url);
if ($this->urlRelative === null) {
$this->urlRelative = $this->urlAbsolute;
}
return $this;
} | [
"public",
"function",
"setUrl",
"(",
"$",
"url",
")",
"{",
"$",
"this",
"->",
"urlAbsolute",
"=",
"preg_replace",
"(",
"'#/$#'",
",",
"''",
",",
"$",
"url",
")",
";",
"if",
"(",
"$",
"this",
"->",
"urlRelative",
"===",
"null",
")",
"{",
"$",
"this"... | Set absolute url.
@param string $url
@return FilesystemInterface | [
"Set",
"absolute",
"url",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Filesystem/BaseFilesystem.php#L78-L87 |
223,611 | puli/manager | src/Discovery/Type/SyncTypeName.php | SyncTypeName.takeSnapshot | public function takeSnapshot()
{
$this->enabledTypeBefore = null;
if ($this->typeDescriptors->contains($this->typeName)) {
foreach ($this->typeDescriptors->listByTypeName($this->typeName) as $typeDescriptor) {
if ($typeDescriptor->isEnabled()) {
$this... | php | public function takeSnapshot()
{
$this->enabledTypeBefore = null;
if ($this->typeDescriptors->contains($this->typeName)) {
foreach ($this->typeDescriptors->listByTypeName($this->typeName) as $typeDescriptor) {
if ($typeDescriptor->isEnabled()) {
$this... | [
"public",
"function",
"takeSnapshot",
"(",
")",
"{",
"$",
"this",
"->",
"enabledTypeBefore",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"typeDescriptors",
"->",
"contains",
"(",
"$",
"this",
"->",
"typeName",
")",
")",
"{",
"foreach",
"(",
"$",
"t... | Records whether the type name is currently enabled. | [
"Records",
"whether",
"the",
"type",
"name",
"is",
"currently",
"enabled",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Discovery/Type/SyncTypeName.php#L76-L89 |
223,612 | ongr-io/FilterManagerBundle | DependencyInjection/Configuration.php | Configuration.buildRelationsTree | private function buildRelationsTree($relationType)
{
$filter = new ArrayNodeDefinition($relationType);
$filter
->validate()
->ifTrue(
function ($v) {
return empty($v['include']) && empty($v['exclude']);
}
... | php | private function buildRelationsTree($relationType)
{
$filter = new ArrayNodeDefinition($relationType);
$filter
->validate()
->ifTrue(
function ($v) {
return empty($v['include']) && empty($v['exclude']);
}
... | [
"private",
"function",
"buildRelationsTree",
"(",
"$",
"relationType",
")",
"{",
"$",
"filter",
"=",
"new",
"ArrayNodeDefinition",
"(",
"$",
"relationType",
")",
";",
"$",
"filter",
"->",
"validate",
"(",
")",
"->",
"ifTrue",
"(",
"function",
"(",
"$",
"v"... | Builds relations config tree for given relation name.
@param string $relationType
@return ArrayNodeDefinition | [
"Builds",
"relations",
"config",
"tree",
"for",
"given",
"relation",
"name",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/DependencyInjection/Configuration.php#L108-L154 |
223,613 | apoutchika/MediaBundle | Listener/MediaContentListener.php | MediaContentListener.addContent | public function addContent(FilterResponseEvent $event)
{
if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
return;
}
$response = $event->getResponse();
$content = $response->getContent();
if (strpos($content, 'data-apoutchika-media="') !== false) {
... | php | public function addContent(FilterResponseEvent $event)
{
if (HttpKernel::MASTER_REQUEST != $event->getRequestType()) {
return;
}
$response = $event->getResponse();
$content = $response->getContent();
if (strpos($content, 'data-apoutchika-media="') !== false) {
... | [
"public",
"function",
"addContent",
"(",
"FilterResponseEvent",
"$",
"event",
")",
"{",
"if",
"(",
"HttpKernel",
"::",
"MASTER_REQUEST",
"!=",
"$",
"event",
"->",
"getRequestType",
"(",
")",
")",
"{",
"return",
";",
"}",
"$",
"response",
"=",
"$",
"event",... | Detect if the response has media field in her content,
and add css, js and templates for mustaches.
@param FilterResponseEvent $event
@return FilterResponseEvent | [
"Detect",
"if",
"the",
"response",
"has",
"media",
"field",
"in",
"her",
"content",
"and",
"add",
"css",
"js",
"and",
"templates",
"for",
"mustaches",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Listener/MediaContentListener.php#L83-L151 |
223,614 | puli/manager | src/Discovery/Binding/AbstractReloadBindingDescriptors.php | AbstractReloadBindingDescriptors.reloadBindingDescriptor | protected function reloadBindingDescriptor(BindingDescriptor $bindingDescriptor)
{
if (!$bindingDescriptor->isLoaded()) {
return;
}
// Keep backup of containing module before calling unload()
$containingModule = $bindingDescriptor->getContainingModule();
$typeNam... | php | protected function reloadBindingDescriptor(BindingDescriptor $bindingDescriptor)
{
if (!$bindingDescriptor->isLoaded()) {
return;
}
// Keep backup of containing module before calling unload()
$containingModule = $bindingDescriptor->getContainingModule();
$typeNam... | [
"protected",
"function",
"reloadBindingDescriptor",
"(",
"BindingDescriptor",
"$",
"bindingDescriptor",
")",
"{",
"if",
"(",
"!",
"$",
"bindingDescriptor",
"->",
"isLoaded",
"(",
")",
")",
"{",
"return",
";",
"}",
"// Keep backup of containing module before calling unlo... | Unloads and loads a binding descriptor.
The descriptor is remembered and reloaded again in {@link postRollback()}
if the intercepted operation needs to be rolled back.
@param BindingDescriptor $bindingDescriptor The descriptor to reload. | [
"Unloads",
"and",
"loads",
"a",
"binding",
"descriptor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Discovery/Binding/AbstractReloadBindingDescriptors.php#L70-L89 |
223,615 | puli/manager | src/Discovery/Type/BindingTypeDescriptorCollection.php | BindingTypeDescriptorCollection.add | public function add(BindingTypeDescriptor $typeDescriptor)
{
$this->map->set($typeDescriptor->getTypeName(), $typeDescriptor->getContainingModule()->getName(), $typeDescriptor);
} | php | public function add(BindingTypeDescriptor $typeDescriptor)
{
$this->map->set($typeDescriptor->getTypeName(), $typeDescriptor->getContainingModule()->getName(), $typeDescriptor);
} | [
"public",
"function",
"add",
"(",
"BindingTypeDescriptor",
"$",
"typeDescriptor",
")",
"{",
"$",
"this",
"->",
"map",
"->",
"set",
"(",
"$",
"typeDescriptor",
"->",
"getTypeName",
"(",
")",
",",
"$",
"typeDescriptor",
"->",
"getContainingModule",
"(",
")",
"... | Adds a type descriptor.
@param BindingTypeDescriptor $typeDescriptor The type descriptor. | [
"Adds",
"a",
"type",
"descriptor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Discovery/Type/BindingTypeDescriptorCollection.php#L53-L56 |
223,616 | puli/manager | src/Discovery/Type/BindingTypeDescriptorCollection.php | BindingTypeDescriptorCollection.getEnabled | public function getEnabled($typeName)
{
if (!$this->contains($typeName)) {
return null;
}
foreach ($this->listByTypeName($typeName) as $typeDescriptor) {
if ($typeDescriptor->isEnabled()) {
return $typeDescriptor;
}
}
retu... | php | public function getEnabled($typeName)
{
if (!$this->contains($typeName)) {
return null;
}
foreach ($this->listByTypeName($typeName) as $typeDescriptor) {
if ($typeDescriptor->isEnabled()) {
return $typeDescriptor;
}
}
retu... | [
"public",
"function",
"getEnabled",
"(",
"$",
"typeName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"contains",
"(",
"$",
"typeName",
")",
")",
"{",
"return",
"null",
";",
"}",
"foreach",
"(",
"$",
"this",
"->",
"listByTypeName",
"(",
"$",
"typeNa... | Returns the enabled type descriptor for a given type name.
@param string $typeName The name of the type.
@return BindingTypeDescriptor|null The enabled type descriptor or `null`
if no enabled descriptor was found. | [
"Returns",
"the",
"enabled",
"type",
"descriptor",
"for",
"a",
"given",
"type",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Discovery/Type/BindingTypeDescriptorCollection.php#L110-L123 |
223,617 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarsTable.php | CalendarsTable.getCalendars | public function getCalendars(array $options = []): array
{
$result = $conditions = [];
if (!empty($options['conditions'])) {
$conditions = $options['conditions'];
}
$query = $this->find()
->where($conditions)
->order(['name' => 'ASC'])
... | php | public function getCalendars(array $options = []): array
{
$result = $conditions = [];
if (!empty($options['conditions'])) {
$conditions = $options['conditions'];
}
$query = $this->find()
->where($conditions)
->order(['name' => 'ASC'])
... | [
"public",
"function",
"getCalendars",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"result",
"=",
"$",
"conditions",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'conditions'",
"]",
")",
")",
... | Get Calendar entities.
@param mixed[] $options for filtering calendars
@return mixed[] $result containing calendar entities with event_types | [
"Get",
"Calendar",
"entities",
"."
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarsTable.php#L176-L199 |
223,618 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarsTable.php | CalendarsTable.getColor | public function getColor(?EntityInterface $entity = null): string
{
$color = Configure::read('Calendar.Configs.color');
if ($entity instanceof EntityInterface && !empty($entity->get('color'))) {
$color = $entity->get('color');
}
if (!$color) {
$color = '#337... | php | public function getColor(?EntityInterface $entity = null): string
{
$color = Configure::read('Calendar.Configs.color');
if ($entity instanceof EntityInterface && !empty($entity->get('color'))) {
$color = $entity->get('color');
}
if (!$color) {
$color = '#337... | [
"public",
"function",
"getColor",
"(",
"?",
"EntityInterface",
"$",
"entity",
"=",
"null",
")",
":",
"string",
"{",
"$",
"color",
"=",
"Configure",
"::",
"read",
"(",
"'Calendar.Configs.color'",
")",
";",
"if",
"(",
"$",
"entity",
"instanceof",
"EntityInterf... | Get Default calendar color.
@param \Cake\Datasource\EntityInterface|null $entity of the current calendar
@return string $color containing hexadecimal color notation. | [
"Get",
"Default",
"calendar",
"color",
"."
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarsTable.php#L207-L220 |
223,619 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarsTable.php | CalendarsTable.getByAllowedEventTypes | public function getByAllowedEventTypes(?string $tableName = null, array $options = []): array
{
$result = [];
$query = $this->find();
$query->execute();
$query->all();
if (!$query->count()) {
return $result;
}
$resultSet = $query->all();
... | php | public function getByAllowedEventTypes(?string $tableName = null, array $options = []): array
{
$result = [];
$query = $this->find();
$query->execute();
$query->all();
if (!$query->count()) {
return $result;
}
$resultSet = $query->all();
... | [
"public",
"function",
"getByAllowedEventTypes",
"(",
"?",
"string",
"$",
"tableName",
"=",
"null",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"$",
"query",
"=",
"$",
"this",
"->",
"find",
... | Get the list of Calendar instances
Getting the list of calendars where following module is listed
in event_types field. For instance: Users::birthdays.
@param string $tableName of the app's module
@param mixed[] $options with extra data
@return mixed[] $result with calendar instances | [
"Get",
"the",
"list",
"of",
"Calendar",
"instances"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarsTable.php#L266-L298 |
223,620 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarsTable.php | CalendarsTable.saveCalendarEntity | public function saveCalendarEntity(array $calendar = [], array $options = []): array
{
$response = [
'errors' => [],
'status' => false,
'entity' => null,
];
$query = $this->find()
->where($options['conditions']);
$query->execute();
... | php | public function saveCalendarEntity(array $calendar = [], array $options = []): array
{
$response = [
'errors' => [],
'status' => false,
'entity' => null,
];
$query = $this->find()
->where($options['conditions']);
$query->execute();
... | [
"public",
"function",
"saveCalendarEntity",
"(",
"array",
"$",
"calendar",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"response",
"=",
"[",
"'errors'",
"=>",
"[",
"]",
",",
"'status'",
"=>",
"false",
",",... | Save Calendar Entity
@param mixed[] $calendar data to be saved
@param mixed[] $options in case any extras required for conditions
@return mixed[] $response containing the state of save operation | [
"Save",
"Calendar",
"Entity"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarsTable.php#L308-L340 |
223,621 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarsTable.php | CalendarsTable.getEventTypes | protected function getEventTypes(?string $data = null): array
{
$result = [];
if (empty($data)) {
return $result;
}
$result = json_decode($data, true);
return $result;
} | php | protected function getEventTypes(?string $data = null): array
{
$result = [];
if (empty($data)) {
return $result;
}
$result = json_decode($data, true);
return $result;
} | [
"protected",
"function",
"getEventTypes",
"(",
"?",
"string",
"$",
"data",
"=",
"null",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"return",
"$",
"result",
";",
"}",
"$",
"resul... | Get Event Types saved within Calendar
@param string|null $data of the event type
@return mixed[] $result with event types decoded. | [
"Get",
"Event",
"Types",
"saved",
"within",
"Calendar"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarsTable.php#L348-L359 |
223,622 | QoboLtd/cakephp-calendar | src/Object/Objects/AbstractObject.php | AbstractObject.toEntity | public function toEntity(): EntityInterface
{
$data = [];
$entityProvider = $this->getEntityProvider();
foreach (get_object_vars($this) as $property => $value) {
$method = Inflector::variable('get ' . $property);
if (method_exists($this, $method) && is_callable([$th... | php | public function toEntity(): EntityInterface
{
$data = [];
$entityProvider = $this->getEntityProvider();
foreach (get_object_vars($this) as $property => $value) {
$method = Inflector::variable('get ' . $property);
if (method_exists($this, $method) && is_callable([$th... | [
"public",
"function",
"toEntity",
"(",
")",
":",
"EntityInterface",
"{",
"$",
"data",
"=",
"[",
"]",
";",
"$",
"entityProvider",
"=",
"$",
"this",
"->",
"getEntityProvider",
"(",
")",
";",
"foreach",
"(",
"get_object_vars",
"(",
"$",
"this",
")",
"as",
... | Convert Generic Object to corresponding Cake\ORM\Entity
Entity is assembled based on Cake\ORM\Entity and
prepopulated with the data of a given object instance
via getters.
@return \Cake\Datasource\EntityInterface $entity of the calendar | [
"Convert",
"Generic",
"Object",
"to",
"corresponding",
"Cake",
"\\",
"ORM",
"\\",
"Entity"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Object/Objects/AbstractObject.php#L99-L116 |
223,623 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.createReference | public function createReference(MediaInterface $media)
{
$allowed = false;
foreach ($this->contexts as $context) {
if (in_array($media->getExtension(), $context)) {
$allowed = true;
break;
}
}
if ($allowed === false) {
... | php | public function createReference(MediaInterface $media)
{
$allowed = false;
foreach ($this->contexts as $context) {
if (in_array($media->getExtension(), $context)) {
$allowed = true;
break;
}
}
if ($allowed === false) {
... | [
"public",
"function",
"createReference",
"(",
"MediaInterface",
"$",
"media",
")",
"{",
"$",
"allowed",
"=",
"false",
";",
"foreach",
"(",
"$",
"this",
"->",
"contexts",
"as",
"$",
"context",
")",
"{",
"if",
"(",
"in_array",
"(",
"$",
"media",
"->",
"g... | Create reference for media.
@param MediaInterface $media
@return bool | [
"Create",
"reference",
"for",
"media",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L150-L177 |
223,624 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.search | public function search($filterKey, $q = null, $type = null)
{
if ($type == 0) {
$type = null;
}
if (!$this->filter->has($filterKey)) {
return array();
}
$qb = $this->entityManager->getRepository($this->class)->createQueryBuilder('m')
->se... | php | public function search($filterKey, $q = null, $type = null)
{
if ($type == 0) {
$type = null;
}
if (!$this->filter->has($filterKey)) {
return array();
}
$qb = $this->entityManager->getRepository($this->class)->createQueryBuilder('m')
->se... | [
"public",
"function",
"search",
"(",
"$",
"filterKey",
",",
"$",
"q",
"=",
"null",
",",
"$",
"type",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"type",
"==",
"0",
")",
"{",
"$",
"type",
"=",
"null",
";",
"}",
"if",
"(",
"!",
"$",
"this",
"->",
... | Query for search medias with keywords and type.
@param string $filterKey Allowed filter for this search
@param string $q keywords
@param int $type Type of media, constant of MediaInterface
@return array list id of medias matches with query | [
"Query",
"for",
"search",
"medias",
"with",
"keywords",
"and",
"type",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L188-L240 |
223,625 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.findAllByFiltersKeys | public function findAllByFiltersKeys(array $filtersKeys)
{
$qb = $this->entityManager->getRepository($this->class)->createQueryBuilder('m');
$filters = array();
$addNull = false;
$inversedfilters = array();
foreach ($filtersKeys as $filter) {
if ($this->filter->h... | php | public function findAllByFiltersKeys(array $filtersKeys)
{
$qb = $this->entityManager->getRepository($this->class)->createQueryBuilder('m');
$filters = array();
$addNull = false;
$inversedfilters = array();
foreach ($filtersKeys as $filter) {
if ($this->filter->h... | [
"public",
"function",
"findAllByFiltersKeys",
"(",
"array",
"$",
"filtersKeys",
")",
"{",
"$",
"qb",
"=",
"$",
"this",
"->",
"entityManager",
"->",
"getRepository",
"(",
"$",
"this",
"->",
"class",
")",
"->",
"createQueryBuilder",
"(",
"'m'",
")",
";",
"$"... | Custom find all, sort by createAt desc.
@param array $filtersKeys List medias in this filters | [
"Custom",
"find",
"all",
"sort",
"by",
"createAt",
"desc",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L247-L292 |
223,626 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.delete | public function delete($media, $flush = true)
{
parent::delete($media, $flush);
foreach ($this->filesystemManipulator->keys() as $key) {
if (preg_match('#/'.$media->getReference().'$#', $key)) {
$this->filesystemManipulator->delete($key);
}
}
} | php | public function delete($media, $flush = true)
{
parent::delete($media, $flush);
foreach ($this->filesystemManipulator->keys() as $key) {
if (preg_match('#/'.$media->getReference().'$#', $key)) {
$this->filesystemManipulator->delete($key);
}
}
} | [
"public",
"function",
"delete",
"(",
"$",
"media",
",",
"$",
"flush",
"=",
"true",
")",
"{",
"parent",
"::",
"delete",
"(",
"$",
"media",
",",
"$",
"flush",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"filesystemManipulator",
"->",
"keys",
"(",
")",... | Delete media entity and files.
@param MediaInterface $media
@param bool $flush | [
"Delete",
"media",
"entity",
"and",
"files",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L300-L309 |
223,627 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.saveFile | private function saveFile(MediaInterface $media)
{
$file = $media->getFile();
$fileInfo = new FileInfo($file);
$type = $fileInfo->getType();
$media->setType($type);
if ($media->getName() === null) {
$media->setName($fileInfo->getName());
$media->set... | php | private function saveFile(MediaInterface $media)
{
$file = $media->getFile();
$fileInfo = new FileInfo($file);
$type = $fileInfo->getType();
$media->setType($type);
if ($media->getName() === null) {
$media->setName($fileInfo->getName());
$media->set... | [
"private",
"function",
"saveFile",
"(",
"MediaInterface",
"$",
"media",
")",
"{",
"$",
"file",
"=",
"$",
"media",
"->",
"getFile",
"(",
")",
";",
"$",
"fileInfo",
"=",
"new",
"FileInfo",
"(",
"$",
"file",
")",
";",
"$",
"type",
"=",
"$",
"fileInfo",
... | Save new file.
@param MediaInterface $media
@return MediaInterface | [
"Save",
"new",
"file",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L318-L360 |
223,628 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.setSizeWidthAndHeight | public function setSizeWidthAndHeight(MediaInterface $media)
{
$key = $this->originalDir.'/'.$media->getReference();
$media->setSize($this->filesystemManipulator->size($key));
if ($media->getType() === $media::IMAGE) {
$image = $this->imagine->load(
$this->files... | php | public function setSizeWidthAndHeight(MediaInterface $media)
{
$key = $this->originalDir.'/'.$media->getReference();
$media->setSize($this->filesystemManipulator->size($key));
if ($media->getType() === $media::IMAGE) {
$image = $this->imagine->load(
$this->files... | [
"public",
"function",
"setSizeWidthAndHeight",
"(",
"MediaInterface",
"$",
"media",
")",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"originalDir",
".",
"'/'",
".",
"$",
"media",
"->",
"getReference",
"(",
")",
";",
"$",
"media",
"->",
"setSize",
"(",
"$",
... | Set size of file, if it's image, set width and height.
@param MediaInterface $media
@return MediaInterface | [
"Set",
"size",
"of",
"file",
"if",
"it",
"s",
"image",
"set",
"width",
"and",
"height",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L369-L385 |
223,629 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.getUrl | public function getUrl(MediaInterface $media, $alias = null)
{
return $this->filesystemManipulator->url($this->getAliasAndKey($media, $alias));
} | php | public function getUrl(MediaInterface $media, $alias = null)
{
return $this->filesystemManipulator->url($this->getAliasAndKey($media, $alias));
} | [
"public",
"function",
"getUrl",
"(",
"MediaInterface",
"$",
"media",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filesystemManipulator",
"->",
"url",
"(",
"$",
"this",
"->",
"getAliasAndKey",
"(",
"$",
"media",
",",
"$",
"alia... | Get relative url of media.
@param MediaInterface $media
@param string|array|null $alias
return string relative Url of media ex: /medias/123x456_focus/9485990a0e13c3ef2adddb69a75a64d44c40caa7.jpg | [
"Get",
"relative",
"url",
"of",
"media",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L395-L398 |
223,630 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.getAbsoluteUrl | public function getAbsoluteUrl(MediaInterface $media, $alias = null)
{
return $this->filesystemManipulator->url($this->getAliasAndKey($media, $alias), true);
} | php | public function getAbsoluteUrl(MediaInterface $media, $alias = null)
{
return $this->filesystemManipulator->url($this->getAliasAndKey($media, $alias), true);
} | [
"public",
"function",
"getAbsoluteUrl",
"(",
"MediaInterface",
"$",
"media",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filesystemManipulator",
"->",
"url",
"(",
"$",
"this",
"->",
"getAliasAndKey",
"(",
"$",
"media",
",",
"$",... | Get absolute url of media.
@param MediaInterface $media
@param string|array|null $alias
return string Url of media ex: http://www.exemple.tld/medias/123x456_focus/9485990a0e13c3ef2adddb69a75a64d44c40caa7.jpg | [
"Get",
"absolute",
"url",
"of",
"media",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L408-L411 |
223,631 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.getPath | public function getPath(MediaInterface $media, $alias = null)
{
return $this->filesystemManipulator->path($this->getAliasAndKey($media, $alias));
} | php | public function getPath(MediaInterface $media, $alias = null)
{
return $this->filesystemManipulator->path($this->getAliasAndKey($media, $alias));
} | [
"public",
"function",
"getPath",
"(",
"MediaInterface",
"$",
"media",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filesystemManipulator",
"->",
"path",
"(",
"$",
"this",
"->",
"getAliasAndKey",
"(",
"$",
"media",
",",
"$",
"al... | Get path of media.
@param MediaInterface $media
@param string|array|null $alias
return string path of media ex: /var/www/exemple.tld/web/medias/123x456_focus/9485990a0e13c3ef2adddb69a75a64d44c40caa7.jpg | [
"Get",
"path",
"of",
"media",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L421-L424 |
223,632 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.getContent | public function getContent(MediaInterface $media, $alias = null)
{
return $this->filesystemManipulator->read($this->getAliasAndKey($media, $alias));
} | php | public function getContent(MediaInterface $media, $alias = null)
{
return $this->filesystemManipulator->read($this->getAliasAndKey($media, $alias));
} | [
"public",
"function",
"getContent",
"(",
"MediaInterface",
"$",
"media",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"return",
"$",
"this",
"->",
"filesystemManipulator",
"->",
"read",
"(",
"$",
"this",
"->",
"getAliasAndKey",
"(",
"$",
"media",
",",
"$",
... | Get content of file.
@param MediaInterface $media
@param string|array|null $alias
@return string | [
"Get",
"content",
"of",
"file",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L434-L437 |
223,633 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.getAliasAndKey | public function getAliasAndKey(MediaInterface $media, $alias = null)
{
$aliasManipulator = $this->aliasManipulatorFactory->setAlias($alias);
if ($media->getType() === $media::IMAGE) {
$alias = $aliasManipulator->getAliasName();
if ($alias !== $this->originalDir) {
... | php | public function getAliasAndKey(MediaInterface $media, $alias = null)
{
$aliasManipulator = $this->aliasManipulatorFactory->setAlias($alias);
if ($media->getType() === $media::IMAGE) {
$alias = $aliasManipulator->getAliasName();
if ($alias !== $this->originalDir) {
... | [
"public",
"function",
"getAliasAndKey",
"(",
"MediaInterface",
"$",
"media",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"$",
"aliasManipulator",
"=",
"$",
"this",
"->",
"aliasManipulatorFactory",
"->",
"setAlias",
"(",
"$",
"alias",
")",
";",
"if",
"(",
"$"... | Get key of media for filesystem. If image with alias, crop it.
@param MediaInterface $media
@param string|array|null $alias
@return string | [
"Get",
"key",
"of",
"media",
"for",
"filesystem",
".",
"If",
"image",
"with",
"alias",
"crop",
"it",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L447-L462 |
223,634 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.cropImage | private function cropImage(MediaInterface $media, AliasManipulator $aliasManipulator)
{
$aliasName = $aliasManipulator->getAliasName();
$aliasArray = $aliasManipulator->getAliasArray();
$mediaPath = $aliasName.'/'.$media->getReference();
if ($this->filesystemManipulator->has($mediaP... | php | private function cropImage(MediaInterface $media, AliasManipulator $aliasManipulator)
{
$aliasName = $aliasManipulator->getAliasName();
$aliasArray = $aliasManipulator->getAliasArray();
$mediaPath = $aliasName.'/'.$media->getReference();
if ($this->filesystemManipulator->has($mediaP... | [
"private",
"function",
"cropImage",
"(",
"MediaInterface",
"$",
"media",
",",
"AliasManipulator",
"$",
"aliasManipulator",
")",
"{",
"$",
"aliasName",
"=",
"$",
"aliasManipulator",
"->",
"getAliasName",
"(",
")",
";",
"$",
"aliasArray",
"=",
"$",
"aliasManipulat... | Crop image if is not exists in alias.
@param MediaInterface $media
@param AliasManipulator $aliasManipulator | [
"Crop",
"image",
"if",
"is",
"not",
"exists",
"in",
"alias",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L470-L504 |
223,635 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.getHtml | public function getHtml(MediaInterface $media, $alias = null)
{
if ($media->getType() == $media::IMAGE) {
$template = 'ApoutchikaMediaBundle:Render:image.html.twig';
} elseif ($media->getType() == $media::VIDEO) {
$template = 'ApoutchikaMediaBundle:Render:video.html.twig';
... | php | public function getHtml(MediaInterface $media, $alias = null)
{
if ($media->getType() == $media::IMAGE) {
$template = 'ApoutchikaMediaBundle:Render:image.html.twig';
} elseif ($media->getType() == $media::VIDEO) {
$template = 'ApoutchikaMediaBundle:Render:video.html.twig';
... | [
"public",
"function",
"getHtml",
"(",
"MediaInterface",
"$",
"media",
",",
"$",
"alias",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"media",
"->",
"getType",
"(",
")",
"==",
"$",
"media",
"::",
"IMAGE",
")",
"{",
"$",
"template",
"=",
"'ApoutchikaMediaBund... | Render html of media.
@param MediaInterface $media
@param string|array|null $alias
@return string render of media html | [
"Render",
"html",
"of",
"media",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L514-L531 |
223,636 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.reset | public function reset(MediaInterface $media = null, $onlyFocus = false)
{
if ($onlyFocus === true) {
$regex = '#^\d*x\d*_focus/';
} else {
$regex = '#^\d*x\d*(_focus)?/';
}
$regex .= ($media !== null) ? $media->getReference() : '.*';
$regex .= '$#';
... | php | public function reset(MediaInterface $media = null, $onlyFocus = false)
{
if ($onlyFocus === true) {
$regex = '#^\d*x\d*_focus/';
} else {
$regex = '#^\d*x\d*(_focus)?/';
}
$regex .= ($media !== null) ? $media->getReference() : '.*';
$regex .= '$#';
... | [
"public",
"function",
"reset",
"(",
"MediaInterface",
"$",
"media",
"=",
"null",
",",
"$",
"onlyFocus",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"onlyFocus",
"===",
"true",
")",
"{",
"$",
"regex",
"=",
"'#^\\d*x\\d*_focus/'",
";",
"}",
"else",
"{",
"$",... | Remove empty directory
Remove cache of media.
@param MediaInterface|null $media If is defined, only cache of this file is removed
@param bool $onlyFocus Remove media only for focus cache | [
"Remove",
"empty",
"directory",
"Remove",
"cache",
"of",
"media",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L540-L556 |
223,637 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.save | public function save($media, $flush = true)
{
if ($media->getFile() !== null) {
if ($this->saveFile($media) === false) {
return false;
}
}
if ($media->getFocusIsEdited() === true) {
$this->reset($media, true);
$media->setFocusI... | php | public function save($media, $flush = true)
{
if ($media->getFile() !== null) {
if ($this->saveFile($media) === false) {
return false;
}
}
if ($media->getFocusIsEdited() === true) {
$this->reset($media, true);
$media->setFocusI... | [
"public",
"function",
"save",
"(",
"$",
"media",
",",
"$",
"flush",
"=",
"true",
")",
"{",
"if",
"(",
"$",
"media",
"->",
"getFile",
"(",
")",
"!==",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"saveFile",
"(",
"$",
"media",
")",
"===",
"fa... | Save media.
@param MediaInterface $media
@param bool $flush
@return bool If return false (when add new file), the error is in $error attribute | [
"Save",
"media",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L566-L584 |
223,638 | apoutchika/MediaBundle | Manager/MediaManager.php | MediaManager.create | public function create($path = null)
{
$media = new $this->class();
if ($path !== null) {
$media->setFile(new \Symfony\Component\HttpFoundation\File\File($path));
}
return $media;
} | php | public function create($path = null)
{
$media = new $this->class();
if ($path !== null) {
$media->setFile(new \Symfony\Component\HttpFoundation\File\File($path));
}
return $media;
} | [
"public",
"function",
"create",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"media",
"=",
"new",
"$",
"this",
"->",
"class",
"(",
")",
";",
"if",
"(",
"$",
"path",
"!==",
"null",
")",
"{",
"$",
"media",
"->",
"setFile",
"(",
"new",
"\\",
"Sym... | Create media object.
@param string $path path of media
@return MediaInterface | [
"Create",
"media",
"object",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Manager/MediaManager.php#L633-L642 |
223,639 | puli/manager | src/Module/ModuleManagerImpl.php | ModuleManagerImpl.loadModules | private function loadModules()
{
$this->modules = new ModuleList();
$this->modules->add(new RootModule($this->rootModuleFile, $this->rootDir));
foreach ($this->rootModuleFile->getInstallInfos() as $installInfo) {
$this->modules->add($this->loadModule($installInfo));
}
... | php | private function loadModules()
{
$this->modules = new ModuleList();
$this->modules->add(new RootModule($this->rootModuleFile, $this->rootDir));
foreach ($this->rootModuleFile->getInstallInfos() as $installInfo) {
$this->modules->add($this->loadModule($installInfo));
}
... | [
"private",
"function",
"loadModules",
"(",
")",
"{",
"$",
"this",
"->",
"modules",
"=",
"new",
"ModuleList",
"(",
")",
";",
"$",
"this",
"->",
"modules",
"->",
"add",
"(",
"new",
"RootModule",
"(",
"$",
"this",
"->",
"rootModuleFile",
",",
"$",
"this",... | Loads all modules referenced by the install file.
@throws FileNotFoundException If the install path of a module not exist.
@throws NoDirectoryException If the install path of a module points to a
file.
@throws InvalidConfigException If a module is not configured correctly.
@throws NameConflictException If a module... | [
"Loads",
"all",
"modules",
"referenced",
"by",
"the",
"install",
"file",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Module/ModuleManagerImpl.php#L343-L351 |
223,640 | puli/manager | src/Module/ModuleManagerImpl.php | ModuleManagerImpl.loadModule | private function loadModule(InstallInfo $installInfo)
{
$installPath = Path::makeAbsolute($installInfo->getInstallPath(), $this->rootDir);
$moduleFile = null;
$loadError = null;
// Catch and log exceptions so that single modules cannot break
// the whole repository
t... | php | private function loadModule(InstallInfo $installInfo)
{
$installPath = Path::makeAbsolute($installInfo->getInstallPath(), $this->rootDir);
$moduleFile = null;
$loadError = null;
// Catch and log exceptions so that single modules cannot break
// the whole repository
t... | [
"private",
"function",
"loadModule",
"(",
"InstallInfo",
"$",
"installInfo",
")",
"{",
"$",
"installPath",
"=",
"Path",
"::",
"makeAbsolute",
"(",
"$",
"installInfo",
"->",
"getInstallPath",
"(",
")",
",",
"$",
"this",
"->",
"rootDir",
")",
";",
"$",
"modu... | Loads a module for the given install info.
@param InstallInfo $installInfo The install info.
@return Module The module. | [
"Loads",
"a",
"module",
"for",
"the",
"given",
"install",
"info",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Module/ModuleManagerImpl.php#L360-L379 |
223,641 | puli/manager | src/Module/ModuleManagerImpl.php | ModuleManagerImpl.loadModuleFile | private function loadModuleFile($installPath)
{
if (!file_exists($installPath)) {
throw FileNotFoundException::forPath($installPath);
}
if (!is_dir($installPath)) {
throw new NoDirectoryException(sprintf(
'The path %s is a file. Expected a directory.'... | php | private function loadModuleFile($installPath)
{
if (!file_exists($installPath)) {
throw FileNotFoundException::forPath($installPath);
}
if (!is_dir($installPath)) {
throw new NoDirectoryException(sprintf(
'The path %s is a file. Expected a directory.'... | [
"private",
"function",
"loadModuleFile",
"(",
"$",
"installPath",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"installPath",
")",
")",
"{",
"throw",
"FileNotFoundException",
"::",
"forPath",
"(",
"$",
"installPath",
")",
";",
"}",
"if",
"(",
"!",
... | Loads the module file for the module at the given install path.
@param string $installPath The absolute install path of the module
@return ModuleFile|null The loaded module file or `null` if none
could be found. | [
"Loads",
"the",
"module",
"file",
"for",
"the",
"module",
"at",
"the",
"given",
"install",
"path",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Module/ModuleManagerImpl.php#L389-L408 |
223,642 | puli/manager | src/Discovery/Binding/BindingDescriptorCollection.php | BindingDescriptorCollection.get | public function get(Uuid $uuid)
{
if (!isset($this->map[$uuid->toString()])) {
throw new OutOfBoundsException(sprintf(
'The binding with UUID "%s" does not exist.',
$uuid->toString()
));
}
return $this->map[$uuid->toString()];
} | php | public function get(Uuid $uuid)
{
if (!isset($this->map[$uuid->toString()])) {
throw new OutOfBoundsException(sprintf(
'The binding with UUID "%s" does not exist.',
$uuid->toString()
));
}
return $this->map[$uuid->toString()];
} | [
"public",
"function",
"get",
"(",
"Uuid",
"$",
"uuid",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"map",
"[",
"$",
"uuid",
"->",
"toString",
"(",
")",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
... | Returns a binding descriptor.
@param Uuid $uuid The UUID of the binding descriptor.
@return BindingDescriptor The binding descriptor.
@throws OutOfBoundsException If no binding descriptor was set for the
given UUID. | [
"Returns",
"a",
"binding",
"descriptor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Discovery/Binding/BindingDescriptorCollection.php#L72-L82 |
223,643 | puli/manager | src/Discovery/Binding/BindingDescriptorCollection.php | BindingDescriptorCollection.getUuids | public function getUuids()
{
$uuids = array();
foreach ($this->map as $bindingDescriptor) {
$uuids[] = $bindingDescriptor->getUuid();
}
return $uuids;
} | php | public function getUuids()
{
$uuids = array();
foreach ($this->map as $bindingDescriptor) {
$uuids[] = $bindingDescriptor->getUuid();
}
return $uuids;
} | [
"public",
"function",
"getUuids",
"(",
")",
"{",
"$",
"uuids",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"map",
"as",
"$",
"bindingDescriptor",
")",
"{",
"$",
"uuids",
"[",
"]",
"=",
"$",
"bindingDescriptor",
"->",
"getUuid",
"(... | Returns the UUIDs of all binding descriptors.
@return Uuid[] The UUIDs of the stored bindings. | [
"Returns",
"the",
"UUIDs",
"of",
"all",
"binding",
"descriptors",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Discovery/Binding/BindingDescriptorCollection.php#L102-L111 |
223,644 | madeyourday/contao-rocksolid-columns | src/Element/ColumnStart.php | ColumnStart.compile | public function compile()
{
if (TL_MODE == 'BE') {
$this->strTemplate = 'be_wildcard';
$this->Template = new \BackendTemplate($this->strTemplate);
$this->Template->title = $this->headline;
}
else {
$this->Template = new \FrontendTemplate($this->strTemplate);
$this->Template->setData($this->arrData... | php | public function compile()
{
if (TL_MODE == 'BE') {
$this->strTemplate = 'be_wildcard';
$this->Template = new \BackendTemplate($this->strTemplate);
$this->Template->title = $this->headline;
}
else {
$this->Template = new \FrontendTemplate($this->strTemplate);
$this->Template->setData($this->arrData... | [
"public",
"function",
"compile",
"(",
")",
"{",
"if",
"(",
"TL_MODE",
"==",
"'BE'",
")",
"{",
"$",
"this",
"->",
"strTemplate",
"=",
"'be_wildcard'",
";",
"$",
"this",
"->",
"Template",
"=",
"new",
"\\",
"BackendTemplate",
"(",
"$",
"this",
"->",
"strT... | Compile the content element
@return void | [
"Compile",
"the",
"content",
"element"
] | 35ca1f9b17c19fd0b774ed3307a85b58fa4b2705 | https://github.com/madeyourday/contao-rocksolid-columns/blob/35ca1f9b17c19fd0b774ed3307a85b58fa4b2705/src/Element/ColumnStart.php#L68-L79 |
223,645 | puli/manager | src/Api/Module/InstallInfo.php | InstallInfo.setEnvironment | public function setEnvironment($env)
{
Assert::oneOf($env, Environment::all(), 'The environment must be one of: %2$s. Got: %s');
$this->env = $env;
} | php | public function setEnvironment($env)
{
Assert::oneOf($env, Environment::all(), 'The environment must be one of: %2$s. Got: %s');
$this->env = $env;
} | [
"public",
"function",
"setEnvironment",
"(",
"$",
"env",
")",
"{",
"Assert",
"::",
"oneOf",
"(",
"$",
"env",
",",
"Environment",
"::",
"all",
"(",
")",
",",
"'The environment must be one of: %2$s. Got: %s'",
")",
";",
"$",
"this",
"->",
"env",
"=",
"$",
"e... | Sets the environment that the module is installed in.
@param string $env One of the {@link Environment} constants. | [
"Sets",
"the",
"environment",
"that",
"the",
"module",
"is",
"installed",
"in",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/InstallInfo.php#L180-L185 |
223,646 | apoutchika/MediaBundle | Controller/MediaRestController.php | MediaRestController.getMediasAction | public function getMediasAction(Request $request)
{
if (!$request->query->has('filters')) {
return $this->createResponse(array());
}
$mediaManager = $this->getMediaManager();
$filtersKeys = explode(',', $request->query->get('filters'));
$medias = $mediaManager->... | php | public function getMediasAction(Request $request)
{
if (!$request->query->has('filters')) {
return $this->createResponse(array());
}
$mediaManager = $this->getMediaManager();
$filtersKeys = explode(',', $request->query->get('filters'));
$medias = $mediaManager->... | [
"public",
"function",
"getMediasAction",
"(",
"Request",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
"->",
"query",
"->",
"has",
"(",
"'filters'",
")",
")",
"{",
"return",
"$",
"this",
"->",
"createResponse",
"(",
"array",
"(",
")",
")",
... | Get all medias.
@param Request $request
@return Response array of medias | [
"Get",
"all",
"medias",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Controller/MediaRestController.php#L102-L114 |
223,647 | apoutchika/MediaBundle | Controller/MediaRestController.php | MediaRestController.postMediaAction | public function postMediaAction(Request $request)
{
$response = $this->getFilter($request);
if ($response['success'] === false) {
return $response['value'];
}
$filter = $response['value'];
$mm = $this->getMediaManager();
$media = $mm->create();
$... | php | public function postMediaAction(Request $request)
{
$response = $this->getFilter($request);
if ($response['success'] === false) {
return $response['value'];
}
$filter = $response['value'];
$mm = $this->getMediaManager();
$media = $mm->create();
$... | [
"public",
"function",
"postMediaAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getFilter",
"(",
"$",
"request",
")",
";",
"if",
"(",
"$",
"response",
"[",
"'success'",
"]",
"===",
"false",
")",
"{",
"return... | Add new media.
@param Request $request
@return Response media | [
"Add",
"new",
"media",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Controller/MediaRestController.php#L153-L182 |
223,648 | apoutchika/MediaBundle | Controller/MediaRestController.php | MediaRestController.getFilter | private function getFilter(Request $request)
{
$success = false;
$filter = null;
if ($request->query->has('filter')) {
$filter = $request->query->get('filter');
$type = 'query';
} elseif ($request->request->has('filter')) {
$filter = $request->requ... | php | private function getFilter(Request $request)
{
$success = false;
$filter = null;
if ($request->query->has('filter')) {
$filter = $request->query->get('filter');
$type = 'query';
} elseif ($request->request->has('filter')) {
$filter = $request->requ... | [
"private",
"function",
"getFilter",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"success",
"=",
"false",
";",
"$",
"filter",
"=",
"null",
";",
"if",
"(",
"$",
"request",
"->",
"query",
"->",
"has",
"(",
"'filter'",
")",
")",
"{",
"$",
"filter",
... | Get is filter is send and verify if is a valid filter.
@param Request $request
@return Array | [
"Get",
"is",
"filter",
"is",
"send",
"and",
"verify",
"if",
"is",
"a",
"valid",
"filter",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Controller/MediaRestController.php#L316-L356 |
223,649 | apoutchika/MediaBundle | Controller/MediaRestController.php | MediaRestController.searchMediaAction | public function searchMediaAction(Request $request)
{
$response = $this->getFilter($request);
if ($response['success'] === false) {
return $response['value'];
}
$filter = $response['crypted'];
$mm = $this->getMediaManager();
$q = ($request->query->has('q... | php | public function searchMediaAction(Request $request)
{
$response = $this->getFilter($request);
if ($response['success'] === false) {
return $response['value'];
}
$filter = $response['crypted'];
$mm = $this->getMediaManager();
$q = ($request->query->has('q... | [
"public",
"function",
"searchMediaAction",
"(",
"Request",
"$",
"request",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"getFilter",
"(",
"$",
"request",
")",
";",
"if",
"(",
"$",
"response",
"[",
"'success'",
"]",
"===",
"false",
")",
"{",
"retu... | Search medias.
@param Request $request
@return Response array of medias | [
"Search",
"medias",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Controller/MediaRestController.php#L365-L381 |
223,650 | puli/manager | src/Repository/Mapping/PathMappingCollection.php | PathMappingCollection.set | public function set($repositoryPath, PathMapping $mapping)
{
$this->map->set($repositoryPath, $mapping->getContainingModule()->getName(), $mapping);
$this->primaryKeysSorted = false;
} | php | public function set($repositoryPath, PathMapping $mapping)
{
$this->map->set($repositoryPath, $mapping->getContainingModule()->getName(), $mapping);
$this->primaryKeysSorted = false;
} | [
"public",
"function",
"set",
"(",
"$",
"repositoryPath",
",",
"PathMapping",
"$",
"mapping",
")",
"{",
"$",
"this",
"->",
"map",
"->",
"set",
"(",
"$",
"repositoryPath",
",",
"$",
"mapping",
"->",
"getContainingModule",
"(",
")",
"->",
"getName",
"(",
")... | Sets a path mapping for a specific repository path.
@param string $repositoryPath The repository path.
@param PathMapping $mapping The path mapping. | [
"Sets",
"a",
"path",
"mapping",
"for",
"a",
"specific",
"repository",
"path",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Repository/Mapping/PathMappingCollection.php#L67-L71 |
223,651 | puli/manager | src/Repository/Mapping/PathMappingCollection.php | PathMappingCollection.listByModuleName | public function listByModuleName($moduleName)
{
if ($this->primaryKeysSorted) {
$this->lazySortPrimaryKeys();
}
return $this->map->listBySecondaryKey($moduleName);
} | php | public function listByModuleName($moduleName)
{
if ($this->primaryKeysSorted) {
$this->lazySortPrimaryKeys();
}
return $this->map->listBySecondaryKey($moduleName);
} | [
"public",
"function",
"listByModuleName",
"(",
"$",
"moduleName",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"primaryKeysSorted",
")",
"{",
"$",
"this",
"->",
"lazySortPrimaryKeys",
"(",
")",
";",
"}",
"return",
"$",
"this",
"->",
"map",
"->",
"listBySecondar... | Returns all path mappings set for the given module name.
@param string $moduleName The module name.
@return PathMapping[] The path mappings.
@throws OutOfBoundsException If no path mapping was set for the
given module name. | [
"Returns",
"all",
"path",
"mappings",
"set",
"for",
"the",
"given",
"module",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Repository/Mapping/PathMappingCollection.php#L142-L149 |
223,652 | apoutchika/MediaBundle | Services/Image/Focus.php | Focus.getStartCrop | public function getStartCrop($origin, $target, $focus)
{
$focusPx = round(($origin * $focus) / 100);
$start = $focusPx - ($target / 2);
if ($start <= 0) {
return 0;
}
if (($start + $target) >= $origin) {
return $origin - $target;
}
r... | php | public function getStartCrop($origin, $target, $focus)
{
$focusPx = round(($origin * $focus) / 100);
$start = $focusPx - ($target / 2);
if ($start <= 0) {
return 0;
}
if (($start + $target) >= $origin) {
return $origin - $target;
}
r... | [
"public",
"function",
"getStartCrop",
"(",
"$",
"origin",
",",
"$",
"target",
",",
"$",
"focus",
")",
"{",
"$",
"focusPx",
"=",
"round",
"(",
"(",
"$",
"origin",
"*",
"$",
"focus",
")",
"/",
"100",
")",
";",
"$",
"start",
"=",
"$",
"focusPx",
"-"... | Get start to crop by focus.
@param int $origin
@param int $target
@param int $focus
@return int | [
"Get",
"start",
"to",
"crop",
"by",
"focus",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/Image/Focus.php#L181-L195 |
223,653 | puli/manager | src/Discovery/Binding/SyncBindingUuid.php | SyncBindingUuid.takeSnapshot | public function takeSnapshot()
{
$this->enabledBindingBefore = null;
if ($this->bindingDescriptors->contains($this->uuid)) {
$bindingDescriptor = $this->bindingDescriptors->get($this->uuid);
if ($bindingDescriptor->isEnabled()) {
// Clone so that rollback() ... | php | public function takeSnapshot()
{
$this->enabledBindingBefore = null;
if ($this->bindingDescriptors->contains($this->uuid)) {
$bindingDescriptor = $this->bindingDescriptors->get($this->uuid);
if ($bindingDescriptor->isEnabled()) {
// Clone so that rollback() ... | [
"public",
"function",
"takeSnapshot",
"(",
")",
"{",
"$",
"this",
"->",
"enabledBindingBefore",
"=",
"null",
";",
"if",
"(",
"$",
"this",
"->",
"bindingDescriptors",
"->",
"contains",
"(",
"$",
"this",
"->",
"uuid",
")",
")",
"{",
"$",
"bindingDescriptor",... | Records whether the UUID is currently enabled. | [
"Records",
"whether",
"the",
"UUID",
"is",
"currently",
"enabled",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Discovery/Binding/SyncBindingUuid.php#L77-L91 |
223,654 | nilportugues/php-sitemap | src/AbstractSitemap.php | AbstractSitemap.isSurpassingFileSizeLimit | protected function isSurpassingFileSizeLimit($stringData)
{
$expectedFileSize = $this->accommulatedFileSize + $this->getStringSize($stringData);
return $this->maxFilesize < $expectedFileSize;
} | php | protected function isSurpassingFileSizeLimit($stringData)
{
$expectedFileSize = $this->accommulatedFileSize + $this->getStringSize($stringData);
return $this->maxFilesize < $expectedFileSize;
} | [
"protected",
"function",
"isSurpassingFileSizeLimit",
"(",
"$",
"stringData",
")",
"{",
"$",
"expectedFileSize",
"=",
"$",
"this",
"->",
"accommulatedFileSize",
"+",
"$",
"this",
"->",
"getStringSize",
"(",
"$",
"stringData",
")",
";",
"return",
"$",
"this",
"... | Before appending data we need to check if we'll surpass the file size limit or not.
@param $stringData
@return bool | [
"Before",
"appending",
"data",
"we",
"need",
"to",
"check",
"if",
"we",
"ll",
"surpass",
"the",
"file",
"size",
"limit",
"or",
"not",
"."
] | b1c7109d6e0c30ee9a0f9ef3b73bac406add9bfd | https://github.com/nilportugues/php-sitemap/blob/b1c7109d6e0c30ee9a0f9ef3b73bac406add9bfd/src/AbstractSitemap.php#L186-L191 |
223,655 | nilportugues/php-sitemap | src/AbstractSitemap.php | AbstractSitemap.build | public function build()
{
$this->appendToFile($this->getFooter());
if ($this->gzipOutput) {
$this->writeGZipFile();
}
\fclose($this->filePointer);
} | php | public function build()
{
$this->appendToFile($this->getFooter());
if ($this->gzipOutput) {
$this->writeGZipFile();
}
\fclose($this->filePointer);
} | [
"public",
"function",
"build",
"(",
")",
"{",
"$",
"this",
"->",
"appendToFile",
"(",
"$",
"this",
"->",
"getFooter",
"(",
")",
")",
";",
"if",
"(",
"$",
"this",
"->",
"gzipOutput",
")",
"{",
"$",
"this",
"->",
"writeGZipFile",
"(",
")",
";",
"}",
... | Generates sitemap file.
@return mixed | [
"Generates",
"sitemap",
"file",
"."
] | b1c7109d6e0c30ee9a0f9ef3b73bac406add9bfd | https://github.com/nilportugues/php-sitemap/blob/b1c7109d6e0c30ee9a0f9ef3b73bac406add9bfd/src/AbstractSitemap.php#L225-L234 |
223,656 | middlewares/negotiation | src/ContentLanguage.php | ContentLanguage.detectFromPath | private function detectFromPath(string $path)
{
if (!$this->usePath) {
return null;
}
$dirs = explode('/', ltrim($path, '/'), 2);
$first = strtolower((string) array_shift($dirs));
if (!empty($first) && in_array($first, $this->languages, true)) {
retu... | php | private function detectFromPath(string $path)
{
if (!$this->usePath) {
return null;
}
$dirs = explode('/', ltrim($path, '/'), 2);
$first = strtolower((string) array_shift($dirs));
if (!empty($first) && in_array($first, $this->languages, true)) {
retu... | [
"private",
"function",
"detectFromPath",
"(",
"string",
"$",
"path",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"usePath",
")",
"{",
"return",
"null",
";",
"}",
"$",
"dirs",
"=",
"explode",
"(",
"'/'",
",",
"ltrim",
"(",
"$",
"path",
",",
"'/'",
... | Returns the language from the first part of the path if it's in the allowed languages.
@return null|string | [
"Returns",
"the",
"language",
"from",
"the",
"first",
"part",
"of",
"the",
"path",
"if",
"it",
"s",
"in",
"the",
"allowed",
"languages",
"."
] | 107d31132cd5af446be97827bfd0202f15189a34 | https://github.com/middlewares/negotiation/blob/107d31132cd5af446be97827bfd0202f15189a34/src/ContentLanguage.php#L98-L110 |
223,657 | middlewares/negotiation | src/ContentLanguage.php | ContentLanguage.detectFromHeader | private function detectFromHeader(ServerRequestInterface $request)
{
$accept = $request->getHeaderLine('Accept-Language');
$language = $this->negotiateHeader($accept, new LanguageNegotiator(), $this->languages);
if (empty($language)) {
return isset($this->languages[0]) ? $this->... | php | private function detectFromHeader(ServerRequestInterface $request)
{
$accept = $request->getHeaderLine('Accept-Language');
$language = $this->negotiateHeader($accept, new LanguageNegotiator(), $this->languages);
if (empty($language)) {
return isset($this->languages[0]) ? $this->... | [
"private",
"function",
"detectFromHeader",
"(",
"ServerRequestInterface",
"$",
"request",
")",
"{",
"$",
"accept",
"=",
"$",
"request",
"->",
"getHeaderLine",
"(",
"'Accept-Language'",
")",
";",
"$",
"language",
"=",
"$",
"this",
"->",
"negotiateHeader",
"(",
... | Returns the format using the Accept-Language header.
@return null|string | [
"Returns",
"the",
"format",
"using",
"the",
"Accept",
"-",
"Language",
"header",
"."
] | 107d31132cd5af446be97827bfd0202f15189a34 | https://github.com/middlewares/negotiation/blob/107d31132cd5af446be97827bfd0202f15189a34/src/ContentLanguage.php#L117-L127 |
223,658 | puli/manager | src/Api/Repository/NoSuchPathMappingException.php | NoSuchPathMappingException.forRepositoryPathAndModule | public static function forRepositoryPathAndModule($path, $moduleName, Exception $cause = null)
{
return new static(sprintf(
'The repository path "%s" is not mapped in module "%s".',
$path,
$moduleName
), 0, $cause);
} | php | public static function forRepositoryPathAndModule($path, $moduleName, Exception $cause = null)
{
return new static(sprintf(
'The repository path "%s" is not mapped in module "%s".',
$path,
$moduleName
), 0, $cause);
} | [
"public",
"static",
"function",
"forRepositoryPathAndModule",
"(",
"$",
"path",
",",
"$",
"moduleName",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The repository path \"%s\" is not mapped in module \"%s\".'... | Creates an exception for a repository path and a module name.
@param string $path The repository path.
@param string $moduleName The name of the containing module.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"a",
"repository",
"path",
"and",
"a",
"module",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Repository/NoSuchPathMappingException.php#L52-L59 |
223,659 | puli/manager | src/Util/System.php | System.parseHomeDirectory | public static function parseHomeDirectory()
{
if ($value = getenv('PULI_HOME')) {
$homeDir = $value;
$env = 'PULI_HOME';
} elseif ($value = getenv('HOME')) {
$homeDir = $value;
$env = 'HOME';
} elseif ($value = getenv('APPDATA')) {
... | php | public static function parseHomeDirectory()
{
if ($value = getenv('PULI_HOME')) {
$homeDir = $value;
$env = 'PULI_HOME';
} elseif ($value = getenv('HOME')) {
$homeDir = $value;
$env = 'HOME';
} elseif ($value = getenv('APPDATA')) {
... | [
"public",
"static",
"function",
"parseHomeDirectory",
"(",
")",
"{",
"if",
"(",
"$",
"value",
"=",
"getenv",
"(",
"'PULI_HOME'",
")",
")",
"{",
"$",
"homeDir",
"=",
"$",
"value",
";",
"$",
"env",
"=",
"'PULI_HOME'",
";",
"}",
"elseif",
"(",
"$",
"val... | Parses context variables for Puli's home directory.
This method scans the context variables "PULI_HOME", "HOME" and
"APPDATA" to determine Puli's home directory:
* If "PULI_HOME" is found, that directory is used.
* If "HOME" is found, a directory ".puli" is created inside. This
variable contains the path of the user'... | [
"Parses",
"context",
"variables",
"for",
"Puli",
"s",
"home",
"directory",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/System.php#L49-L96 |
223,660 | puli/manager | src/Util/System.php | System.denyWebAccess | public static function denyWebAccess($directory)
{
if (!file_exists($directory.'/.htaccess')) {
if (!is_dir($directory)) {
$filesystem = new Filesystem();
$filesystem->mkdir($directory);
}
@file_put_contents($directory.'/.htaccess', 'Deny ... | php | public static function denyWebAccess($directory)
{
if (!file_exists($directory.'/.htaccess')) {
if (!is_dir($directory)) {
$filesystem = new Filesystem();
$filesystem->mkdir($directory);
}
@file_put_contents($directory.'/.htaccess', 'Deny ... | [
"public",
"static",
"function",
"denyWebAccess",
"(",
"$",
"directory",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"directory",
".",
"'/.htaccess'",
")",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"directory",
")",
")",
"{",
"$",
"filesystem... | Denies web access to a directory path.
A .htaccess file with the contents "Deny from all" is placed in the
directory, unless a .htaccess file exists already.
@param string $directory The path to a directory. | [
"Denies",
"web",
"access",
"to",
"a",
"directory",
"path",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/System.php#L106-L116 |
223,661 | apoutchika/MediaBundle | Services/AliasManipulator.php | AliasManipulator.valideAliasName | public function valideAliasName($aliasName)
{
if ($aliasName === null || $aliasName === $this->originalDir) {
return $this->originalDir;
}
if (array_key_exists($aliasName, $this->alias)) {
return $this->aliasArrayToName($this->alias[$aliasName]);
}
i... | php | public function valideAliasName($aliasName)
{
if ($aliasName === null || $aliasName === $this->originalDir) {
return $this->originalDir;
}
if (array_key_exists($aliasName, $this->alias)) {
return $this->aliasArrayToName($this->alias[$aliasName]);
}
i... | [
"public",
"function",
"valideAliasName",
"(",
"$",
"aliasName",
")",
"{",
"if",
"(",
"$",
"aliasName",
"===",
"null",
"||",
"$",
"aliasName",
"===",
"$",
"this",
"->",
"originalDir",
")",
"{",
"return",
"$",
"this",
"->",
"originalDir",
";",
"}",
"if",
... | Verify if the alias name is valid.
@param string $aliasName
@return string (alias name); | [
"Verify",
"if",
"the",
"alias",
"name",
"is",
"valid",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/AliasManipulator.php#L101-L120 |
223,662 | apoutchika/MediaBundle | Services/AliasManipulator.php | AliasManipulator.valideAliasArray | public function valideAliasArray($aliasArray)
{
$aliasArray = array_replace(array('width' => null, 'height' => null), $aliasArray);
foreach ($aliasArray as $name => $value) {
if (!in_array($name, array('width', 'height', 'focus'))) {
throw new \Exception($name.' is not a... | php | public function valideAliasArray($aliasArray)
{
$aliasArray = array_replace(array('width' => null, 'height' => null), $aliasArray);
foreach ($aliasArray as $name => $value) {
if (!in_array($name, array('width', 'height', 'focus'))) {
throw new \Exception($name.' is not a... | [
"public",
"function",
"valideAliasArray",
"(",
"$",
"aliasArray",
")",
"{",
"$",
"aliasArray",
"=",
"array_replace",
"(",
"array",
"(",
"'width'",
"=>",
"null",
",",
"'height'",
"=>",
"null",
")",
",",
"$",
"aliasArray",
")",
";",
"foreach",
"(",
"$",
"a... | Verify alias array.
@param array $aliasArray
@return array ($aliasArray) | [
"Verify",
"alias",
"array",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/AliasManipulator.php#L129-L154 |
223,663 | apoutchika/MediaBundle | Services/AliasManipulator.php | AliasManipulator.aliasArrayToName | private function aliasArrayToName(array $aliasArray)
{
if ($aliasArray === null || (empty($aliasArray['width']) && empty($aliasArray['height']))) {
return $this->originalDir;
}
if (!empty($aliasArray['focus'])) {
if (!in_array($aliasArray['focus'], array(true, false)... | php | private function aliasArrayToName(array $aliasArray)
{
if ($aliasArray === null || (empty($aliasArray['width']) && empty($aliasArray['height']))) {
return $this->originalDir;
}
if (!empty($aliasArray['focus'])) {
if (!in_array($aliasArray['focus'], array(true, false)... | [
"private",
"function",
"aliasArrayToName",
"(",
"array",
"$",
"aliasArray",
")",
"{",
"if",
"(",
"$",
"aliasArray",
"===",
"null",
"||",
"(",
"empty",
"(",
"$",
"aliasArray",
"[",
"'width'",
"]",
")",
"&&",
"empty",
"(",
"$",
"aliasArray",
"[",
"'height'... | Transform aliass array to name.
@param array $aliasArray
@return string | [
"Transform",
"aliass",
"array",
"to",
"name",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/AliasManipulator.php#L163-L190 |
223,664 | apoutchika/MediaBundle | Services/AliasManipulator.php | AliasManipulator.aliasNameToArray | private function aliasNameToArray($aliasName)
{
if (!empty($aliasName) && isset($this->alias[$aliasName])) {
$aliasName = $this->aliasArrayToName($this->alias[$aliasName]);
} elseif (is_array($aliasName)) {
$aliasName = $this->aliasArrayToName($aliasName);
}
... | php | private function aliasNameToArray($aliasName)
{
if (!empty($aliasName) && isset($this->alias[$aliasName])) {
$aliasName = $this->aliasArrayToName($this->alias[$aliasName]);
} elseif (is_array($aliasName)) {
$aliasName = $this->aliasArrayToName($aliasName);
}
... | [
"private",
"function",
"aliasNameToArray",
"(",
"$",
"aliasName",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"aliasName",
")",
"&&",
"isset",
"(",
"$",
"this",
"->",
"alias",
"[",
"$",
"aliasName",
"]",
")",
")",
"{",
"$",
"aliasName",
"=",
"$",
... | Transform alias name to array.
@param string $aliasName
@return array | [
"Transform",
"alias",
"name",
"to",
"array",
"."
] | dd52efed4a4463041da73af2cb25bdbe00365fcc | https://github.com/apoutchika/MediaBundle/blob/dd52efed4a4463041da73af2cb25bdbe00365fcc/Services/AliasManipulator.php#L199-L222 |
223,665 | puli/manager | src/Api/Installer/InstallerDescriptor.php | InstallerDescriptor.getParameter | public function getParameter($parameterName)
{
if (!isset($this->parameters[$parameterName])) {
throw NoSuchParameterException::forParameterName($parameterName, $this->name);
}
return $this->parameters[$parameterName];
} | php | public function getParameter($parameterName)
{
if (!isset($this->parameters[$parameterName])) {
throw NoSuchParameterException::forParameterName($parameterName, $this->name);
}
return $this->parameters[$parameterName];
} | [
"public",
"function",
"getParameter",
"(",
"$",
"parameterName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"parameters",
"[",
"$",
"parameterName",
"]",
")",
")",
"{",
"throw",
"NoSuchParameterException",
"::",
"forParameterName",
"(",
"$",
... | Returns an installer parameter.
@param string $parameterName The parameter name.
@return InstallerParameter The installer parameter.
@throws NoSuchParameterException If the parameter does not exist. | [
"Returns",
"an",
"installer",
"parameter",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installer/InstallerDescriptor.php#L122-L129 |
223,666 | puli/manager | src/Api/Installer/InstallerDescriptor.php | InstallerDescriptor.getParameterValues | public function getParameterValues()
{
$values = array();
foreach ($this->parameters as $name => $parameter) {
if (!$parameter->isRequired()) {
$values[$name] = $parameter->getDefaultValue();
}
}
return $values;
} | php | public function getParameterValues()
{
$values = array();
foreach ($this->parameters as $name => $parameter) {
if (!$parameter->isRequired()) {
$values[$name] = $parameter->getDefaultValue();
}
}
return $values;
} | [
"public",
"function",
"getParameterValues",
"(",
")",
"{",
"$",
"values",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"parameters",
"as",
"$",
"name",
"=>",
"$",
"parameter",
")",
"{",
"if",
"(",
"!",
"$",
"parameter",
"->",
"isRe... | Returns the default values of all optional parameters.
@return array The default values. | [
"Returns",
"the",
"default",
"values",
"of",
"all",
"optional",
"parameters",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installer/InstallerDescriptor.php#L192-L203 |
223,667 | puli/manager | src/Api/Module/RootModuleFile.php | RootModuleFile.setInstallInfos | public function setInstallInfos(array $installInfos)
{
$this->installInfos = array();
foreach ($installInfos as $installInfo) {
$this->addInstallInfo($installInfo);
}
} | php | public function setInstallInfos(array $installInfos)
{
$this->installInfos = array();
foreach ($installInfos as $installInfo) {
$this->addInstallInfo($installInfo);
}
} | [
"public",
"function",
"setInstallInfos",
"(",
"array",
"$",
"installInfos",
")",
"{",
"$",
"this",
"->",
"installInfos",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"installInfos",
"as",
"$",
"installInfo",
")",
"{",
"$",
"this",
"->",
"addInstallInf... | Sets the install infos of all installed modules.
@param InstallInfo[] The install infos. | [
"Sets",
"the",
"install",
"infos",
"of",
"all",
"installed",
"modules",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/RootModuleFile.php#L114-L121 |
223,668 | puli/manager | src/Api/Module/RootModuleFile.php | RootModuleFile.getInstallInfo | public function getInstallInfo($moduleName)
{
if (!isset($this->installInfos[$moduleName])) {
throw new NoSuchModuleException(sprintf(
'Could not get install info: The module "%s" is not installed.',
$moduleName
));
}
return $this->ins... | php | public function getInstallInfo($moduleName)
{
if (!isset($this->installInfos[$moduleName])) {
throw new NoSuchModuleException(sprintf(
'Could not get install info: The module "%s" is not installed.',
$moduleName
));
}
return $this->ins... | [
"public",
"function",
"getInstallInfo",
"(",
"$",
"moduleName",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"installInfos",
"[",
"$",
"moduleName",
"]",
")",
")",
"{",
"throw",
"new",
"NoSuchModuleException",
"(",
"sprintf",
"(",
"'Could not... | Returns the install info of an installed module.
@param string $moduleName The module name.
@return InstallInfo The install info.
@throws NoSuchModuleException If no module is installed with that name. | [
"Returns",
"the",
"install",
"info",
"of",
"an",
"installed",
"module",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Module/RootModuleFile.php#L160-L170 |
223,669 | puli/manager | src/Api/Installation/InstallationParams.php | InstallationParams.getServerPathForResource | public function getServerPathForResource(PuliResource $resource)
{
$relPath = Path::makeRelative($resource->getRepositoryPath(), $this->basePath);
return '/'.trim($this->mapping->getServerPath().'/'.$relPath, '/');
} | php | public function getServerPathForResource(PuliResource $resource)
{
$relPath = Path::makeRelative($resource->getRepositoryPath(), $this->basePath);
return '/'.trim($this->mapping->getServerPath().'/'.$relPath, '/');
} | [
"public",
"function",
"getServerPathForResource",
"(",
"PuliResource",
"$",
"resource",
")",
"{",
"$",
"relPath",
"=",
"Path",
"::",
"makeRelative",
"(",
"$",
"resource",
"->",
"getRepositoryPath",
"(",
")",
",",
"$",
"this",
"->",
"basePath",
")",
";",
"ret... | Returns the path where a resource is going to be installed.
This is a path relative to the document root of the target server.
@param PuliResource $resource The resource.
@return string The server path. | [
"Returns",
"the",
"path",
"where",
"a",
"resource",
"is",
"going",
"to",
"be",
"installed",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installation/InstallationParams.php#L205-L210 |
223,670 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.setRecurrenceEventId | public function setRecurrenceEventId($entity = null): string
{
$start = $entity instanceof EntityInterface ? $entity->get('start_date') : $entity['start_date'];
$end = $entity instanceof EntityInterface ? $entity->get('end_date') : $entity['end_date'];
$id = $entity instanceof EntityInterfac... | php | public function setRecurrenceEventId($entity = null): string
{
$start = $entity instanceof EntityInterface ? $entity->get('start_date') : $entity['start_date'];
$end = $entity instanceof EntityInterface ? $entity->get('end_date') : $entity['end_date'];
$id = $entity instanceof EntityInterfac... | [
"public",
"function",
"setRecurrenceEventId",
"(",
"$",
"entity",
"=",
"null",
")",
":",
"string",
"{",
"$",
"start",
"=",
"$",
"entity",
"instanceof",
"EntityInterface",
"?",
"$",
"entity",
"->",
"get",
"(",
"'start_date'",
")",
":",
"$",
"entity",
"[",
... | Set ID suffix for recurring events
We attach timestamp suffix for recurring events
that haven't been saved in the DB yet.
@param \Cake\Datasource\EntityInterface|array $entity of the event
@return string $result with suffix. | [
"Set",
"ID",
"suffix",
"for",
"recurring",
"events"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L132-L141 |
223,671 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getRecurrenceEventId | public function getRecurrenceEventId(?string $id = null): array
{
$result = [];
if (empty($id)) {
return $result;
}
if (preg_match('/(^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})(__(\d+)?_(\d+)?)?/', $id, $matches)) {
$result... | php | public function getRecurrenceEventId(?string $id = null): array
{
$result = [];
if (empty($id)) {
return $result;
}
if (preg_match('/(^[a-fA-F0-9]{8}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{4}-[a-fA-F0-9]{12})(__(\d+)?_(\d+)?)?/', $id, $matches)) {
$result... | [
"public",
"function",
"getRecurrenceEventId",
"(",
"?",
"string",
"$",
"id",
"=",
"null",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"result",
";",
"}",
"if",
"(",
... | Parse recurrent event id suffix
@param string $id containing date suffix
@return mixed[] $result containing start/end pair. | [
"Parse",
"recurrent",
"event",
"id",
"suffix"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L149-L164 |
223,672 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getEvents | public function getEvents(?EntityInterface $calendar, array $options = [], bool $isInfinite = true): array
{
$result = [];
if (!$calendar) {
return $result;
}
$events = $this->findCalendarEvents($options);
/** @var \Cake\Datasource\EntityInterface $event */
... | php | public function getEvents(?EntityInterface $calendar, array $options = [], bool $isInfinite = true): array
{
$result = [];
if (!$calendar) {
return $result;
}
$events = $this->findCalendarEvents($options);
/** @var \Cake\Datasource\EntityInterface $event */
... | [
"public",
"function",
"getEvents",
"(",
"?",
"EntityInterface",
"$",
"calendar",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"bool",
"$",
"isInfinite",
"=",
"true",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"$... | Get Events of specific calendar
@param \Cake\Datasource\EntityInterface|null $calendar record
@param mixed[] $options with filter params
@param bool $isInfinite flag to find inifinite events like birthdays
@return mixed[] $result of events (minimal structure) | [
"Get",
"Events",
"of",
"specific",
"calendar"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L175-L244 |
223,673 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getEventRange | public function getEventRange(array $options = []): array
{
$result = [];
if (empty($options['period'])) {
return $result;
}
//@NOTE: sqlite doesn't support date_format or month functions
if (!empty($options['period']['start_date'])) {
$result['start... | php | public function getEventRange(array $options = []): array
{
$result = [];
if (empty($options['period'])) {
return $result;
}
//@NOTE: sqlite doesn't support date_format or month functions
if (!empty($options['period']['start_date'])) {
$result['start... | [
"public",
"function",
"getEventRange",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"options",
"[",
"'period'",
"]",
")",
")",
"{",
"return",
"$",
"result",
... | Get Event Range condition
@param mixed[] $options containiner period with start_date/end_date params
@return mixed[] $result containing start/end keys with month dates. | [
"Get",
"Event",
"Range",
"condition"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L252-L274 |
223,674 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getInfiniteEvents | public function getInfiniteEvents(array $events, array $options = [], bool $isInfinite = true): array
{
$result = $existingEventIds = [];
$query = $this->findCalendarEvents($options, $isInfinite);
if (!$query) {
return $result;
}
if (!empty($events)) {
... | php | public function getInfiniteEvents(array $events, array $options = [], bool $isInfinite = true): array
{
$result = $existingEventIds = [];
$query = $this->findCalendarEvents($options, $isInfinite);
if (!$query) {
return $result;
}
if (!empty($events)) {
... | [
"public",
"function",
"getInfiniteEvents",
"(",
"array",
"$",
"events",
",",
"array",
"$",
"options",
"=",
"[",
"]",
",",
"bool",
"$",
"isInfinite",
"=",
"true",
")",
":",
"array",
"{",
"$",
"result",
"=",
"$",
"existingEventIds",
"=",
"[",
"]",
";",
... | Get infinite calendar events for given calendar
@param mixed[] $events from findCalendarEvents
@param mixed[] $options containing month viewport (end/start interval).
@param bool $isInfinite flag for infinite events like birthdays
@return mixed[] $result containing event records | [
"Get",
"infinite",
"calendar",
"events",
"for",
"given",
"calendar"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L285-L314 |
223,675 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getRRuleConfiguration | public function getRRuleConfiguration(string $recurrence = null): ?string
{
$result = null;
if (empty($recurrence)) {
return $result;
}
$result = preg_match('/^RRULE:/', $recurrence) ? $recurrence : 'RRULE:' . $recurrence;
return $result;
} | php | public function getRRuleConfiguration(string $recurrence = null): ?string
{
$result = null;
if (empty($recurrence)) {
return $result;
}
$result = preg_match('/^RRULE:/', $recurrence) ? $recurrence : 'RRULE:' . $recurrence;
return $result;
} | [
"public",
"function",
"getRRuleConfiguration",
"(",
"string",
"$",
"recurrence",
"=",
"null",
")",
":",
"?",
"string",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"empty",
"(",
"$",
"recurrence",
")",
")",
"{",
"return",
"$",
"result",
";",
"}",
... | Get RRULE configuration from the event
@param string $recurrence received from the calendar
@return string|null $result containing the RRULE | [
"Get",
"RRULE",
"configuration",
"from",
"the",
"event"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L323-L334 |
223,676 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.setRRuleConfiguration | public function setRRuleConfiguration(string $recurrence = null): ?string
{
$result = null;
if (empty($recurrence)) {
return $result;
}
if (!preg_match('/RRULE:/', $recurrence)) {
$result = 'RRULE:' . $recurrence;
}
return $result;
} | php | public function setRRuleConfiguration(string $recurrence = null): ?string
{
$result = null;
if (empty($recurrence)) {
return $result;
}
if (!preg_match('/RRULE:/', $recurrence)) {
$result = 'RRULE:' . $recurrence;
}
return $result;
} | [
"public",
"function",
"setRRuleConfiguration",
"(",
"string",
"$",
"recurrence",
"=",
"null",
")",
":",
"?",
"string",
"{",
"$",
"result",
"=",
"null",
";",
"if",
"(",
"empty",
"(",
"$",
"recurrence",
")",
")",
"{",
"return",
"$",
"result",
";",
"}",
... | Set valid RRULE string
@param string $recurrence from the UI
@return string|null $result json encoded array with RRULE | [
"Set",
"valid",
"RRULE",
"string"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L342-L355 |
223,677 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getEventTypes | public function getEventTypes(array $options = []): array
{
$result = [];
if (!empty($options['calendar'])) {
$types = json_decode($options['calendar']->event_types, true);
foreach ($types as $type) {
$result[$type] = $type;
}
asort($... | php | public function getEventTypes(array $options = []): array
{
$result = [];
if (!empty($options['calendar'])) {
$types = json_decode($options['calendar']->event_types, true);
foreach ($types as $type) {
$result[$type] = $type;
}
asort($... | [
"public",
"function",
"getEventTypes",
"(",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"options",
"[",
"'calendar'",
"]",
")",
")",
"{",
"$",
"types",
"=",... | Get Event types for the calendar event
@param mixed[] $options of the data including user
@return mixed[] $result with event types. | [
"Get",
"Event",
"types",
"for",
"the",
"calendar",
"event"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L409-L438 |
223,678 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getEventTypeName | public function getEventTypeName(array $data = [], array $options = []): ?string
{
if (empty($data['name'])) {
return null;
}
$prefix = !empty($options['prefix']) ? $options['prefix'] : 'Config';
$type = !empty($data['type']) ? $data['type'] : 'default';
$delimit... | php | public function getEventTypeName(array $data = [], array $options = []): ?string
{
if (empty($data['name'])) {
return null;
}
$prefix = !empty($options['prefix']) ? $options['prefix'] : 'Config';
$type = !empty($data['type']) ? $data['type'] : 'default';
$delimit... | [
"public",
"function",
"getEventTypeName",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"?",
"string",
"{",
"if",
"(",
"empty",
"(",
"$",
"data",
"[",
"'name'",
"]",
")",
")",
"{",
"return",
"nul... | Get Event Type name
@param mixed[] $data with name parts
@param mixed[] $options for extra settings if needed
@return string|null $name containing event type definition. | [
"Get",
"Event",
"Type",
"name"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L448-L461 |
223,679 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getEventInfo | public function getEventInfo(?string $id = null, ?EntityInterface $calendar = null)
{
$result = [];
if (empty($id)) {
return $result;
}
$options = $this->getRecurrenceEventId($id);
/** @var \Cake\ORM\Query $query */
$query = $this->find()
... | php | public function getEventInfo(?string $id = null, ?EntityInterface $calendar = null)
{
$result = [];
if (empty($id)) {
return $result;
}
$options = $this->getRecurrenceEventId($id);
/** @var \Cake\ORM\Query $query */
$query = $this->find()
... | [
"public",
"function",
"getEventInfo",
"(",
"?",
"string",
"$",
"id",
"=",
"null",
",",
"?",
"EntityInterface",
"$",
"calendar",
"=",
"null",
")",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"id",
")",
")",
"{",
"return",
... | Get Event info
@param string $id of the record
@param \Cake\Datasource\EntityInterface $calendar instance
@return array|\Cake\Datasource\EntityInterface $result containing record data | [
"Get",
"Event",
"info"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L471-L515 |
223,680 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.prepareRecurringEventData | public function prepareRecurringEventData(array $event = [], array $interval = [], EntityInterface $calendar = null): ?EntityInterface
{
$entity = null;
if (empty($event)) {
return $entity;
}
$entity = $this->newEntity();
$entity = $this->patchEntity($entity, $e... | php | public function prepareRecurringEventData(array $event = [], array $interval = [], EntityInterface $calendar = null): ?EntityInterface
{
$entity = null;
if (empty($event)) {
return $entity;
}
$entity = $this->newEntity();
$entity = $this->patchEntity($entity, $e... | [
"public",
"function",
"prepareRecurringEventData",
"(",
"array",
"$",
"event",
"=",
"[",
"]",
",",
"array",
"$",
"interval",
"=",
"[",
"]",
",",
"EntityInterface",
"$",
"calendar",
"=",
"null",
")",
":",
"?",
"EntityInterface",
"{",
"$",
"entity",
"=",
"... | Prepare Recurring Event Data
Substitute original dates with recurring dates
@param mixed[] $event of the original instance
@param mixed[] $interval pair with start/end dates to be used
@param \Cake\Datasource\EntityInterface $calendar instance
@return \Cake\Datasource\EntityInterface|null $entity of the recurring ev... | [
"Prepare",
"Recurring",
"Event",
"Data"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L528-L549 |
223,681 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.setEventTitle | public function setEventTitle(array $data, EntityInterface $calendar): string
{
$title = (!empty($data['CalendarEvents']['title']) ? $data['CalendarEvents']['title'] : '');
if (empty($title)) {
$title .= !empty($calendar->name) ? $calendar->name : '';
if (!empty($data['Cale... | php | public function setEventTitle(array $data, EntityInterface $calendar): string
{
$title = (!empty($data['CalendarEvents']['title']) ? $data['CalendarEvents']['title'] : '');
if (empty($title)) {
$title .= !empty($calendar->name) ? $calendar->name : '';
if (!empty($data['Cale... | [
"public",
"function",
"setEventTitle",
"(",
"array",
"$",
"data",
",",
"EntityInterface",
"$",
"calendar",
")",
":",
"string",
"{",
"$",
"title",
"=",
"(",
"!",
"empty",
"(",
"$",
"data",
"[",
"'CalendarEvents'",
"]",
"[",
"'title'",
"]",
")",
"?",
"$"... | Set Event Title
@param mixed[] $data from the request
@param \Cake\Datasource\EntityInterface $calendar from db
@return string $title with the event content | [
"Set",
"Event",
"Title"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L648-L663 |
223,682 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getEventTitle | public function getEventTitle(array $event = []): string
{
$extra = [];
if (!empty($event['calendar_attendees'])) {
foreach ($event['calendar_attendees'] as $att) {
if ($att instanceof EntityInterface) {
array_push($extra, $att->get('display_name'));
... | php | public function getEventTitle(array $event = []): string
{
$extra = [];
if (!empty($event['calendar_attendees'])) {
foreach ($event['calendar_attendees'] as $att) {
if ($att instanceof EntityInterface) {
array_push($extra, $att->get('display_name'));
... | [
"public",
"function",
"getEventTitle",
"(",
"array",
"$",
"event",
"=",
"[",
"]",
")",
":",
"string",
"{",
"$",
"extra",
"=",
"[",
"]",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"event",
"[",
"'calendar_attendees'",
"]",
")",
")",
"{",
"foreach",
"("... | Get Event Title based on the Event information
@param mixed[] $event of the calendar event instance
@return string $event[title] with new title if extras present | [
"Get",
"Event",
"Title",
"based",
"on",
"the",
"Event",
"information"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L672-L689 |
223,683 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.sync | public function sync(EntityInterface $calendar, array $options = []): array
{
$result = [];
if (empty($calendar)) {
return $result;
}
$event = new Event((string)EventName::PLUGIN_CALENDAR_MODEL_GET_EVENTS(), $this, [
'calendar' => $calendar,
'opt... | php | public function sync(EntityInterface $calendar, array $options = []): array
{
$result = [];
if (empty($calendar)) {
return $result;
}
$event = new Event((string)EventName::PLUGIN_CALENDAR_MODEL_GET_EVENTS(), $this, [
'calendar' => $calendar,
'opt... | [
"public",
"function",
"sync",
"(",
"EntityInterface",
"$",
"calendar",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"calendar",
")",
")",
"{",
"return",
"$",
... | Synchronize calendar events
@param \Cake\Datasource\EntityInterface $calendar instance from the db
@param mixed[] $options with extra configs
@return mixed[] $result with events responses. | [
"Synchronize",
"calendar",
"events"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L699-L726 |
223,684 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.saveEvent | public function saveEvent(EntityInterface $entity): array
{
$response = [
'status' => false,
'errors' => [],
'entity' => null,
];
if ($entity instanceof EntityInterface) {
$entity = $entity->toArray();
}
if (empty($entity['id'... | php | public function saveEvent(EntityInterface $entity): array
{
$response = [
'status' => false,
'errors' => [],
'entity' => null,
];
if ($entity instanceof EntityInterface) {
$entity = $entity->toArray();
}
if (empty($entity['id'... | [
"public",
"function",
"saveEvent",
"(",
"EntityInterface",
"$",
"entity",
")",
":",
"array",
"{",
"$",
"response",
"=",
"[",
"'status'",
"=>",
"false",
",",
"'errors'",
"=>",
"[",
"]",
",",
"'entity'",
"=>",
"null",
",",
"]",
";",
"if",
"(",
"$",
"en... | Save Calendar Event wrapper
@param \Cake\Datasource\EntityInterface $entity of generic entity object
@return mixed[] $response containing saving state of entity. | [
"Save",
"Calendar",
"Event",
"wrapper"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L734-L773 |
223,685 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.getEventsFromEntities | public function getEventsFromEntities(Table $table, array $calendars, ArrayObject $options): array
{
$entities = [];
if (empty($calendars)) {
return $entities;
}
$map = ObjectFactory::getConfig($table->alias(), 'Event', $options['event_type']);
foreach ($calenda... | php | public function getEventsFromEntities(Table $table, array $calendars, ArrayObject $options): array
{
$entities = [];
if (empty($calendars)) {
return $entities;
}
$map = ObjectFactory::getConfig($table->alias(), 'Event', $options['event_type']);
foreach ($calenda... | [
"public",
"function",
"getEventsFromEntities",
"(",
"Table",
"$",
"table",
",",
"array",
"$",
"calendars",
",",
"ArrayObject",
"$",
"options",
")",
":",
"array",
"{",
"$",
"entities",
"=",
"[",
"]",
";",
"if",
"(",
"empty",
"(",
"$",
"calendars",
")",
... | Convert incoming ORM Entities to CalendarEvent entities
We create multiple entities for each calendar to avoid accidential
crossing of instances.
@param \Cake\ORM\Table $table instance of original entity table
@param mixed[] $calendars that it might be saved to
@param \ArrayObject $options originally received from ev... | [
"Convert",
"incoming",
"ORM",
"Entities",
"to",
"CalendarEvent",
"entities"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L787-L817 |
223,686 | QoboLtd/cakephp-calendar | src/Model/Table/CalendarEventsTable.php | CalendarEventsTable.setCalendarEventData | public function setCalendarEventData(array $data = [], ?EntityInterface $calendar = null): array
{
$result = [
'CalendarEvents' => [],
];
$result['CalendarEvents'] = $data;
if (!empty($data['recurrence'])) {
$recurrence = $this->setRRuleConfiguration($data['r... | php | public function setCalendarEventData(array $data = [], ?EntityInterface $calendar = null): array
{
$result = [
'CalendarEvents' => [],
];
$result['CalendarEvents'] = $data;
if (!empty($data['recurrence'])) {
$recurrence = $this->setRRuleConfiguration($data['r... | [
"public",
"function",
"setCalendarEventData",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
",",
"?",
"EntityInterface",
"$",
"calendar",
"=",
"null",
")",
":",
"array",
"{",
"$",
"result",
"=",
"[",
"'CalendarEvents'",
"=>",
"[",
"]",
",",
"]",
";",
"$",
... | Set Calendar Event Post data
@param mixed[] $data from the POST
@param \Cake\Datasource\EntityInterface $calendar record
@return mixed[] $result to be saved in ORM | [
"Set",
"Calendar",
"Event",
"Post",
"data"
] | e0ea2c4dd4257a6af972707f206151d01bb4dfbb | https://github.com/QoboLtd/cakephp-calendar/blob/e0ea2c4dd4257a6af972707f206151d01bb4dfbb/src/Model/Table/CalendarEventsTable.php#L874-L897 |
223,687 | ongr-io/FilterManagerBundle | Filter/Widget/Choice/SingleTermChoice.php | SingleTermChoice.addPriorityChoices | protected function addPriorityChoices(array $unsortedChoices, ChoicesAwareViewData $data)
{
foreach ($this->getSortPriority() as $name) {
if (array_key_exists($name, $unsortedChoices)) {
$data->addChoice($unsortedChoices[$name]);
unset($unsortedChoices[$name]);
... | php | protected function addPriorityChoices(array $unsortedChoices, ChoicesAwareViewData $data)
{
foreach ($this->getSortPriority() as $name) {
if (array_key_exists($name, $unsortedChoices)) {
$data->addChoice($unsortedChoices[$name]);
unset($unsortedChoices[$name]);
... | [
"protected",
"function",
"addPriorityChoices",
"(",
"array",
"$",
"unsortedChoices",
",",
"ChoicesAwareViewData",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getSortPriority",
"(",
")",
"as",
"$",
"name",
")",
"{",
"if",
"(",
"array_key_exists",... | Adds prioritized choices.
@param array $unsortedChoices
@param ChoicesAwareViewData $data
@return array | [
"Adds",
"prioritized",
"choices",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Filter/Widget/Choice/SingleTermChoice.php#L155-L165 |
223,688 | puli/manager | src/Api/Installer/Validation/InstallerParameterValidator.php | InstallerParameterValidator.validate | public function validate(array $parameterValues, InstallerDescriptor $descriptor)
{
$violations = array();
foreach ($parameterValues as $name => $value) {
if (!$descriptor->hasParameter($name)) {
$violations[] = new ConstraintViolation(
ConstraintViol... | php | public function validate(array $parameterValues, InstallerDescriptor $descriptor)
{
$violations = array();
foreach ($parameterValues as $name => $value) {
if (!$descriptor->hasParameter($name)) {
$violations[] = new ConstraintViolation(
ConstraintViol... | [
"public",
"function",
"validate",
"(",
"array",
"$",
"parameterValues",
",",
"InstallerDescriptor",
"$",
"descriptor",
")",
"{",
"$",
"violations",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"parameterValues",
"as",
"$",
"name",
"=>",
"$",
"value",
... | Returns whether the given parameter values are valid.
@param array $parameterValues The parameter values to
validate.
@param InstallerDescriptor $descriptor The installer descriptor to
validate the values for.
@return ConstraintViolation[] The found violations. If no violations were
found, an empty... | [
"Returns",
"whether",
"the",
"given",
"parameter",
"values",
"are",
"valid",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installer/Validation/InstallerParameterValidator.php#L36-L65 |
223,689 | puli/manager | src/Api/Discovery/BindingDescriptor.php | BindingDescriptor.load | public function load(Module $containingModule, BindingTypeDescriptor $typeDescriptor = null)
{
if (null !== $this->state) {
throw new AlreadyLoadedException('The binding descriptor is already loaded.');
}
$this->loadErrors = array();
if ($typeDescriptor && $typeDescript... | php | public function load(Module $containingModule, BindingTypeDescriptor $typeDescriptor = null)
{
if (null !== $this->state) {
throw new AlreadyLoadedException('The binding descriptor is already loaded.');
}
$this->loadErrors = array();
if ($typeDescriptor && $typeDescript... | [
"public",
"function",
"load",
"(",
"Module",
"$",
"containingModule",
",",
"BindingTypeDescriptor",
"$",
"typeDescriptor",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"AlreadyLoadedException",
"(",
"... | Loads the binding descriptor.
@param Module $containingModule The module that
contains the
descriptor.
@param BindingTypeDescriptor|null $typeDescriptor The type descriptor.
@throws AlreadyLoadedException If the descriptor is already loaded. | [
"Loads",
"the",
"binding",
"descriptor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Discovery/BindingDescriptor.php#L82-L102 |
223,690 | puli/manager | src/Api/Discovery/BindingDescriptor.php | BindingDescriptor.unload | public function unload()
{
if (null === $this->state) {
throw new NotLoadedException('The binding descriptor is not loaded.');
}
$this->containingModule = null;
$this->typeDescriptor = null;
$this->loadErrors = array();
$this->state = null;
} | php | public function unload()
{
if (null === $this->state) {
throw new NotLoadedException('The binding descriptor is not loaded.');
}
$this->containingModule = null;
$this->typeDescriptor = null;
$this->loadErrors = array();
$this->state = null;
} | [
"public",
"function",
"unload",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"state",
")",
"{",
"throw",
"new",
"NotLoadedException",
"(",
"'The binding descriptor is not loaded.'",
")",
";",
"}",
"$",
"this",
"->",
"containingModule",
"=",
"n... | Unloads the binding descriptor.
All memory allocated during {@link load()} is freed.
@throws NotLoadedException If the descriptor is not loaded. | [
"Unloads",
"the",
"binding",
"descriptor",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Discovery/BindingDescriptor.php#L111-L121 |
223,691 | puli/manager | src/Api/Php/Method.php | Method.getArgument | public function getArgument($name)
{
if (!isset($this->arguments[$name])) {
throw new OutOfBoundsException(sprintf(
'The argument "%s" does not exist.',
$name
));
}
return $this->arguments[$name];
} | php | public function getArgument($name)
{
if (!isset($this->arguments[$name])) {
throw new OutOfBoundsException(sprintf(
'The argument "%s" does not exist.',
$name
));
}
return $this->arguments[$name];
} | [
"public",
"function",
"getArgument",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"arguments",
"[",
"$",
"name",
"]",
")",
")",
"{",
"throw",
"new",
"OutOfBoundsException",
"(",
"sprintf",
"(",
"'The argument \"%s\" does not... | Returns the argument with the given name.
@param string $name The argument name.
@return Argument The argument.
@throws OutOfBoundsException If the argument does not exist. | [
"Returns",
"the",
"argument",
"with",
"the",
"given",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Method.php#L147-L157 |
223,692 | puli/manager | src/Api/Php/Method.php | Method.addBody | public function addBody($body)
{
Assert::stringNotEmpty($body, 'The method body must be a non-empty string. Got: %s');
if ($this->body) {
$this->body .= "\n".$body;
} else {
$this->body = $body;
}
return $this;
} | php | public function addBody($body)
{
Assert::stringNotEmpty($body, 'The method body must be a non-empty string. Got: %s');
if ($this->body) {
$this->body .= "\n".$body;
} else {
$this->body = $body;
}
return $this;
} | [
"public",
"function",
"addBody",
"(",
"$",
"body",
")",
"{",
"Assert",
"::",
"stringNotEmpty",
"(",
"$",
"body",
",",
"'The method body must be a non-empty string. Got: %s'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"body",
")",
"{",
"$",
"this",
"->",
"body"... | Adds source code to the method body.
A newline is inserted between the current code and the added code.
@param string $body The source code to add.
@return static The current instance. | [
"Adds",
"source",
"code",
"to",
"the",
"method",
"body",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Php/Method.php#L346-L357 |
223,693 | ongr-io/FilterManagerBundle | Search/FilterManager.php | FilterManager.search | public function search(SearchRequest $request)
{
$this->eventDispatcher->dispatch(ONGRFilterManagerEvents::PRE_SEARCH, new PreSearchEvent($request));
$search = $this->container->buildSearch($request);
/** @var FilterInterface $filter */
foreach ($this->container->all() as $name => ... | php | public function search(SearchRequest $request)
{
$this->eventDispatcher->dispatch(ONGRFilterManagerEvents::PRE_SEARCH, new PreSearchEvent($request));
$search = $this->container->buildSearch($request);
/** @var FilterInterface $filter */
foreach ($this->container->all() as $name => ... | [
"public",
"function",
"search",
"(",
"SearchRequest",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"eventDispatcher",
"->",
"dispatch",
"(",
"ONGRFilterManagerEvents",
"::",
"PRE_SEARCH",
",",
"new",
"PreSearchEvent",
"(",
"$",
"request",
")",
")",
";",
"$",
... | Executes search.
@param SearchRequest $request
@return SearchResponse | [
"Executes",
"search",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Search/FilterManager.php#L90-L129 |
223,694 | ongr-io/FilterManagerBundle | Search/FilterManager.php | FilterManager.composeUrlParameters | protected function composeUrlParameters(SearchRequest $request, FilterInterface $filter = null, $exclude = [])
{
$out = [];
$and = [];
if ($filter) {
$and[] = $filter->getResetRelation();
}
if (!empty($exclude)) {
$and[] = new ExcludeRelation($exclu... | php | protected function composeUrlParameters(SearchRequest $request, FilterInterface $filter = null, $exclude = [])
{
$out = [];
$and = [];
if ($filter) {
$and[] = $filter->getResetRelation();
}
if (!empty($exclude)) {
$and[] = new ExcludeRelation($exclu... | [
"protected",
"function",
"composeUrlParameters",
"(",
"SearchRequest",
"$",
"request",
",",
"FilterInterface",
"$",
"filter",
"=",
"null",
",",
"$",
"exclude",
"=",
"[",
"]",
")",
"{",
"$",
"out",
"=",
"[",
"]",
";",
"$",
"and",
"=",
"[",
"]",
";",
"... | Composes url parameters related to given filter.
@param SearchRequest $request Search request.
@param FilterInterface $filter Filter.
@param array $exclude Additional names of filters to exclude.
@return array | [
"Composes",
"url",
"parameters",
"related",
"to",
"given",
"filter",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Search/FilterManager.php#L140-L162 |
223,695 | ongr-io/FilterManagerBundle | Search/FilterManager.php | FilterManager.getFiltersViewData | protected function getFiltersViewData(DocumentIterator $result, SearchRequest $request)
{
$out = [];
/** @var FilterInterface[] $filters */
$filters = $this->container->all();
foreach ($filters as $name => $filter) {
if ($filter instanceof ViewDataFactoryInterface) {
... | php | protected function getFiltersViewData(DocumentIterator $result, SearchRequest $request)
{
$out = [];
/** @var FilterInterface[] $filters */
$filters = $this->container->all();
foreach ($filters as $name => $filter) {
if ($filter instanceof ViewDataFactoryInterface) {
... | [
"protected",
"function",
"getFiltersViewData",
"(",
"DocumentIterator",
"$",
"result",
",",
"SearchRequest",
"$",
"request",
")",
"{",
"$",
"out",
"=",
"[",
"]",
";",
"/** @var FilterInterface[] $filters */",
"$",
"filters",
"=",
"$",
"this",
"->",
"container",
... | Creates view data for each filter.
@param DocumentIterator $result
@param SearchRequest $request
@return ViewData[] | [
"Creates",
"view",
"data",
"for",
"each",
"filter",
"."
] | 26c1125457f0440019b9bf20090bf23ba4bb1905 | https://github.com/ongr-io/FilterManagerBundle/blob/26c1125457f0440019b9bf20090bf23ba4bb1905/Search/FilterManager.php#L172-L194 |
223,696 | puli/manager | src/Util/DistinguishedName.php | DistinguishedName.add | public function add($name, $value)
{
Assert::string($name, 'The attribute name must be a string. Got: %s');
Assert::notEmpty($name, 'The attribute name must not be empty.');
Assert::startsWithLetter($name, 'The attribute name %s must start with a letter.');
Assert::true((bool) preg_m... | php | public function add($name, $value)
{
Assert::string($name, 'The attribute name must be a string. Got: %s');
Assert::notEmpty($name, 'The attribute name must not be empty.');
Assert::startsWithLetter($name, 'The attribute name %s must start with a letter.');
Assert::true((bool) preg_m... | [
"public",
"function",
"add",
"(",
"$",
"name",
",",
"$",
"value",
")",
"{",
"Assert",
"::",
"string",
"(",
"$",
"name",
",",
"'The attribute name must be a string. Got: %s'",
")",
";",
"Assert",
"::",
"notEmpty",
"(",
"$",
"name",
",",
"'The attribute name mus... | Adds an attribute to the name.
@param string $name The attribute name. Must start with a letter and
contain letters, digits and hyphens only.
@param string $value The attribute value. Any non-empty string is
allowed.
@see merge() | [
"Adds",
"an",
"attribute",
"to",
"the",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/DistinguishedName.php#L54-L66 |
223,697 | puli/manager | src/Util/DistinguishedName.php | DistinguishedName.merge | public function merge(array $attributes)
{
foreach ($attributes as $name => $value) {
$this->add($name, $value);
}
} | php | public function merge(array $attributes)
{
foreach ($attributes as $name => $value) {
$this->add($name, $value);
}
} | [
"public",
"function",
"merge",
"(",
"array",
"$",
"attributes",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"this",
"->",
"add",
"(",
"$",
"name",
",",
"$",
"value",
")",
";",
"}",
"}"
] | Adds multiple attributes to the name.
@param array $attributes The attributes to add.
@see add() | [
"Adds",
"multiple",
"attributes",
"to",
"the",
"name",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/DistinguishedName.php#L75-L80 |
223,698 | puli/manager | src/Util/DistinguishedName.php | DistinguishedName.toString | public function toString()
{
$stringAttr = array();
foreach ($this->attributes as $name => $value) {
$stringAttr[] = $name.'='.$this->escape($value);
}
return implode(',', $stringAttr);
} | php | public function toString()
{
$stringAttr = array();
foreach ($this->attributes as $name => $value) {
$stringAttr[] = $name.'='.$this->escape($value);
}
return implode(',', $stringAttr);
} | [
"public",
"function",
"toString",
"(",
")",
"{",
"$",
"stringAttr",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"attributes",
"as",
"$",
"name",
"=>",
"$",
"value",
")",
"{",
"$",
"stringAttr",
"[",
"]",
"=",
"$",
"name",
".",
... | Returns the distinguished name as string.
Attribute values are always enquoted with '"'. Quotation marks and
backslashes are escaped with a prefix backslash in the values.
@return string The string form of the distinguished name. | [
"Returns",
"the",
"distinguished",
"name",
"as",
"string",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Util/DistinguishedName.php#L147-L156 |
223,699 | puli/manager | src/Api/Installation/NotInstallableException.php | NotInstallableException.missingParameter | public static function missingParameter($parameterName, $installerName, Exception $cause = null)
{
return new static(sprintf(
'The parameter "%s" is required for the installer "%s".',
$parameterName,
$installerName
), self::MISSING_PARAMETER, $cause);
} | php | public static function missingParameter($parameterName, $installerName, Exception $cause = null)
{
return new static(sprintf(
'The parameter "%s" is required for the installer "%s".',
$parameterName,
$installerName
), self::MISSING_PARAMETER, $cause);
} | [
"public",
"static",
"function",
"missingParameter",
"(",
"$",
"parameterName",
",",
"$",
"installerName",
",",
"Exception",
"$",
"cause",
"=",
"null",
")",
"{",
"return",
"new",
"static",
"(",
"sprintf",
"(",
"'The parameter \"%s\" is required for the installer \"%s\"... | Creates an exception for a missing required parameter.
@param string $parameterName The parameter name.
@param string $installerName The installer name.
@param Exception|null $cause The exception that caused this
exception.
@return static The created exception. | [
"Creates",
"an",
"exception",
"for",
"a",
"missing",
"required",
"parameter",
"."
] | b3e726e35c2e6da809fd13f73d590290fb3fca43 | https://github.com/puli/manager/blob/b3e726e35c2e6da809fd13f73d590290fb3fca43/src/Api/Installation/NotInstallableException.php#L75-L82 |
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.