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 | partition stringclasses 1 value |
|---|---|---|---|---|---|---|---|---|---|---|---|
nabu-3/core | nabu/data/site/CNabuSiteMap.php | CNabuSiteMap.addRole | public function addRole(CNabuSiteMapRole $nb_role)
{
if ($nb_role->isValueNumeric(NABU_ROLE_FIELD_ID) || $nb_role->isValueGUID(NABU_ROLE_FIELD_ID)) {
$nb_role->setSiteMap($this);
$this->nb_site_map_role_list->addItem($nb_role);
}
return $nb_role;
} | php | public function addRole(CNabuSiteMapRole $nb_role)
{
if ($nb_role->isValueNumeric(NABU_ROLE_FIELD_ID) || $nb_role->isValueGUID(NABU_ROLE_FIELD_ID)) {
$nb_role->setSiteMap($this);
$this->nb_site_map_role_list->addItem($nb_role);
}
return $nb_role;
} | [
"public",
"function",
"addRole",
"(",
"CNabuSiteMapRole",
"$",
"nb_role",
")",
"{",
"if",
"(",
"$",
"nb_role",
"->",
"isValueNumeric",
"(",
"NABU_ROLE_FIELD_ID",
")",
"||",
"$",
"nb_role",
"->",
"isValueGUID",
"(",
"NABU_ROLE_FIELD_ID",
")",
")",
"{",
"$",
"... | Add a Role to this Site Map node.
@param CNabuSiteMapRole $nb_role Role to be added.
@return CNabuSiteMapRole Returns the inserted Role instance. | [
"Add",
"a",
"Role",
"to",
"this",
"Site",
"Map",
"node",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/CNabuSiteMap.php#L204-L212 | train |
php-xapi/model | src/Definition.php | Definition.equals | public function equals(Definition $definition): bool
{
if (get_class($this) !== get_class($definition)) {
return false;
}
if (null !== $this->type xor null !== $definition->type) {
return false;
}
if (null !== $this->type && null !== $definition->type && !$this->type->equals($definition->type)) {
return false;
}
if (null !== $this->moreInfo xor null !== $definition->moreInfo) {
return false;
}
if (null !== $this->moreInfo && null !== $definition->moreInfo && !$this->moreInfo->equals($definition->moreInfo)) {
return false;
}
if (null !== $this->extensions xor null !== $definition->extensions) {
return false;
}
if (null !== $this->name xor null !== $definition->name) {
return false;
}
if (null !== $this->description xor null !== $definition->description) {
return false;
}
if (null !== $this->name) {
if (count($this->name) !== count($definition->name)) {
return false;
}
foreach ($this->name as $language => $value) {
if (!isset($definition->name[$language])) {
return false;
}
if ($value !== $definition->name[$language]) {
return false;
}
}
}
if (null !== $this->description) {
if (count($this->description) !== count($definition->description)) {
return false;
}
foreach ($this->description as $language => $value) {
if (!isset($definition->description[$language])) {
return false;
}
if ($value !== $definition->description[$language]) {
return false;
}
}
}
if (null !== $this->extensions && null !== $definition->extensions && !$this->extensions->equals($definition->extensions)) {
return false;
}
return true;
} | php | public function equals(Definition $definition): bool
{
if (get_class($this) !== get_class($definition)) {
return false;
}
if (null !== $this->type xor null !== $definition->type) {
return false;
}
if (null !== $this->type && null !== $definition->type && !$this->type->equals($definition->type)) {
return false;
}
if (null !== $this->moreInfo xor null !== $definition->moreInfo) {
return false;
}
if (null !== $this->moreInfo && null !== $definition->moreInfo && !$this->moreInfo->equals($definition->moreInfo)) {
return false;
}
if (null !== $this->extensions xor null !== $definition->extensions) {
return false;
}
if (null !== $this->name xor null !== $definition->name) {
return false;
}
if (null !== $this->description xor null !== $definition->description) {
return false;
}
if (null !== $this->name) {
if (count($this->name) !== count($definition->name)) {
return false;
}
foreach ($this->name as $language => $value) {
if (!isset($definition->name[$language])) {
return false;
}
if ($value !== $definition->name[$language]) {
return false;
}
}
}
if (null !== $this->description) {
if (count($this->description) !== count($definition->description)) {
return false;
}
foreach ($this->description as $language => $value) {
if (!isset($definition->description[$language])) {
return false;
}
if ($value !== $definition->description[$language]) {
return false;
}
}
}
if (null !== $this->extensions && null !== $definition->extensions && !$this->extensions->equals($definition->extensions)) {
return false;
}
return true;
} | [
"public",
"function",
"equals",
"(",
"Definition",
"$",
"definition",
")",
":",
"bool",
"{",
"if",
"(",
"get_class",
"(",
"$",
"this",
")",
"!==",
"get_class",
"(",
"$",
"definition",
")",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"null",
"!=... | Checks if another definition is equal.
Two definitions are equal if and only if all of their properties are equal. | [
"Checks",
"if",
"another",
"definition",
"is",
"equal",
"."
] | ca80d0f534ceb544b558dea1039c86a184cbeebe | https://github.com/php-xapi/model/blob/ca80d0f534ceb544b558dea1039c86a184cbeebe/src/Definition.php#L134-L205 | train |
mpaleo/scaffolder | src/Scaffolder/Compilers/Core/RouteCompiler.php | RouteCompiler.replaceResource | protected function replaceResource($modelName)
{
$this->stub = str_replace('{{resource_lw}}', strtolower($modelName), $this->stub);
$this->stub = str_replace('{{resource}}', $modelName, $this->stub);
return $this;
} | php | protected function replaceResource($modelName)
{
$this->stub = str_replace('{{resource_lw}}', strtolower($modelName), $this->stub);
$this->stub = str_replace('{{resource}}', $modelName, $this->stub);
return $this;
} | [
"protected",
"function",
"replaceResource",
"(",
"$",
"modelName",
")",
"{",
"$",
"this",
"->",
"stub",
"=",
"str_replace",
"(",
"'{{resource_lw}}'",
",",
"strtolower",
"(",
"$",
"modelName",
")",
",",
"$",
"this",
"->",
"stub",
")",
";",
"$",
"this",
"-... | Replace the resource.
@param $modelName
@return $this | [
"Replace",
"the",
"resource",
"."
] | c68062dc1d71784b93e5ef77a8abd283b716633f | https://github.com/mpaleo/scaffolder/blob/c68062dc1d71784b93e5ef77a8abd283b716633f/src/Scaffolder/Compilers/Core/RouteCompiler.php#L77-L83 | train |
pragma-framework/core | Pragma/View/View.php | View.getTemplateWebPath | public function getTemplateWebPath($file = '',$version = true) {
$webPath = '/assets/';
if(!empty($file) && $version) {
$webPath .= $file.'?'.$this->get_static_version();
}else{
$webPath .= $file;
}
return $webPath;
} | php | public function getTemplateWebPath($file = '',$version = true) {
$webPath = '/assets/';
if(!empty($file) && $version) {
$webPath .= $file.'?'.$this->get_static_version();
}else{
$webPath .= $file;
}
return $webPath;
} | [
"public",
"function",
"getTemplateWebPath",
"(",
"$",
"file",
"=",
"''",
",",
"$",
"version",
"=",
"true",
")",
"{",
"$",
"webPath",
"=",
"'/assets/'",
";",
"if",
"(",
"!",
"empty",
"(",
"$",
"file",
")",
"&&",
"$",
"version",
")",
"{",
"$",
"webPa... | give the path of resources, with the current static version | [
"give",
"the",
"path",
"of",
"resources",
"with",
"the",
"current",
"static",
"version"
] | 557f4b4857d36a8fd603483ec99782efdfd51c78 | https://github.com/pragma-framework/core/blob/557f4b4857d36a8fd603483ec99782efdfd51c78/Pragma/View/View.php#L71-L81 | train |
pragma-framework/core | Pragma/View/View.php | View.get | public function get($key){
return (isset($this->tpl['vars'][$key])) ? $this->tpl['vars'][$key] : null;
} | php | public function get($key){
return (isset($this->tpl['vars'][$key])) ? $this->tpl['vars'][$key] : null;
} | [
"public",
"function",
"get",
"(",
"$",
"key",
")",
"{",
"return",
"(",
"isset",
"(",
"$",
"this",
"->",
"tpl",
"[",
"'vars'",
"]",
"[",
"$",
"key",
"]",
")",
")",
"?",
"$",
"this",
"->",
"tpl",
"[",
"'vars'",
"]",
"[",
"$",
"key",
"]",
":",
... | get the value of a variable assigned to the view | [
"get",
"the",
"value",
"of",
"a",
"variable",
"assigned",
"to",
"the",
"view"
] | 557f4b4857d36a8fd603483ec99782efdfd51c78 | https://github.com/pragma-framework/core/blob/557f4b4857d36a8fd603483ec99782efdfd51c78/Pragma/View/View.php#L117-L119 | train |
pragma-framework/core | Pragma/View/View.php | View.yields | public function yields($yield = self::DEFAULT_YIELD){
if(!empty($this->content_for[$yield])) echo $this->content_for[$yield];
if(!empty($this->tpl['layout']['yields'][$yield]) && file_exists($this->getTemplatePath($this->tpl['layout']['yields'][$yield])))
include $this->getTemplatePath($this->tpl['layout']['yields'][$yield]);
} | php | public function yields($yield = self::DEFAULT_YIELD){
if(!empty($this->content_for[$yield])) echo $this->content_for[$yield];
if(!empty($this->tpl['layout']['yields'][$yield]) && file_exists($this->getTemplatePath($this->tpl['layout']['yields'][$yield])))
include $this->getTemplatePath($this->tpl['layout']['yields'][$yield]);
} | [
"public",
"function",
"yields",
"(",
"$",
"yield",
"=",
"self",
"::",
"DEFAULT_YIELD",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"content_for",
"[",
"$",
"yield",
"]",
")",
")",
"echo",
"$",
"this",
"->",
"content_for",
"[",
"$",
"... | include a tpl file exactly where the yields method is called | [
"include",
"a",
"tpl",
"file",
"exactly",
"where",
"the",
"yields",
"method",
"is",
"called"
] | 557f4b4857d36a8fd603483ec99782efdfd51c78 | https://github.com/pragma-framework/core/blob/557f4b4857d36a8fd603483ec99782efdfd51c78/Pragma/View/View.php#L132-L136 | train |
pragma-framework/core | Pragma/View/View.php | View.isYieldable | public function isYieldable($yield = self::DEFAULT_YIELD) {
return (!empty($this->tpl['layout']['yields'][$yield]) && file_exists($this->getTemplatePath($this->tpl['layout']['yields'][$yield])));
} | php | public function isYieldable($yield = self::DEFAULT_YIELD) {
return (!empty($this->tpl['layout']['yields'][$yield]) && file_exists($this->getTemplatePath($this->tpl['layout']['yields'][$yield])));
} | [
"public",
"function",
"isYieldable",
"(",
"$",
"yield",
"=",
"self",
"::",
"DEFAULT_YIELD",
")",
"{",
"return",
"(",
"!",
"empty",
"(",
"$",
"this",
"->",
"tpl",
"[",
"'layout'",
"]",
"[",
"'yields'",
"]",
"[",
"$",
"yield",
"]",
")",
"&&",
"file_exi... | Test existence of a yield section | [
"Test",
"existence",
"of",
"a",
"yield",
"section"
] | 557f4b4857d36a8fd603483ec99782efdfd51c78 | https://github.com/pragma-framework/core/blob/557f4b4857d36a8fd603483ec99782efdfd51c78/Pragma/View/View.php#L139-L141 | train |
pragma-framework/core | Pragma/View/View.php | View.compute | public function compute(){
if(file_exists($this->getTemplatePath($this->tpl['layout']['path']))){
include $this->getTemplatePath($this->tpl['layout']['path']);
}else
echo "Layout does not exists ".$this->tpl['layout']['path'];
} | php | public function compute(){
if(file_exists($this->getTemplatePath($this->tpl['layout']['path']))){
include $this->getTemplatePath($this->tpl['layout']['path']);
}else
echo "Layout does not exists ".$this->tpl['layout']['path'];
} | [
"public",
"function",
"compute",
"(",
")",
"{",
"if",
"(",
"file_exists",
"(",
"$",
"this",
"->",
"getTemplatePath",
"(",
"$",
"this",
"->",
"tpl",
"[",
"'layout'",
"]",
"[",
"'path'",
"]",
")",
")",
")",
"{",
"include",
"$",
"this",
"->",
"getTempla... | render the whole layout and display it | [
"render",
"the",
"whole",
"layout",
"and",
"display",
"it"
] | 557f4b4857d36a8fd603483ec99782efdfd51c78 | https://github.com/pragma-framework/core/blob/557f4b4857d36a8fd603483ec99782efdfd51c78/Pragma/View/View.php#L149-L154 | train |
nabu-3/core | nabu/data/cluster/base/CNabuClusterGroupServiceBase.php | CNabuClusterGroupServiceBase.getFilteredClusterGroupServiceList | public static function getFilteredClusterGroupServiceList($q = null, $fields = null, $order = null, $offset = 0, $num_items = 0)
{
$fields_part = nb_prefixFieldList(CNabuClusterGroupServiceBase::getStorageName(), $fields, false, true, '`');
$order_part = nb_prefixFieldList(CNabuClusterGroupServiceBase::getStorageName(), $fields, false, false, '`');
if ($num_items !== 0) {
$limit_part = ($offset > 0 ? $offset . ', ' : '') . $num_items;
} else {
$limit_part = false;
}
$nb_item_list = CNabuEngine::getEngine()->getMainDB()->getQueryAsArray(
"select " . ($fields_part ? $fields_part . ' ' : '* ')
. 'from nb_cluster_group_service '
. ($order_part ? "order by $order_part " : '')
. ($limit_part ? "limit $limit_part" : ''),
array(
)
);
return $nb_item_list;
} | php | public static function getFilteredClusterGroupServiceList($q = null, $fields = null, $order = null, $offset = 0, $num_items = 0)
{
$fields_part = nb_prefixFieldList(CNabuClusterGroupServiceBase::getStorageName(), $fields, false, true, '`');
$order_part = nb_prefixFieldList(CNabuClusterGroupServiceBase::getStorageName(), $fields, false, false, '`');
if ($num_items !== 0) {
$limit_part = ($offset > 0 ? $offset . ', ' : '') . $num_items;
} else {
$limit_part = false;
}
$nb_item_list = CNabuEngine::getEngine()->getMainDB()->getQueryAsArray(
"select " . ($fields_part ? $fields_part . ' ' : '* ')
. 'from nb_cluster_group_service '
. ($order_part ? "order by $order_part " : '')
. ($limit_part ? "limit $limit_part" : ''),
array(
)
);
return $nb_item_list;
} | [
"public",
"static",
"function",
"getFilteredClusterGroupServiceList",
"(",
"$",
"q",
"=",
"null",
",",
"$",
"fields",
"=",
"null",
",",
"$",
"order",
"=",
"null",
",",
"$",
"offset",
"=",
"0",
",",
"$",
"num_items",
"=",
"0",
")",
"{",
"$",
"fields_par... | Gets a filtered list of Cluster Group Service instances represented as an array. Params allows the capability of
select a subset of fields, order by concrete fields, or truncate the list by a number of rows starting in an
offset.
@throws \nabu\core\exceptions\ENabuCoreException Raises an exception if $fields or $order have invalid values.
@param string $q Query string to filter results using a context index.
@param string|array $fields List of fields to put in the results.
@param string|array $order List of fields to order the results. Each field can be suffixed with "ASC" or "DESC"
to determine the short order
@param int $offset Offset of first row in the results having the first row at offset 0.
@param int $num_items Number of continue rows to get as maximum in the results.
@return array Returns an array with all rows found using the criteria. | [
"Gets",
"a",
"filtered",
"list",
"of",
"Cluster",
"Group",
"Service",
"instances",
"represented",
"as",
"an",
"array",
".",
"Params",
"allows",
"the",
"capability",
"of",
"select",
"a",
"subset",
"of",
"fields",
"order",
"by",
"concrete",
"fields",
"or",
"tr... | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/cluster/base/CNabuClusterGroupServiceBase.php#L115-L136 | train |
nabu-3/core | nabu/data/cluster/base/CNabuClusterGroupServiceBase.php | CNabuClusterGroupServiceBase.setUseSSL | public function setUseSSL(string $use_ssl = "F") : CNabuDataObject
{
if ($use_ssl === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_ssl")
);
}
$this->setValue('nb_cluster_group_service_use_ssl', $use_ssl);
return $this;
} | php | public function setUseSSL(string $use_ssl = "F") : CNabuDataObject
{
if ($use_ssl === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_ssl")
);
}
$this->setValue('nb_cluster_group_service_use_ssl', $use_ssl);
return $this;
} | [
"public",
"function",
"setUseSSL",
"(",
"string",
"$",
"use_ssl",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"use_ssl",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ERROR_NULL_VALUE_NOT_ALL... | Sets the Cluster Group Service Use SSL attribute value.
@param string $use_ssl New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Cluster",
"Group",
"Service",
"Use",
"SSL",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/cluster/base/CNabuClusterGroupServiceBase.php#L248-L259 | train |
nabu-3/core | nabu/messaging/adapters/CNabuMessagingModuleManagerAdapter.php | CNabuMessagingModuleManagerAdapter.registerServiceInterface | protected function registerServiceInterface(INabuMessagingServiceInterface $interface) : bool
{
$hash = $interface->getHash();
if (is_array($this->service_interface_list) && array_key_exists($hash, $this->service_interface_list)) {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_SERVICE_INSTANCE_ALREADY_REGISTERED,
array($hash)
);
}
if ($this->service_interface_list === null) {
$this->service_interface_list = array($hash => $interface);
} else {
$this->service_interface_list[$hash] = $interface;
}
return $interface->init();
} | php | protected function registerServiceInterface(INabuMessagingServiceInterface $interface) : bool
{
$hash = $interface->getHash();
if (is_array($this->service_interface_list) && array_key_exists($hash, $this->service_interface_list)) {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_SERVICE_INSTANCE_ALREADY_REGISTERED,
array($hash)
);
}
if ($this->service_interface_list === null) {
$this->service_interface_list = array($hash => $interface);
} else {
$this->service_interface_list[$hash] = $interface;
}
return $interface->init();
} | [
"protected",
"function",
"registerServiceInterface",
"(",
"INabuMessagingServiceInterface",
"$",
"interface",
")",
":",
"bool",
"{",
"$",
"hash",
"=",
"$",
"interface",
"->",
"getHash",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
"service_int... | Register a new Messaging Interface instance.
@param INabuMessagingServiceInterface $interface Interface instance to be registered.
@return bool Returns true if the instance is registered and initiated.
@throws ENabuMessagingException Raises an exception if $interface is already registered. | [
"Register",
"a",
"new",
"Messaging",
"Interface",
"instance",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/messaging/adapters/CNabuMessagingModuleManagerAdapter.php#L59-L76 | train |
nabu-3/core | nabu/messaging/adapters/CNabuMessagingModuleManagerAdapter.php | CNabuMessagingModuleManagerAdapter.createServiceInterface | public function createServiceInterface(string $class_name) : INabuMessagingServiceInterface
{
$nb_engine = CNabuEngine::getEngine();
$nb_descriptor = $nb_engine->getProviderInterfaceDescriptor(
$this->getVendorKey(), $this->getModuleKey(),
CNabuProviderFactory::INTERFACE_MESSAGING_SERVICE, $class_name
);
if ($nb_descriptor instanceof CNabuProviderInterfaceDescriptor) {
$fullname = $nb_descriptor->getNamespace() . "\\services\\$class_name";
if ($nb_engine->preloadClass($fullname)) {
$interface = new $fullname($this);
if ($this->registerServiceInterface($interface)) {
return $interface;
} else {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_SERVICE_CANNOT_BE_INSTANTIATED,
array($class_name)
);
}
} else {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_INVALID_SERVICE_CLASS_NAME, array($class_name)
);
}
} else {
throw new ENabuProviderException(
ENabuProviderException::ERROR_INTERFACE_DESCRIPTOR_NOT_FOUND, array($class_name)
);
}
} | php | public function createServiceInterface(string $class_name) : INabuMessagingServiceInterface
{
$nb_engine = CNabuEngine::getEngine();
$nb_descriptor = $nb_engine->getProviderInterfaceDescriptor(
$this->getVendorKey(), $this->getModuleKey(),
CNabuProviderFactory::INTERFACE_MESSAGING_SERVICE, $class_name
);
if ($nb_descriptor instanceof CNabuProviderInterfaceDescriptor) {
$fullname = $nb_descriptor->getNamespace() . "\\services\\$class_name";
if ($nb_engine->preloadClass($fullname)) {
$interface = new $fullname($this);
if ($this->registerServiceInterface($interface)) {
return $interface;
} else {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_SERVICE_CANNOT_BE_INSTANTIATED,
array($class_name)
);
}
} else {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_INVALID_SERVICE_CLASS_NAME, array($class_name)
);
}
} else {
throw new ENabuProviderException(
ENabuProviderException::ERROR_INTERFACE_DESCRIPTOR_NOT_FOUND, array($class_name)
);
}
} | [
"public",
"function",
"createServiceInterface",
"(",
"string",
"$",
"class_name",
")",
":",
"INabuMessagingServiceInterface",
"{",
"$",
"nb_engine",
"=",
"CNabuEngine",
"::",
"getEngine",
"(",
")",
";",
"$",
"nb_descriptor",
"=",
"$",
"nb_engine",
"->",
"getProvid... | Create a Service Interface to manage a Messaging service.
This method is intended to speed up the creation of Service Interfaces in descendant Messaging modules.
@param string $class_name Class name to be instantiated.
@return INabuMessagingServiceInterface Returns a valid instance if $name is a valid name.
@throws ENabuMessagingException Raises an exception if the interface name is invalid. | [
"Create",
"a",
"Service",
"Interface",
"to",
"manage",
"a",
"Messaging",
"service",
".",
"This",
"method",
"is",
"intended",
"to",
"speed",
"up",
"the",
"creation",
"of",
"Service",
"Interfaces",
"in",
"descendant",
"Messaging",
"modules",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/messaging/adapters/CNabuMessagingModuleManagerAdapter.php#L85-L115 | train |
nabu-3/core | nabu/messaging/adapters/CNabuMessagingModuleManagerAdapter.php | CNabuMessagingModuleManagerAdapter.registerTemplateRenderInterface | protected function registerTemplateRenderInterface(INabuMessagingTemplateRenderInterface $interface) : bool
{
$hash = $interface->getHash();
if (is_array($this->template_render_interface_list) &&
array_key_exists($hash, $this->template_render_interface_list)
) {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_TEMPLATE_RENDER_INSTANCE_ALREADY_REGISTERED,
array($hash)
);
}
if ($this->template_render_interface_list === null) {
$this->template_render_interface_list = array($hash => $interface);
} else {
$this->template_render_interface_list[$hash] = $interface;
}
return $interface->init();
} | php | protected function registerTemplateRenderInterface(INabuMessagingTemplateRenderInterface $interface) : bool
{
$hash = $interface->getHash();
if (is_array($this->template_render_interface_list) &&
array_key_exists($hash, $this->template_render_interface_list)
) {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_TEMPLATE_RENDER_INSTANCE_ALREADY_REGISTERED,
array($hash)
);
}
if ($this->template_render_interface_list === null) {
$this->template_render_interface_list = array($hash => $interface);
} else {
$this->template_render_interface_list[$hash] = $interface;
}
return $interface->init();
} | [
"protected",
"function",
"registerTemplateRenderInterface",
"(",
"INabuMessagingTemplateRenderInterface",
"$",
"interface",
")",
":",
"bool",
"{",
"$",
"hash",
"=",
"$",
"interface",
"->",
"getHash",
"(",
")",
";",
"if",
"(",
"is_array",
"(",
"$",
"this",
"->",
... | Register a new Messaging Template Render Interface instance.
@param INabuMessagingTemplateRenderInterface $interface Interface instance to be registered.
@return bool Returns true if the instance is registered and initiated.
@throws ENabuMessagingException Raises an exception if $interface is already registered. | [
"Register",
"a",
"new",
"Messaging",
"Template",
"Render",
"Interface",
"instance",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/messaging/adapters/CNabuMessagingModuleManagerAdapter.php#L133-L152 | train |
nabu-3/core | nabu/messaging/adapters/CNabuMessagingModuleManagerAdapter.php | CNabuMessagingModuleManagerAdapter.createTemplateRenderInterface | public function createTemplateRenderInterface(string $class_name) : INabuMessagingTemplateRenderInterface
{
$nb_engine = CNabuEngine::getEngine();
$nb_descriptor = $nb_engine->getProviderInterfaceDescriptor(
$this->getVendorKey(), $this->getModuleKey(),
CNabuProviderFactory::INTERFACE_MESSAGING_TEMPLATE_RENDER, $class_name
);
if ($nb_descriptor instanceof CNabuProviderInterfaceDescriptor) {
$fullname = $nb_descriptor->getNamespace() . "\\templates\\renders\\$class_name";
if ($nb_engine->preloadClass($fullname)) {
$interface = new $fullname($this);
if ($this->registerTemplateRenderInterface($interface)) {
return $interface;
} else {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_TEMPLATE_RENDER_CANNOT_BE_INSTANTIATED,
array($class_name)
);
}
} else {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_INVALID_TEMPLATE_RENDER_CLASS_NAME,
array($class_name)
);
}
} else {
throw new ENabuProviderException(
ENabuProviderException::ERROR_INTERFACE_DESCRIPTOR_NOT_FOUND,
array($class_name)
);
}
} | php | public function createTemplateRenderInterface(string $class_name) : INabuMessagingTemplateRenderInterface
{
$nb_engine = CNabuEngine::getEngine();
$nb_descriptor = $nb_engine->getProviderInterfaceDescriptor(
$this->getVendorKey(), $this->getModuleKey(),
CNabuProviderFactory::INTERFACE_MESSAGING_TEMPLATE_RENDER, $class_name
);
if ($nb_descriptor instanceof CNabuProviderInterfaceDescriptor) {
$fullname = $nb_descriptor->getNamespace() . "\\templates\\renders\\$class_name";
if ($nb_engine->preloadClass($fullname)) {
$interface = new $fullname($this);
if ($this->registerTemplateRenderInterface($interface)) {
return $interface;
} else {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_TEMPLATE_RENDER_CANNOT_BE_INSTANTIATED,
array($class_name)
);
}
} else {
throw new ENabuMessagingException(
ENabuMessagingException::ERROR_INVALID_TEMPLATE_RENDER_CLASS_NAME,
array($class_name)
);
}
} else {
throw new ENabuProviderException(
ENabuProviderException::ERROR_INTERFACE_DESCRIPTOR_NOT_FOUND,
array($class_name)
);
}
} | [
"public",
"function",
"createTemplateRenderInterface",
"(",
"string",
"$",
"class_name",
")",
":",
"INabuMessagingTemplateRenderInterface",
"{",
"$",
"nb_engine",
"=",
"CNabuEngine",
"::",
"getEngine",
"(",
")",
";",
"$",
"nb_descriptor",
"=",
"$",
"nb_engine",
"->"... | Create a Template Render Interface to manage a Messaging Template Render.
This method is intended to speed up the creation of Template Render Interfaces in descendant Messaging Modules.
@param string $class_name Class name to be instantiated.
@return INabuMessagingTemplateRenderInterface Returns a valid instance if $name is a valid name.
@throws ENabuMessagingException Raises an exception if the interface name is invalid. | [
"Create",
"a",
"Template",
"Render",
"Interface",
"to",
"manage",
"a",
"Messaging",
"Template",
"Render",
".",
"This",
"method",
"is",
"intended",
"to",
"speed",
"up",
"the",
"creation",
"of",
"Template",
"Render",
"Interfaces",
"in",
"descendant",
"Messaging",
... | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/messaging/adapters/CNabuMessagingModuleManagerAdapter.php#L161-L193 | train |
nabu-3/core | nabu/http/managers/CNabuHTTPServerPoolManager.php | CNabuHTTPServerPoolManager.getHTTPServerFactory | public function getHTTPServerFactory(CNabuHTTPServerInterfaceDescriptor $nb_descriptor)
{
if (!($retval = $this->nb_http_server_factory_list->getItem($nb_descriptor->getKey()))) {
$retval = $this->nb_http_server_factory_list->addItem(new CNabuHTTPServerFactory($nb_descriptor));
}
return $retval;
} | php | public function getHTTPServerFactory(CNabuHTTPServerInterfaceDescriptor $nb_descriptor)
{
if (!($retval = $this->nb_http_server_factory_list->getItem($nb_descriptor->getKey()))) {
$retval = $this->nb_http_server_factory_list->addItem(new CNabuHTTPServerFactory($nb_descriptor));
}
return $retval;
} | [
"public",
"function",
"getHTTPServerFactory",
"(",
"CNabuHTTPServerInterfaceDescriptor",
"$",
"nb_descriptor",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"retval",
"=",
"$",
"this",
"->",
"nb_http_server_factory_list",
"->",
"getItem",
"(",
"$",
"nb_descriptor",
"->",
"g... | Gets a HTTP Server Factory instance for a Descriptor. If Factory instance already exists then returns it.
@param CNabuHTTPServerInterfaceDescriptor $nb_descriptor HTTP Server Descriptor instance to locate the required Factory.
@return CNabuHTTPServerFactory|false Returns the Factory if exists, or false if not. | [
"Gets",
"a",
"HTTP",
"Server",
"Factory",
"instance",
"for",
"a",
"Descriptor",
".",
"If",
"Factory",
"instance",
"already",
"exists",
"then",
"returns",
"it",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/http/managers/CNabuHTTPServerPoolManager.php#L69-L76 | train |
rips/php-connector-bundle | Hydrators/Application/Profile/SanitizerHydrator.php | SanitizerHydrator.hydrateCollection | public static function hydrateCollection(array $sanitizers)
{
$hydrated = [];
foreach ($sanitizers as $sanitizer) {
$hydrated[] = self::hydrate($sanitizer);
}
return $hydrated;
} | php | public static function hydrateCollection(array $sanitizers)
{
$hydrated = [];
foreach ($sanitizers as $sanitizer) {
$hydrated[] = self::hydrate($sanitizer);
}
return $hydrated;
} | [
"public",
"static",
"function",
"hydrateCollection",
"(",
"array",
"$",
"sanitizers",
")",
"{",
"$",
"hydrated",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"sanitizers",
"as",
"$",
"sanitizer",
")",
"{",
"$",
"hydrated",
"[",
"]",
"=",
"self",
"::",
"hyd... | Hydrate a collection of sanitizer objects into a collection of
SanitizerEntity objects
@param stdClass[] $sanitizers
@return SanitizerEntity[] | [
"Hydrate",
"a",
"collection",
"of",
"sanitizer",
"objects",
"into",
"a",
"collection",
"of",
"SanitizerEntity",
"objects"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Profile/SanitizerHydrator.php#L18-L27 | train |
rips/php-connector-bundle | Hydrators/Application/Profile/SanitizerHydrator.php | SanitizerHydrator.hydrate | public static function hydrate(stdClass $sanitizer)
{
$hydrated = new SanitizerEntity();
if (isset($sanitizer->id)) {
$hydrated->setId($sanitizer->id);
}
if (isset($sanitizer->class)) {
$hydrated->setClass($sanitizer->class);
}
if (isset($sanitizer->method)) {
$hydrated->setMethod($sanitizer->method);
}
if (isset($sanitizer->parameter)) {
$hydrated->setParameter($sanitizer->parameter);
}
if (isset($sanitizer->characters)) {
$hydrated->setCharacters($sanitizer->characters);
}
if (isset($sanitizer->issueType)) {
$hydrated->setIssueType(TypeHydrator::hydrate($sanitizer->issueType));
}
return $hydrated;
} | php | public static function hydrate(stdClass $sanitizer)
{
$hydrated = new SanitizerEntity();
if (isset($sanitizer->id)) {
$hydrated->setId($sanitizer->id);
}
if (isset($sanitizer->class)) {
$hydrated->setClass($sanitizer->class);
}
if (isset($sanitizer->method)) {
$hydrated->setMethod($sanitizer->method);
}
if (isset($sanitizer->parameter)) {
$hydrated->setParameter($sanitizer->parameter);
}
if (isset($sanitizer->characters)) {
$hydrated->setCharacters($sanitizer->characters);
}
if (isset($sanitizer->issueType)) {
$hydrated->setIssueType(TypeHydrator::hydrate($sanitizer->issueType));
}
return $hydrated;
} | [
"public",
"static",
"function",
"hydrate",
"(",
"stdClass",
"$",
"sanitizer",
")",
"{",
"$",
"hydrated",
"=",
"new",
"SanitizerEntity",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"sanitizer",
"->",
"id",
")",
")",
"{",
"$",
"hydrated",
"->",
"setId",... | Hydrate a sanitizer object into a SanitizerEntity object
@param stdClass $sanitizer
@return SanitizerEntity | [
"Hydrate",
"a",
"sanitizer",
"object",
"into",
"a",
"SanitizerEntity",
"object"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Profile/SanitizerHydrator.php#L35-L64 | train |
rips/php-connector-bundle | Services/Application/Profile/SinkService.php | SinkService.getAll | public function getAll($appId, $profileId, array $queryParams)
{
$response = $this->api->applications()->profiles()->sinks()->getAll($appId, $profileId, $queryParams);
return new SinksResponse($response);
} | php | public function getAll($appId, $profileId, array $queryParams)
{
$response = $this->api->applications()->profiles()->sinks()->getAll($appId, $profileId, $queryParams);
return new SinksResponse($response);
} | [
"public",
"function",
"getAll",
"(",
"$",
"appId",
",",
"$",
"profileId",
",",
"array",
"$",
"queryParams",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"applications",
"(",
")",
"->",
"profiles",
"(",
")",
"->",
"sinks",
"(",
")",... | Get all sinks for a profile profile
@param int $appId
@param int $profileId
@param array $queryParams
@return SinksResponse | [
"Get",
"all",
"sinks",
"for",
"a",
"profile",
"profile"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Profile/SinkService.php#L36-L41 | train |
rips/php-connector-bundle | Services/Application/Profile/SinkService.php | SinkService.getById | public function getById($appId, $profileId, $sinkId, array $queryParams = [])
{
$response = $this->api->applications()->profiles()->sinks()->getById($appId, $profileId, $sinkId, $queryParams);
return new SinkResponse($response);
} | php | public function getById($appId, $profileId, $sinkId, array $queryParams = [])
{
$response = $this->api->applications()->profiles()->sinks()->getById($appId, $profileId, $sinkId, $queryParams);
return new SinkResponse($response);
} | [
"public",
"function",
"getById",
"(",
"$",
"appId",
",",
"$",
"profileId",
",",
"$",
"sinkId",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"applications",
"(",
")",
"->",
"profiles"... | Get sink for profile profile by id
@param int $appId
@param int $profileId
@param int $sinkId
@param array $queryParams
@return SinkResponse | [
"Get",
"sink",
"for",
"profile",
"profile",
"by",
"id"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Profile/SinkService.php#L52-L57 | train |
rips/php-connector-bundle | Services/Application/Profile/SinkService.php | SinkService.create | public function create($appId, $profileId, SinkBuilder $input, array $queryParams = [])
{
$response = $this->api->applications()->profiles()->sinks()->create($appId, $profileId, $input->toArray(), $queryParams);
return new SinkResponse($response);
} | php | public function create($appId, $profileId, SinkBuilder $input, array $queryParams = [])
{
$response = $this->api->applications()->profiles()->sinks()->create($appId, $profileId, $input->toArray(), $queryParams);
return new SinkResponse($response);
} | [
"public",
"function",
"create",
"(",
"$",
"appId",
",",
"$",
"profileId",
",",
"SinkBuilder",
"$",
"input",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"applications",
"(",
")",
"->... | Create sink for profile profile
@param int $appId
@param int $profileId
@param SinkBuilder $input
@param array $queryParams
@return SinkResponse | [
"Create",
"sink",
"for",
"profile",
"profile"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Profile/SinkService.php#L68-L73 | train |
nabu-3/core | nabu/data/commerce/base/CNabuCommerceBase.php | CNabuCommerceBase.getAllCommerces | public static function getAllCommerces(CNabuCustomer $nb_customer)
{
$nb_customer_id = nb_getMixedValue($nb_customer, 'nb_customer_id');
if (is_numeric($nb_customer_id)) {
$retval = forward_static_call(
array(get_called_class(), 'buildObjectListFromSQL'),
'nb_commerce_id',
'select * '
. 'from nb_commerce '
. 'where nb_customer_id=%cust_id$d',
array(
'cust_id' => $nb_customer_id
),
$nb_customer
);
} else {
$retval = new CNabuCommerceList();
}
return $retval;
} | php | public static function getAllCommerces(CNabuCustomer $nb_customer)
{
$nb_customer_id = nb_getMixedValue($nb_customer, 'nb_customer_id');
if (is_numeric($nb_customer_id)) {
$retval = forward_static_call(
array(get_called_class(), 'buildObjectListFromSQL'),
'nb_commerce_id',
'select * '
. 'from nb_commerce '
. 'where nb_customer_id=%cust_id$d',
array(
'cust_id' => $nb_customer_id
),
$nb_customer
);
} else {
$retval = new CNabuCommerceList();
}
return $retval;
} | [
"public",
"static",
"function",
"getAllCommerces",
"(",
"CNabuCustomer",
"$",
"nb_customer",
")",
"{",
"$",
"nb_customer_id",
"=",
"nb_getMixedValue",
"(",
"$",
"nb_customer",
",",
"'nb_customer_id'",
")",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"nb_customer_id",
... | Get all items in the storage as an associative array where the field 'nb_commerce_id' is the index, and each
value is an instance of class CNabuCommerceBase.
@param CNabuCustomer $nb_customer The CNabuCustomer instance of the Customer that owns the Commerce List.
@return mixed Returns and array with all items. | [
"Get",
"all",
"items",
"in",
"the",
"storage",
"as",
"an",
"associative",
"array",
"where",
"the",
"field",
"nb_commerce_id",
"is",
"the",
"index",
"and",
"each",
"value",
"is",
"an",
"instance",
"of",
"class",
"CNabuCommerceBase",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/commerce/base/CNabuCommerceBase.php#L160-L180 | train |
nabu-3/core | nabu/xml/site/base/CNabuXMLSiteTargetBase.php | CNabuXMLSiteTargetBase.setAttributes | protected function setAttributes(SimpleXMLElement $element)
{
$element->addAttribute('GUID', $this->nb_data_object->grantHash(true));
$this->putAttributesFromList($element, array(
'nb_site_target_key' => 'key',
'nb_site_target_order' => 'order',
'nb_site_target_begin_date' => 'beginDate',
'nb_site_target_plugin_name' => 'plugin',
'nb_site_target_php_trace' => 'trace',
'nb_site_target_use_commerce' => 'useCommerce'
), false);
} | php | protected function setAttributes(SimpleXMLElement $element)
{
$element->addAttribute('GUID', $this->nb_data_object->grantHash(true));
$this->putAttributesFromList($element, array(
'nb_site_target_key' => 'key',
'nb_site_target_order' => 'order',
'nb_site_target_begin_date' => 'beginDate',
'nb_site_target_plugin_name' => 'plugin',
'nb_site_target_php_trace' => 'trace',
'nb_site_target_use_commerce' => 'useCommerce'
), false);
} | [
"protected",
"function",
"setAttributes",
"(",
"SimpleXMLElement",
"$",
"element",
")",
"{",
"$",
"element",
"->",
"addAttribute",
"(",
"'GUID'",
",",
"$",
"this",
"->",
"nb_data_object",
"->",
"grantHash",
"(",
"true",
")",
")",
";",
"$",
"this",
"->",
"p... | Set default attributes of Site Target in XML Element.
@param SimpleXMLElement $element XML Element to set attributes | [
"Set",
"default",
"attributes",
"of",
"Site",
"Target",
"in",
"XML",
"Element",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/xml/site/base/CNabuXMLSiteTargetBase.php#L119-L130 | train |
nabu-3/core | nabu/xml/site/base/CNabuXMLSiteTargetBase.php | CNabuXMLSiteTargetBase.getChilds | protected function getChilds(SimpleXMLElement $element)
{
parent::getChilds($element);
$this->getChildsAsCDATAFromList($element, array(
'nb_site_target_attributes' => 'attributes'
), false);
} | php | protected function getChilds(SimpleXMLElement $element)
{
parent::getChilds($element);
$this->getChildsAsCDATAFromList($element, array(
'nb_site_target_attributes' => 'attributes'
), false);
} | [
"protected",
"function",
"getChilds",
"(",
"SimpleXMLElement",
"$",
"element",
")",
"{",
"parent",
"::",
"getChilds",
"(",
"$",
"element",
")",
";",
"$",
"this",
"->",
"getChildsAsCDATAFromList",
"(",
"$",
"element",
",",
"array",
"(",
"'nb_site_target_attribute... | Get default childs of Site Target from XML Element as Element > CDATA structure.
@param SimpleXMLElement $element XML Element to get childs | [
"Get",
"default",
"childs",
"of",
"Site",
"Target",
"from",
"XML",
"Element",
"as",
"Element",
">",
"CDATA",
"structure",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/xml/site/base/CNabuXMLSiteTargetBase.php#L136-L143 | train |
nabu-3/core | nabu/xml/site/base/CNabuXMLSiteTargetBase.php | CNabuXMLSiteTargetBase.setChilds | protected function setChilds(SimpleXMLElement $element)
{
parent::setChilds($element);
$this->putChildsAsCDATAFromList($element, array(
'nb_site_target_attributes' => 'attributes'
), false);
} | php | protected function setChilds(SimpleXMLElement $element)
{
parent::setChilds($element);
$this->putChildsAsCDATAFromList($element, array(
'nb_site_target_attributes' => 'attributes'
), false);
} | [
"protected",
"function",
"setChilds",
"(",
"SimpleXMLElement",
"$",
"element",
")",
"{",
"parent",
"::",
"setChilds",
"(",
"$",
"element",
")",
";",
"$",
"this",
"->",
"putChildsAsCDATAFromList",
"(",
"$",
"element",
",",
"array",
"(",
"'nb_site_target_attribute... | Set default childs of Site Target XML Element as Element > CDATA structure.
@param SimpleXMLElement $element XML Element to set childs | [
"Set",
"default",
"childs",
"of",
"Site",
"Target",
"XML",
"Element",
"as",
"Element",
">",
"CDATA",
"structure",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/xml/site/base/CNabuXMLSiteTargetBase.php#L149-L156 | train |
rips/php-connector-bundle | Hydrators/Application/Scan/IssueHydrator.php | IssueHydrator.hydrateCollection | public static function hydrateCollection(array $issues)
{
$hydrated = [];
foreach ($issues as $issue) {
$hydrated[] = self::hydrate($issue);
}
return $hydrated;
} | php | public static function hydrateCollection(array $issues)
{
$hydrated = [];
foreach ($issues as $issue) {
$hydrated[] = self::hydrate($issue);
}
return $hydrated;
} | [
"public",
"static",
"function",
"hydrateCollection",
"(",
"array",
"$",
"issues",
")",
"{",
"$",
"hydrated",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"issues",
"as",
"$",
"issue",
")",
"{",
"$",
"hydrated",
"[",
"]",
"=",
"self",
"::",
"hydrate",
"("... | Hydrate a collection of issue objects into a collection of
IssueEntity objects
@param array $issues
@return IssueEntity[] | [
"Hydrate",
"a",
"collection",
"of",
"issue",
"objects",
"into",
"a",
"collection",
"of",
"IssueEntity",
"objects"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/Application/Scan/IssueHydrator.php#L20-L29 | train |
rips/php-connector-bundle | Entities/OAuth2/ClientEntity.php | ClientEntity.setAllowedGrantTypes | public function setAllowedGrantTypes($allowedGrantTypes)
{
foreach ($allowedGrantTypes as $allowedGrantType) {
if (!in_array($allowedGrantType, $this->availableGrantTypes)) {
throw new \Exception('Unknown grant type ' . $allowedGrantType);
}
}
$this->allowedGrantTypes = $allowedGrantTypes;
} | php | public function setAllowedGrantTypes($allowedGrantTypes)
{
foreach ($allowedGrantTypes as $allowedGrantType) {
if (!in_array($allowedGrantType, $this->availableGrantTypes)) {
throw new \Exception('Unknown grant type ' . $allowedGrantType);
}
}
$this->allowedGrantTypes = $allowedGrantTypes;
} | [
"public",
"function",
"setAllowedGrantTypes",
"(",
"$",
"allowedGrantTypes",
")",
"{",
"foreach",
"(",
"$",
"allowedGrantTypes",
"as",
"$",
"allowedGrantType",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"allowedGrantType",
",",
"$",
"this",
"->",
"availab... | Set allowed grant types
@param string[] $allowedGrantTypes
@throws \Exception | [
"Set",
"allowed",
"grant",
"types"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Entities/OAuth2/ClientEntity.php#L164-L172 | train |
nabu-3/core | nabu/data/module/CNabuModuleMorphList.php | CNabuModuleMorphList.acquireItem | protected function acquireItem($key, $index = false)
{
$retval = false;
$nb_engine = CNabuEngine::getEngine();
if ($nb_engine->isMainDBAvailable()) {
$item = new CNabuModuleMorph($key);
if ($item->isFetched()) {
$retval = $item;
}
}
return $retval;
} | php | protected function acquireItem($key, $index = false)
{
$retval = false;
$nb_engine = CNabuEngine::getEngine();
if ($nb_engine->isMainDBAvailable()) {
$item = new CNabuModuleMorph($key);
if ($item->isFetched()) {
$retval = $item;
}
}
return $retval;
} | [
"protected",
"function",
"acquireItem",
"(",
"$",
"key",
",",
"$",
"index",
"=",
"false",
")",
"{",
"$",
"retval",
"=",
"false",
";",
"$",
"nb_engine",
"=",
"CNabuEngine",
"::",
"getEngine",
"(",
")",
";",
"if",
"(",
"$",
"nb_engine",
"->",
"isMainDBAv... | Acquires an instance of class CNabuModuleMorph from the database.
@param string $key Id of the instance to unserialize.
@param string $index Secondary index to be used if needed.
@return mixed Returns the unserialized instance if exists or false if not. | [
"Acquires",
"an",
"instance",
"of",
"class",
"CNabuModuleMorph",
"from",
"the",
"database",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/module/CNabuModuleMorphList.php#L46-L59 | train |
mpaleo/scaffolder | src/Scaffolder/Compilers/View/LoginViewCompiler.php | LoginViewCompiler.compile | public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, ScaffolderThemeExtensionInterface $themeExtension, array $extensions, $extra = null)
{
$this->stub = $stub;
$this->stub = $themeExtension->runAfterLoginViewIsCompiled($this->stub, $scaffolderConfig);
foreach ($extensions as $extension)
{
$this->stub = $extension->runAfterLoginViewIsCompiled($this->stub, $scaffolderConfig);
}
return $this->store(null, $scaffolderConfig, $this->stub, new FileToCompile(null, null));
} | php | public function compile($stub, $modelName, $modelData, stdClass $scaffolderConfig, $hash, ScaffolderThemeExtensionInterface $themeExtension, array $extensions, $extra = null)
{
$this->stub = $stub;
$this->stub = $themeExtension->runAfterLoginViewIsCompiled($this->stub, $scaffolderConfig);
foreach ($extensions as $extension)
{
$this->stub = $extension->runAfterLoginViewIsCompiled($this->stub, $scaffolderConfig);
}
return $this->store(null, $scaffolderConfig, $this->stub, new FileToCompile(null, null));
} | [
"public",
"function",
"compile",
"(",
"$",
"stub",
",",
"$",
"modelName",
",",
"$",
"modelData",
",",
"stdClass",
"$",
"scaffolderConfig",
",",
"$",
"hash",
",",
"ScaffolderThemeExtensionInterface",
"$",
"themeExtension",
",",
"array",
"$",
"extensions",
",",
... | Compiles the login view.
@param $stub
@param $modelName
@param $modelData
@param \stdClass $scaffolderConfig
@param $hash
@param \Scaffolder\Support\Contracts\ScaffolderThemeExtensionInterface $themeExtension
@param \Scaffolder\Support\Contracts\ScaffolderExtensionInterface[] $extensions
@param null $extra
@return string | [
"Compiles",
"the",
"login",
"view",
"."
] | c68062dc1d71784b93e5ef77a8abd283b716633f | https://github.com/mpaleo/scaffolder/blob/c68062dc1d71784b93e5ef77a8abd283b716633f/src/Scaffolder/Compilers/View/LoginViewCompiler.php#L28-L40 | train |
orchestral/lumen | src/Concerns/RoutesRequests.php | RoutesRequests.parseIncomingRequest | protected function parseIncomingRequest($request)
{
if (! $request) {
$request = LumenRequest::capture();
}
$this->instance(Request::class, $this->prepareRequest($request));
return [$request->getMethod(), '/'.\trim($request->getPathInfo(), '/')];
} | php | protected function parseIncomingRequest($request)
{
if (! $request) {
$request = LumenRequest::capture();
}
$this->instance(Request::class, $this->prepareRequest($request));
return [$request->getMethod(), '/'.\trim($request->getPathInfo(), '/')];
} | [
"protected",
"function",
"parseIncomingRequest",
"(",
"$",
"request",
")",
"{",
"if",
"(",
"!",
"$",
"request",
")",
"{",
"$",
"request",
"=",
"LumenRequest",
"::",
"capture",
"(",
")",
";",
"}",
"$",
"this",
"->",
"instance",
"(",
"Request",
"::",
"cl... | Parse the incoming request and return the method and path info.
@param \Symfony\Component\HttpFoundation\Request|null $request
@return array | [
"Parse",
"the",
"incoming",
"request",
"and",
"return",
"the",
"method",
"and",
"path",
"info",
"."
] | 85a004e7cde0517b527241154f5ad031b7215851 | https://github.com/orchestral/lumen/blob/85a004e7cde0517b527241154f5ad031b7215851/src/Concerns/RoutesRequests.php#L191-L200 | train |
orchestral/lumen | src/Concerns/RoutesRequests.php | RoutesRequests.callActionOnArrayBasedRoute | protected function callActionOnArrayBasedRoute($routeInfo)
{
$action = $routeInfo[1];
if (isset($action['uses'])) {
return $this->prepareResponse($this->callControllerAction($routeInfo));
}
foreach ($action as $value) {
if ($value instanceof Closure) {
$closure = $value->bindTo(new RoutingClosure());
break;
}
}
try {
return $this->prepareResponse($this->call($closure, $routeInfo[2]));
} catch (HttpResponseException $e) {
return $e->getResponse();
}
} | php | protected function callActionOnArrayBasedRoute($routeInfo)
{
$action = $routeInfo[1];
if (isset($action['uses'])) {
return $this->prepareResponse($this->callControllerAction($routeInfo));
}
foreach ($action as $value) {
if ($value instanceof Closure) {
$closure = $value->bindTo(new RoutingClosure());
break;
}
}
try {
return $this->prepareResponse($this->call($closure, $routeInfo[2]));
} catch (HttpResponseException $e) {
return $e->getResponse();
}
} | [
"protected",
"function",
"callActionOnArrayBasedRoute",
"(",
"$",
"routeInfo",
")",
"{",
"$",
"action",
"=",
"$",
"routeInfo",
"[",
"1",
"]",
";",
"if",
"(",
"isset",
"(",
"$",
"action",
"[",
"'uses'",
"]",
")",
")",
"{",
"return",
"$",
"this",
"->",
... | Call the Closure on the array based route.
@param array $routeInfo
@return mixed | [
"Call",
"the",
"Closure",
"on",
"the",
"array",
"based",
"route",
"."
] | 85a004e7cde0517b527241154f5ad031b7215851 | https://github.com/orchestral/lumen/blob/85a004e7cde0517b527241154f5ad031b7215851/src/Concerns/RoutesRequests.php#L285-L305 | train |
orchestral/lumen | src/Concerns/RoutesRequests.php | RoutesRequests.prepareResponse | public function prepareResponse($response)
{
$request = \app(Request::class);
if ($response instanceof Responsable) {
$response = $response->toResponse($request);
}
if ($response instanceof PsrResponseInterface) {
$response = (new HttpFoundationFactory())->createResponse($response);
} elseif (! $response instanceof SymfonyResponse) {
$response = new Response($response);
} elseif ($response instanceof BinaryFileResponse) {
$response = $response->prepare(Request::capture());
}
return $response->prepare($request);
} | php | public function prepareResponse($response)
{
$request = \app(Request::class);
if ($response instanceof Responsable) {
$response = $response->toResponse($request);
}
if ($response instanceof PsrResponseInterface) {
$response = (new HttpFoundationFactory())->createResponse($response);
} elseif (! $response instanceof SymfonyResponse) {
$response = new Response($response);
} elseif ($response instanceof BinaryFileResponse) {
$response = $response->prepare(Request::capture());
}
return $response->prepare($request);
} | [
"public",
"function",
"prepareResponse",
"(",
"$",
"response",
")",
"{",
"$",
"request",
"=",
"\\",
"app",
"(",
"Request",
"::",
"class",
")",
";",
"if",
"(",
"$",
"response",
"instanceof",
"Responsable",
")",
"{",
"$",
"response",
"=",
"$",
"response",
... | Prepare the response for sending.
@param mixed $response
@return Response | [
"Prepare",
"the",
"response",
"for",
"sending",
"."
] | 85a004e7cde0517b527241154f5ad031b7215851 | https://github.com/orchestral/lumen/blob/85a004e7cde0517b527241154f5ad031b7215851/src/Concerns/RoutesRequests.php#L444-L461 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.scan | public function scan($classes, $namespaceTablenames=true, $morphClassAbbreviations=true)
{
$this->namespaceTablenames = $namespaceTablenames;
$this->morphClassAbbreviations = $morphClassAbbreviations;
$metadata = [];
foreach ($classes as $class) {
$entityMetadata = $this->parseClass($class);
if ($entityMetadata) {
$metadata[$class] = $entityMetadata;
}
}
// validate pivot tables
$this->validator->validatePivotTables($metadata);
// generate morphable classes
$this->generateMorphableClasses($metadata);
return $metadata;
} | php | public function scan($classes, $namespaceTablenames=true, $morphClassAbbreviations=true)
{
$this->namespaceTablenames = $namespaceTablenames;
$this->morphClassAbbreviations = $morphClassAbbreviations;
$metadata = [];
foreach ($classes as $class) {
$entityMetadata = $this->parseClass($class);
if ($entityMetadata) {
$metadata[$class] = $entityMetadata;
}
}
// validate pivot tables
$this->validator->validatePivotTables($metadata);
// generate morphable classes
$this->generateMorphableClasses($metadata);
return $metadata;
} | [
"public",
"function",
"scan",
"(",
"$",
"classes",
",",
"$",
"namespaceTablenames",
"=",
"true",
",",
"$",
"morphClassAbbreviations",
"=",
"true",
")",
"{",
"$",
"this",
"->",
"namespaceTablenames",
"=",
"$",
"namespaceTablenames",
";",
"$",
"this",
"->",
"m... | Build metadata from all entity classes.
@param array $classes
@param boolean $namespaceTablenames
@param boolean $morphClassAbbreviations
@return array | [
"Build",
"metadata",
"from",
"all",
"entity",
"classes",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L69-L91 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.parseClass | public function parseClass($class)
{
$reflectionClass = new ReflectionClass($class);
// check if class is entity
if ($this->reader->getClassAnnotation($reflectionClass, '\ProAI\Datamapper\Annotations\Entity')) {
return $this->parseEntity($class);
} else {
return null;
}
} | php | public function parseClass($class)
{
$reflectionClass = new ReflectionClass($class);
// check if class is entity
if ($this->reader->getClassAnnotation($reflectionClass, '\ProAI\Datamapper\Annotations\Entity')) {
return $this->parseEntity($class);
} else {
return null;
}
} | [
"public",
"function",
"parseClass",
"(",
"$",
"class",
")",
"{",
"$",
"reflectionClass",
"=",
"new",
"ReflectionClass",
"(",
"$",
"class",
")",
";",
"// check if class is entity",
"if",
"(",
"$",
"this",
"->",
"reader",
"->",
"getClassAnnotation",
"(",
"$",
... | Parse a class.
@param string $class
@return array|null | [
"Parse",
"a",
"class",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L99-L109 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.parseEmbeddedClass | protected function parseEmbeddedClass($name, Annotation $annotation, EntityDefinition &$entityMetadata, $primaryKeyOnly = false)
{
// check if related class is valid
$annotation->class = $this->getRealEntity($annotation->class, $entityMetadata['class']);
$reflectionClass = new ReflectionClass($annotation->class);
$classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
// check if class is embedded class
$this->validator->validateEmbeddedClass($annotation->class, $classAnnotations);
$embeddedColumnPrefix = ($annotation->columnPrefix || $annotation->columnPrefix === false)
? $annotation->columnPrefix
: $name;
$embeddedClassMetadata = new EmbeddedClassDefinition([
'name' => $name,
'class' => $annotation->class,
'columnPrefix' => $embeddedColumnPrefix,
'attributes' => [],
]);
// scan property annotations
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
$name = $this->getSanitizedName($reflectionProperty->getName(), $entityMetadata['class']);
$propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
foreach ($propertyAnnotations as $annotation) {
// property is column
if ($annotation instanceof \ProAI\Datamapper\Annotations\Column) {
$this->setAdditionalColumnProperties($name, $annotation, $propertyAnnotations, true, $embeddedColumnPrefix);
$embeddedClassMetadata['attributes'][] = $this->parseColumn($name, $annotation, $entityMetadata, true, $primaryKeyOnly);
}
}
}
return $embeddedClassMetadata;
} | php | protected function parseEmbeddedClass($name, Annotation $annotation, EntityDefinition &$entityMetadata, $primaryKeyOnly = false)
{
// check if related class is valid
$annotation->class = $this->getRealEntity($annotation->class, $entityMetadata['class']);
$reflectionClass = new ReflectionClass($annotation->class);
$classAnnotations = $this->reader->getClassAnnotations($reflectionClass);
// check if class is embedded class
$this->validator->validateEmbeddedClass($annotation->class, $classAnnotations);
$embeddedColumnPrefix = ($annotation->columnPrefix || $annotation->columnPrefix === false)
? $annotation->columnPrefix
: $name;
$embeddedClassMetadata = new EmbeddedClassDefinition([
'name' => $name,
'class' => $annotation->class,
'columnPrefix' => $embeddedColumnPrefix,
'attributes' => [],
]);
// scan property annotations
foreach ($reflectionClass->getProperties() as $reflectionProperty) {
$name = $this->getSanitizedName($reflectionProperty->getName(), $entityMetadata['class']);
$propertyAnnotations = $this->reader->getPropertyAnnotations($reflectionProperty);
foreach ($propertyAnnotations as $annotation) {
// property is column
if ($annotation instanceof \ProAI\Datamapper\Annotations\Column) {
$this->setAdditionalColumnProperties($name, $annotation, $propertyAnnotations, true, $embeddedColumnPrefix);
$embeddedClassMetadata['attributes'][] = $this->parseColumn($name, $annotation, $entityMetadata, true, $primaryKeyOnly);
}
}
}
return $embeddedClassMetadata;
} | [
"protected",
"function",
"parseEmbeddedClass",
"(",
"$",
"name",
",",
"Annotation",
"$",
"annotation",
",",
"EntityDefinition",
"&",
"$",
"entityMetadata",
",",
"$",
"primaryKeyOnly",
"=",
"false",
")",
"{",
"// check if related class is valid",
"$",
"annotation",
"... | Parse an embedded class.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Entity $entityMetadata
@return \ProAI\Datamapper\Metadata\Definitions\EmbeddedClass | [
"Parse",
"an",
"embedded",
"class",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L261-L301 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.setAdditionalColumnProperties | protected function setAdditionalColumnProperties($name, Annotation &$annotation, array $propertyAnnotations, $embedded=false, $columnPrefix=false)
{
// scan for primary and versioned property
foreach ($propertyAnnotations as $subAnnotation) {
// set primary key
if ($subAnnotation instanceof \ProAI\Datamapper\Annotations\Id) {
$annotation->primary = true;
}
// set auto increment
if ($subAnnotation instanceof \ProAI\Datamapper\Annotations\AutoIncrement) {
$annotation->autoIncrement = true;
}
// set auto increment
if ($subAnnotation instanceof \ProAI\Datamapper\Annotations\AutoUuid) {
$annotation->autoUuid = true;
}
// set versioned
if ($subAnnotation instanceof \ProAI\Datamapper\Annotations\Versioned) {
$annotation->versioned = true;
}
}
// set column name
$annotation->name = $this->getColumnName($annotation->name ?: $name, $columnPrefix);
} | php | protected function setAdditionalColumnProperties($name, Annotation &$annotation, array $propertyAnnotations, $embedded=false, $columnPrefix=false)
{
// scan for primary and versioned property
foreach ($propertyAnnotations as $subAnnotation) {
// set primary key
if ($subAnnotation instanceof \ProAI\Datamapper\Annotations\Id) {
$annotation->primary = true;
}
// set auto increment
if ($subAnnotation instanceof \ProAI\Datamapper\Annotations\AutoIncrement) {
$annotation->autoIncrement = true;
}
// set auto increment
if ($subAnnotation instanceof \ProAI\Datamapper\Annotations\AutoUuid) {
$annotation->autoUuid = true;
}
// set versioned
if ($subAnnotation instanceof \ProAI\Datamapper\Annotations\Versioned) {
$annotation->versioned = true;
}
}
// set column name
$annotation->name = $this->getColumnName($annotation->name ?: $name, $columnPrefix);
} | [
"protected",
"function",
"setAdditionalColumnProperties",
"(",
"$",
"name",
",",
"Annotation",
"&",
"$",
"annotation",
",",
"array",
"$",
"propertyAnnotations",
",",
"$",
"embedded",
"=",
"false",
",",
"$",
"columnPrefix",
"=",
"false",
")",
"{",
"// scan for pr... | Set properties of column annotation related annotations.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param array $propertyAnnotations
@param boolean $embedded
@param mixed $columnPrefix
@return void | [
"Set",
"properties",
"of",
"column",
"annotation",
"related",
"annotations",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L313-L337 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.parseColumn | protected function parseColumn($name, Annotation $annotation, EntityDefinition &$entityMetadata, $embedded=false, $primaryKeyOnly = false)
{
if ($annotation->primary == $primaryKeyOnly) {
// set column data
if (! empty($entityMetadata['versionTable']) && $annotation->versioned) {
$entityMetadata['versionTable']['columns'][] = $this->generateColumn($name, $annotation);
} else {
$entityMetadata['table']['columns'][] = $this->generateColumn($name, $annotation);
}
// set up version feature
if (! empty($entityMetadata['versionTable']) && ! $annotation->versioned && $annotation->primary) {
$this->generateVersionTable($name, $annotation, $entityMetadata);
}
}
return $this->generateAttribute($name, $annotation);
} | php | protected function parseColumn($name, Annotation $annotation, EntityDefinition &$entityMetadata, $embedded=false, $primaryKeyOnly = false)
{
if ($annotation->primary == $primaryKeyOnly) {
// set column data
if (! empty($entityMetadata['versionTable']) && $annotation->versioned) {
$entityMetadata['versionTable']['columns'][] = $this->generateColumn($name, $annotation);
} else {
$entityMetadata['table']['columns'][] = $this->generateColumn($name, $annotation);
}
// set up version feature
if (! empty($entityMetadata['versionTable']) && ! $annotation->versioned && $annotation->primary) {
$this->generateVersionTable($name, $annotation, $entityMetadata);
}
}
return $this->generateAttribute($name, $annotation);
} | [
"protected",
"function",
"parseColumn",
"(",
"$",
"name",
",",
"Annotation",
"$",
"annotation",
",",
"EntityDefinition",
"&",
"$",
"entityMetadata",
",",
"$",
"embedded",
"=",
"false",
",",
"$",
"primaryKeyOnly",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"an... | Parse a column.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Class $entityMetadata
@param boolean $embedded
@return \ProAI\Datamapper\Metadata\Definitions\Attribute | [
"Parse",
"a",
"column",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L348-L365 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateColumn | protected function generateColumn($name, $annotation)
{
// check if column type is valid
$this->validator->validateColumnType($annotation->type);
// add column
return new ColumnDefinition([
'name' => $annotation->name,
'type' => $annotation->type,
'nullable' => $annotation->nullable,
'default' => $annotation->default,
'primary' => $annotation->primary,
'unique' => $annotation->unique,
'index' => $annotation->index,
'options' => $this->generateAttributeOptionsArray($annotation)
]);
} | php | protected function generateColumn($name, $annotation)
{
// check if column type is valid
$this->validator->validateColumnType($annotation->type);
// add column
return new ColumnDefinition([
'name' => $annotation->name,
'type' => $annotation->type,
'nullable' => $annotation->nullable,
'default' => $annotation->default,
'primary' => $annotation->primary,
'unique' => $annotation->unique,
'index' => $annotation->index,
'options' => $this->generateAttributeOptionsArray($annotation)
]);
} | [
"protected",
"function",
"generateColumn",
"(",
"$",
"name",
",",
"$",
"annotation",
")",
"{",
"// check if column type is valid",
"$",
"this",
"->",
"validator",
"->",
"validateColumnType",
"(",
"$",
"annotation",
"->",
"type",
")",
";",
"// add column",
"return"... | Generate a column.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@return \ProAI\Datamapper\Metadata\Definitions\Column | [
"Generate",
"a",
"column",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L374-L390 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateVersionTable | protected function generateVersionTable($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$annotation = clone $annotation;
$annotation->name ='ref_' . $annotation->name;
$annotation->autoIncrement = false;
// copy primary key to version table
$entityMetadata['versionTable']['columns'][] = $this->generateColumn($name, $annotation);
} | php | protected function generateVersionTable($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$annotation = clone $annotation;
$annotation->name ='ref_' . $annotation->name;
$annotation->autoIncrement = false;
// copy primary key to version table
$entityMetadata['versionTable']['columns'][] = $this->generateColumn($name, $annotation);
} | [
"protected",
"function",
"generateVersionTable",
"(",
"$",
"name",
",",
"Annotation",
"$",
"annotation",
",",
"EntityDefinition",
"&",
"$",
"entityMetadata",
")",
"{",
"$",
"annotation",
"=",
"clone",
"$",
"annotation",
";",
"$",
"annotation",
"->",
"name",
"=... | Generate versioning table.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Class $entityMetadata
@return void | [
"Generate",
"versioning",
"table",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L400-L408 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateAttributeOptionsArray | protected function generateAttributeOptionsArray(Annotation $annotation)
{
$options = [];
// length option
if ($annotation->type == 'string' || $annotation->type == 'char' || $annotation->type == 'binary') {
$options['length'] = $annotation->length;
}
// fixed option
if ($annotation->type == 'binary' && $annotation->length == 16) {
$options['fixed'] = $annotation->fixed;
$options['autoUuid'] = $annotation->autoUuid;
}
// unsigned and autoIncrement option
if ($annotation->type == 'smallInteger' || $annotation->type == 'integer' || $annotation->type == 'bigInteger') {
$options['unsigned'] = $annotation->unsigned;
$options['autoIncrement'] = $annotation->autoIncrement;
}
// scale and precision option
if ($annotation->type == 'decimal') {
$options['scale'] = $annotation->scale;
$options['precision'] = $annotation->precision;
}
return $options;
} | php | protected function generateAttributeOptionsArray(Annotation $annotation)
{
$options = [];
// length option
if ($annotation->type == 'string' || $annotation->type == 'char' || $annotation->type == 'binary') {
$options['length'] = $annotation->length;
}
// fixed option
if ($annotation->type == 'binary' && $annotation->length == 16) {
$options['fixed'] = $annotation->fixed;
$options['autoUuid'] = $annotation->autoUuid;
}
// unsigned and autoIncrement option
if ($annotation->type == 'smallInteger' || $annotation->type == 'integer' || $annotation->type == 'bigInteger') {
$options['unsigned'] = $annotation->unsigned;
$options['autoIncrement'] = $annotation->autoIncrement;
}
// scale and precision option
if ($annotation->type == 'decimal') {
$options['scale'] = $annotation->scale;
$options['precision'] = $annotation->precision;
}
return $options;
} | [
"protected",
"function",
"generateAttributeOptionsArray",
"(",
"Annotation",
"$",
"annotation",
")",
"{",
"$",
"options",
"=",
"[",
"]",
";",
"// length option",
"if",
"(",
"$",
"annotation",
"->",
"type",
"==",
"'string'",
"||",
"$",
"annotation",
"->",
"type... | Generate an options array for an attribute.
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@return array | [
"Generate",
"an",
"options",
"array",
"for",
"an",
"attribute",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L433-L461 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.parseRelation | protected function parseRelation($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
// check if relation type is valid
$this->validator->validateRelationType($annotation->type);
// check if we need to add base namespace from configuration
$annotation->relatedEntity = $annotation->relatedEntity
? $this->getRealEntity($annotation->relatedEntity, $entityMetadata['class'])
: null;
$annotation->throughEntity = $annotation->throughEntity
? $this->getRealEntity($annotation->throughEntity, $entityMetadata['class'])
: null;
// change morphedByMany to inverse morphToMany
if ($annotation->type == 'morphedByMany') {
$annotation->type = 'morphToMany';
$annotation->inverse = true;
}
// create extra columns for belongsTo
if ($annotation->type == 'belongsTo') {
$this->generateBelongsToColumns($name, $annotation, $entityMetadata);
}
// create extra columns for morphTo
if ($annotation->type == 'morphTo') {
$this->generateMorphToColumns($name, $annotation, $entityMetadata);
}
$pivotTable = null;
// create pivot table for belongsToMany
if ($annotation->type == 'belongsToMany') {
$pivotTable = $this->generateBelongsToManyPivotTable($name, $annotation, $entityMetadata);
}
// create pivot table for morphToMany
if ($annotation->type == 'morphToMany') {
$pivotTable = $this->generateMorphToManyPivotTable($name, $annotation, $entityMetadata);
}
// add relation
return new RelationDefinition([
'name' => $name,
'type' => $annotation->type,
'relatedEntity' => $annotation->relatedEntity,
'pivotTable' => $pivotTable,
'options' => $this->generateRelationOptionsArray($name, $annotation, $entityMetadata)
]);
} | php | protected function parseRelation($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
// check if relation type is valid
$this->validator->validateRelationType($annotation->type);
// check if we need to add base namespace from configuration
$annotation->relatedEntity = $annotation->relatedEntity
? $this->getRealEntity($annotation->relatedEntity, $entityMetadata['class'])
: null;
$annotation->throughEntity = $annotation->throughEntity
? $this->getRealEntity($annotation->throughEntity, $entityMetadata['class'])
: null;
// change morphedByMany to inverse morphToMany
if ($annotation->type == 'morphedByMany') {
$annotation->type = 'morphToMany';
$annotation->inverse = true;
}
// create extra columns for belongsTo
if ($annotation->type == 'belongsTo') {
$this->generateBelongsToColumns($name, $annotation, $entityMetadata);
}
// create extra columns for morphTo
if ($annotation->type == 'morphTo') {
$this->generateMorphToColumns($name, $annotation, $entityMetadata);
}
$pivotTable = null;
// create pivot table for belongsToMany
if ($annotation->type == 'belongsToMany') {
$pivotTable = $this->generateBelongsToManyPivotTable($name, $annotation, $entityMetadata);
}
// create pivot table for morphToMany
if ($annotation->type == 'morphToMany') {
$pivotTable = $this->generateMorphToManyPivotTable($name, $annotation, $entityMetadata);
}
// add relation
return new RelationDefinition([
'name' => $name,
'type' => $annotation->type,
'relatedEntity' => $annotation->relatedEntity,
'pivotTable' => $pivotTable,
'options' => $this->generateRelationOptionsArray($name, $annotation, $entityMetadata)
]);
} | [
"protected",
"function",
"parseRelation",
"(",
"$",
"name",
",",
"Annotation",
"$",
"annotation",
",",
"EntityDefinition",
"&",
"$",
"entityMetadata",
")",
"{",
"// check if relation type is valid",
"$",
"this",
"->",
"validator",
"->",
"validateRelationType",
"(",
... | Parse a relationship.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Class $entityMetadata
@return \ProAI\Datamapper\Metadata\Definitions\Relation | [
"Parse",
"a",
"relationship",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L471-L520 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateBelongsToColumns | protected function generateBelongsToColumns($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$relatedForeignKey = $annotation->relatedForeignKey ?: $this->generateKey($annotation->relatedEntity);
$entityMetadata['table']['columns'][] = $this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $relatedForeignKey,
'primary' => false,
'options' => [
'autoIncrement' => false
]
]);
} | php | protected function generateBelongsToColumns($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$relatedForeignKey = $annotation->relatedForeignKey ?: $this->generateKey($annotation->relatedEntity);
$entityMetadata['table']['columns'][] = $this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $relatedForeignKey,
'primary' => false,
'options' => [
'autoIncrement' => false
]
]);
} | [
"protected",
"function",
"generateBelongsToColumns",
"(",
"$",
"name",
",",
"Annotation",
"$",
"annotation",
",",
"EntityDefinition",
"&",
"$",
"entityMetadata",
")",
"{",
"$",
"relatedForeignKey",
"=",
"$",
"annotation",
"->",
"relatedForeignKey",
"?",
":",
"$",
... | Generate extra columns for a belongsTo relation.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Class $entityMetadata
@return void | [
"Generate",
"extra",
"columns",
"for",
"a",
"belongsTo",
"relation",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L616-L627 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateMorphToColumns | protected function generateMorphToColumns($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$morphName = (! empty($annotation->morphName))
? $annotation->morphName
: $name;
$morphId = (! empty($annotation->morphId))
? $annotation->morphId
: $morphName.'_id';
$morphType = (! empty($annotation->morphType))
? $annotation->morphType
: $morphName.'_type';
$entityMetadata['table']['columns'][] = $this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $morphId,
'primary' => false,
'options' => [
'autoIncrement' => false
]
]);
$entityMetadata['table']['columns'][] = new ColumnDefinition([
'name' => $morphType,
'type' => 'string',
'nullable' => false,
'default' => false,
'primary' => false,
'unique' => false,
'index' => false,
'options' => []
]);
} | php | protected function generateMorphToColumns($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$morphName = (! empty($annotation->morphName))
? $annotation->morphName
: $name;
$morphId = (! empty($annotation->morphId))
? $annotation->morphId
: $morphName.'_id';
$morphType = (! empty($annotation->morphType))
? $annotation->morphType
: $morphName.'_type';
$entityMetadata['table']['columns'][] = $this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $morphId,
'primary' => false,
'options' => [
'autoIncrement' => false
]
]);
$entityMetadata['table']['columns'][] = new ColumnDefinition([
'name' => $morphType,
'type' => 'string',
'nullable' => false,
'default' => false,
'primary' => false,
'unique' => false,
'index' => false,
'options' => []
]);
} | [
"protected",
"function",
"generateMorphToColumns",
"(",
"$",
"name",
",",
"Annotation",
"$",
"annotation",
",",
"EntityDefinition",
"&",
"$",
"entityMetadata",
")",
"{",
"$",
"morphName",
"=",
"(",
"!",
"empty",
"(",
"$",
"annotation",
"->",
"morphName",
")",
... | Generate extra columns for a morphTo relation.
@param array $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Class $entityMetadata
@return void | [
"Generate",
"extra",
"columns",
"for",
"a",
"morphTo",
"relation",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L637-L669 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateBelongsToManyPivotTable | protected function generateBelongsToManyPivotTable($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$tableName = ($annotation->pivotTable)
? $annotation->pivotTable
: $this->generatePivotTablename($entityMetadata['class'], $annotation->relatedEntity, $annotation->inverse);
$localPivotKey = $annotation->localForeignKey ?: $this->generateKey($entityMetadata['class']);
$relatedPivotKey = $annotation->relatedForeignKey ?: $this->generateKey($annotation->relatedEntity);
return new TableDefinition([
'name' => $tableName,
'columns' => [
$this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $localPivotKey,
'options' => [
'autoIncrement' => false
]
]),
$this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $relatedPivotKey,
'options' => [
'autoIncrement' => false
]
]),
]
]);
} | php | protected function generateBelongsToManyPivotTable($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$tableName = ($annotation->pivotTable)
? $annotation->pivotTable
: $this->generatePivotTablename($entityMetadata['class'], $annotation->relatedEntity, $annotation->inverse);
$localPivotKey = $annotation->localForeignKey ?: $this->generateKey($entityMetadata['class']);
$relatedPivotKey = $annotation->relatedForeignKey ?: $this->generateKey($annotation->relatedEntity);
return new TableDefinition([
'name' => $tableName,
'columns' => [
$this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $localPivotKey,
'options' => [
'autoIncrement' => false
]
]),
$this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $relatedPivotKey,
'options' => [
'autoIncrement' => false
]
]),
]
]);
} | [
"protected",
"function",
"generateBelongsToManyPivotTable",
"(",
"$",
"name",
",",
"Annotation",
"$",
"annotation",
",",
"EntityDefinition",
"&",
"$",
"entityMetadata",
")",
"{",
"$",
"tableName",
"=",
"(",
"$",
"annotation",
"->",
"pivotTable",
")",
"?",
"$",
... | Generate pivot table for a belongsToMany relation.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Class $entityMetadata
@return \ProAI\Datamapper\Metadata\Definitions\Table | [
"Generate",
"pivot",
"table",
"for",
"a",
"belongsToMany",
"relation",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L679-L706 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateMorphToManyPivotTable | protected function generateMorphToManyPivotTable($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$morphName = $annotation->morphName;
$tableName = ($annotation->pivotTable)
? $annotation->pivotTable
: $this->generatePivotTablename($entityMetadata['class'], $annotation->relatedEntity, $annotation->inverse, $morphName);
if ($annotation->inverse) {
$pivotKey = $annotation->localPivotKey ?: $this->generateKey($entityMetadata['class']);
} else {
$pivotKey = $annotation->relatedPivotKey ?: $this->generateKey($annotation->relatedEntity);
}
$morphId = (! empty($annotation->localKey))
? $annotation->localKey
: $morphName.'_id';
$morphType = $morphName.'_type';
return new TableDefinition([
'name' => $tableName,
'columns' => [
$this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $pivotKey,
'options' => [
'autoIncrement' => false
]
]),
$this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $morphId,
'options' => [
'autoIncrement' => false
]
]),
new ColumnDefinition([
'name' => $morphType,
'type' => 'string',
'nullable' => false,
'default' => false,
'primary' => true,
'unique' => false,
'index' => false,
'options' => []
]),
]
]);
} | php | protected function generateMorphToManyPivotTable($name, Annotation $annotation, EntityDefinition &$entityMetadata)
{
$morphName = $annotation->morphName;
$tableName = ($annotation->pivotTable)
? $annotation->pivotTable
: $this->generatePivotTablename($entityMetadata['class'], $annotation->relatedEntity, $annotation->inverse, $morphName);
if ($annotation->inverse) {
$pivotKey = $annotation->localPivotKey ?: $this->generateKey($entityMetadata['class']);
} else {
$pivotKey = $annotation->relatedPivotKey ?: $this->generateKey($annotation->relatedEntity);
}
$morphId = (! empty($annotation->localKey))
? $annotation->localKey
: $morphName.'_id';
$morphType = $morphName.'_type';
return new TableDefinition([
'name' => $tableName,
'columns' => [
$this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $pivotKey,
'options' => [
'autoIncrement' => false
]
]),
$this->getModifiedPrimaryKeyColumn($entityMetadata['table'], [
'name' => $morphId,
'options' => [
'autoIncrement' => false
]
]),
new ColumnDefinition([
'name' => $morphType,
'type' => 'string',
'nullable' => false,
'default' => false,
'primary' => true,
'unique' => false,
'index' => false,
'options' => []
]),
]
]);
} | [
"protected",
"function",
"generateMorphToManyPivotTable",
"(",
"$",
"name",
",",
"Annotation",
"$",
"annotation",
",",
"EntityDefinition",
"&",
"$",
"entityMetadata",
")",
"{",
"$",
"morphName",
"=",
"$",
"annotation",
"->",
"morphName",
";",
"$",
"tableName",
"... | Generate pivot table for a morphToMany relation.
@param string $name
@param \ProAI\Datamapper\Annotations\Annotation $annotation
@param \ProAI\Datamapper\Metadata\Definitions\Class $entityMetadata
@return \ProAI\Datamapper\Metadata\Definitions\Table | [
"Generate",
"pivot",
"table",
"for",
"a",
"morphToMany",
"relation",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L716-L763 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.getModifiedPrimaryKeyColumn | protected function getModifiedPrimaryKeyColumn(TableDefinition $tableMetadata, array $data)
{
foreach($tableMetadata['columns'] as $columnMetadata) {
if ($columnMetadata['primary']) {
$modifiedColumnMetadata = clone $columnMetadata;
foreach($data as $key => $value) {
if ($key == 'options') {
$modifiedColumnMetadata[$key] = array_merge($modifiedColumnMetadata[$key], $value);
} else {
$modifiedColumnMetadata[$key] = $value;
}
}
return $modifiedColumnMetadata;
}
}
return false;
} | php | protected function getModifiedPrimaryKeyColumn(TableDefinition $tableMetadata, array $data)
{
foreach($tableMetadata['columns'] as $columnMetadata) {
if ($columnMetadata['primary']) {
$modifiedColumnMetadata = clone $columnMetadata;
foreach($data as $key => $value) {
if ($key == 'options') {
$modifiedColumnMetadata[$key] = array_merge($modifiedColumnMetadata[$key], $value);
} else {
$modifiedColumnMetadata[$key] = $value;
}
}
return $modifiedColumnMetadata;
}
}
return false;
} | [
"protected",
"function",
"getModifiedPrimaryKeyColumn",
"(",
"TableDefinition",
"$",
"tableMetadata",
",",
"array",
"$",
"data",
")",
"{",
"foreach",
"(",
"$",
"tableMetadata",
"[",
"'columns'",
"]",
"as",
"$",
"columnMetadata",
")",
"{",
"if",
"(",
"$",
"colu... | Get primary key column.
@param \ProAI\Datamapper\Metadata\Definitions\Table $tableMetadata
@param array $data
@return \ProAI\Datamapper\Metadata\Definitions\Column | [
"Get",
"primary",
"key",
"column",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L772-L788 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateMorphableClasses | protected function generateMorphableClasses(array &$metadata)
{
foreach ($metadata as $key => $entityMetadata) {
foreach ($entityMetadata['relations'] as $relationKey => $relationMetadata) {
// get morphable classes for morphTo relations
if ($relationMetadata['type'] == 'morphTo') {
$metadata[$key]['relations'][$relationKey]['options']['morphableClasses']
= $this->getMorphableClasses($entityMetadata['class'], $relationMetadata['options']['morphName'], $metadata);
}
// get morphable classes for morphToMany relations
if ($relationMetadata['type'] == 'morphToMany' && ! $relationMetadata['options']['inverse']) {
$metadata[$key]['relations'][$relationKey]['options']['morphableClasses']
= $this->getMorphableClasses($entityMetadata['class'], $relationMetadata['options']['morphName'], $metadata, true);
}
}
}
} | php | protected function generateMorphableClasses(array &$metadata)
{
foreach ($metadata as $key => $entityMetadata) {
foreach ($entityMetadata['relations'] as $relationKey => $relationMetadata) {
// get morphable classes for morphTo relations
if ($relationMetadata['type'] == 'morphTo') {
$metadata[$key]['relations'][$relationKey]['options']['morphableClasses']
= $this->getMorphableClasses($entityMetadata['class'], $relationMetadata['options']['morphName'], $metadata);
}
// get morphable classes for morphToMany relations
if ($relationMetadata['type'] == 'morphToMany' && ! $relationMetadata['options']['inverse']) {
$metadata[$key]['relations'][$relationKey]['options']['morphableClasses']
= $this->getMorphableClasses($entityMetadata['class'], $relationMetadata['options']['morphName'], $metadata, true);
}
}
}
} | [
"protected",
"function",
"generateMorphableClasses",
"(",
"array",
"&",
"$",
"metadata",
")",
"{",
"foreach",
"(",
"$",
"metadata",
"as",
"$",
"key",
"=>",
"$",
"entityMetadata",
")",
"{",
"foreach",
"(",
"$",
"entityMetadata",
"[",
"'relations'",
"]",
"as",... | Generate array of morphable classes for a morphTo or morphToMany relation.
@param array $array
@return void | [
"Generate",
"array",
"of",
"morphable",
"classes",
"for",
"a",
"morphTo",
"or",
"morphToMany",
"relation",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L796-L813 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.getMorphableClasses | protected function getMorphableClasses($relatedEntity, $morphName, array $metadata, $many=false)
{
$morphableClasses = [];
foreach ($metadata as $entityMetadata) {
foreach ($entityMetadata['relations'] as $relationMetadata) {
// check relation type
if (! ((! $many && $relationMetadata['type'] == 'morphOne')
|| (! $many && $relationMetadata['type'] == 'morphMany')
|| ($many && $relationMetadata['type'] == 'morphToMany' && $relationMetadata['options']['inverse']))) {
continue;
}
// check foreign entity and morph name
if ($relationMetadata['relatedEntity'] == $relatedEntity
&& $relationMetadata['options']['morphName'] == $morphName) {
$morphableClasses[$entityMetadata['morphClass']] = $entityMetadata['class'];
}
}
}
return $morphableClasses;
} | php | protected function getMorphableClasses($relatedEntity, $morphName, array $metadata, $many=false)
{
$morphableClasses = [];
foreach ($metadata as $entityMetadata) {
foreach ($entityMetadata['relations'] as $relationMetadata) {
// check relation type
if (! ((! $many && $relationMetadata['type'] == 'morphOne')
|| (! $many && $relationMetadata['type'] == 'morphMany')
|| ($many && $relationMetadata['type'] == 'morphToMany' && $relationMetadata['options']['inverse']))) {
continue;
}
// check foreign entity and morph name
if ($relationMetadata['relatedEntity'] == $relatedEntity
&& $relationMetadata['options']['morphName'] == $morphName) {
$morphableClasses[$entityMetadata['morphClass']] = $entityMetadata['class'];
}
}
}
return $morphableClasses;
} | [
"protected",
"function",
"getMorphableClasses",
"(",
"$",
"relatedEntity",
",",
"$",
"morphName",
",",
"array",
"$",
"metadata",
",",
"$",
"many",
"=",
"false",
")",
"{",
"$",
"morphableClasses",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"metadata",
"as",
... | Get array of morphable classes for a morphTo or morphToMany relation.
@param string $relatedEntity
@param string $morphName
@param array $metadata
@param boolean $many
@return void | [
"Get",
"array",
"of",
"morphable",
"classes",
"for",
"a",
"morphTo",
"or",
"morphToMany",
"relation",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L824-L846 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generatePivotTablename | protected function generatePivotTablename($class1, $class2, $inverse, $morph=null)
{
// datamapper namespace tables
if ($this->namespaceTablenames) {
$base = ($inverse)
? $this->generateTableName($class1, true)
: $this->generateTableName($class2, true);
$related = (! empty($morph))
? $morph
: (! empty($inverse)
? snake_case(class_basename($class2))
: snake_case(class_basename($class1)));
return $base . '_' . $related . '_pivot';
}
// eloquent default
$base = snake_case(class_basename($class1));
$related = snake_case(class_basename($class2));
$models = array($related, $base);
sort($models);
return strtolower(implode('_', $models));
} | php | protected function generatePivotTablename($class1, $class2, $inverse, $morph=null)
{
// datamapper namespace tables
if ($this->namespaceTablenames) {
$base = ($inverse)
? $this->generateTableName($class1, true)
: $this->generateTableName($class2, true);
$related = (! empty($morph))
? $morph
: (! empty($inverse)
? snake_case(class_basename($class2))
: snake_case(class_basename($class1)));
return $base . '_' . $related . '_pivot';
}
// eloquent default
$base = snake_case(class_basename($class1));
$related = snake_case(class_basename($class2));
$models = array($related, $base);
sort($models);
return strtolower(implode('_', $models));
} | [
"protected",
"function",
"generatePivotTablename",
"(",
"$",
"class1",
",",
"$",
"class2",
",",
"$",
"inverse",
",",
"$",
"morph",
"=",
"null",
")",
"{",
"// datamapper namespace tables",
"if",
"(",
"$",
"this",
"->",
"namespaceTablenames",
")",
"{",
"$",
"b... | Generate the database tablename of a pivot table.
@param string $class2
@param string $class1
@param boolean $inverse
@param string $morph
@return string | [
"Generate",
"the",
"database",
"tablename",
"of",
"a",
"pivot",
"table",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L868-L895 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.generateTableName | protected function generateTableName($class)
{
// datamapper namespace tables
if ($this->namespaceTablenames) {
$className = array_slice(explode('/', str_replace('\\', '/', $class)), 2);
// delete last entry if entry is equal to the next to last entry
if (count($className) >= 2 && end($className) == prev($className)) {
array_pop($className);
}
$classBasename = array_pop($className);
return strtolower(implode('_', array_merge($className, preg_split('/(?<=\\w)(?=[A-Z])/', $classBasename))));
}
// eloquent default
return str_replace('\\', '', snake_case(str_plural(class_basename($class))));
} | php | protected function generateTableName($class)
{
// datamapper namespace tables
if ($this->namespaceTablenames) {
$className = array_slice(explode('/', str_replace('\\', '/', $class)), 2);
// delete last entry if entry is equal to the next to last entry
if (count($className) >= 2 && end($className) == prev($className)) {
array_pop($className);
}
$classBasename = array_pop($className);
return strtolower(implode('_', array_merge($className, preg_split('/(?<=\\w)(?=[A-Z])/', $classBasename))));
}
// eloquent default
return str_replace('\\', '', snake_case(str_plural(class_basename($class))));
} | [
"protected",
"function",
"generateTableName",
"(",
"$",
"class",
")",
"{",
"// datamapper namespace tables",
"if",
"(",
"$",
"this",
"->",
"namespaceTablenames",
")",
"{",
"$",
"className",
"=",
"array_slice",
"(",
"explode",
"(",
"'/'",
",",
"str_replace",
"(",... | Generate the table associated with the model.
@param string $class
@return string | [
"Generate",
"the",
"table",
"associated",
"with",
"the",
"model",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L903-L921 | train |
markusjwetzel/laravel-datamapper | src/Metadata/EntityScanner.php | EntityScanner.getColumnName | protected function getColumnName($name, $prefix = false)
{
$name = snake_case($name);
if ($prefix) {
$name = $prefix.'_'.$name;
}
return $name;
} | php | protected function getColumnName($name, $prefix = false)
{
$name = snake_case($name);
if ($prefix) {
$name = $prefix.'_'.$name;
}
return $name;
} | [
"protected",
"function",
"getColumnName",
"(",
"$",
"name",
",",
"$",
"prefix",
"=",
"false",
")",
"{",
"$",
"name",
"=",
"snake_case",
"(",
"$",
"name",
")",
";",
"if",
"(",
"$",
"prefix",
")",
"{",
"$",
"name",
"=",
"$",
"prefix",
".",
"'_'",
"... | Get column name of a name.
@param string $name
@param boolean $prefix
@return string | [
"Get",
"column",
"name",
"of",
"a",
"name",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Metadata/EntityScanner.php#L975-L984 | train |
rips/php-connector-bundle | Hydrators/CensusHydrator.php | CensusHydrator.hydrateCollection | public static function hydrateCollection(array $censuses)
{
$hydrated = [];
foreach ($censuses as $census) {
$hydrated[] = self::hydrate($census);
}
return $hydrated;
} | php | public static function hydrateCollection(array $censuses)
{
$hydrated = [];
foreach ($censuses as $census) {
$hydrated[] = self::hydrate($census);
}
return $hydrated;
} | [
"public",
"static",
"function",
"hydrateCollection",
"(",
"array",
"$",
"censuses",
")",
"{",
"$",
"hydrated",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"censuses",
"as",
"$",
"census",
")",
"{",
"$",
"hydrated",
"[",
"]",
"=",
"self",
"::",
"hydrate",
... | Hydrate a collection of census objects into a collection
of CensusEntity objects
@param array $censuses
@return CensusEntity[] | [
"Hydrate",
"a",
"collection",
"of",
"census",
"objects",
"into",
"a",
"collection",
"of",
"CensusEntity",
"objects"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/CensusHydrator.php#L17-L26 | train |
rips/php-connector-bundle | Hydrators/CensusHydrator.php | CensusHydrator.hydrate | public static function hydrate(stdClass $census)
{
$hydrated = new CensusEntity();
if (isset($census->id)) {
$hydrated->setId($census->id);
}
if (isset($census->scans)) {
$hydrated->setScans($census->scans);
}
if (isset($census->issues)) {
$hydrated->setIssues($census->issues);
}
if (isset($census->loc)) {
$hydrated->setLoc($census->loc);
}
return $hydrated;
} | php | public static function hydrate(stdClass $census)
{
$hydrated = new CensusEntity();
if (isset($census->id)) {
$hydrated->setId($census->id);
}
if (isset($census->scans)) {
$hydrated->setScans($census->scans);
}
if (isset($census->issues)) {
$hydrated->setIssues($census->issues);
}
if (isset($census->loc)) {
$hydrated->setLoc($census->loc);
}
return $hydrated;
} | [
"public",
"static",
"function",
"hydrate",
"(",
"stdClass",
"$",
"census",
")",
"{",
"$",
"hydrated",
"=",
"new",
"CensusEntity",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"census",
"->",
"id",
")",
")",
"{",
"$",
"hydrated",
"->",
"setId",
"(",
... | Hydrate a census object into a CensusEntity object
@param \stdClass $census
@return CensusEntity | [
"Hydrate",
"a",
"census",
"object",
"into",
"a",
"CensusEntity",
"object"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/CensusHydrator.php#L34-L55 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.getAllSites | public static function getAllSites(CNabuCustomer $nb_customer)
{
$nb_customer_id = nb_getMixedValue($nb_customer, 'nb_customer_id');
if (is_numeric($nb_customer_id)) {
$retval = forward_static_call(
array(get_called_class(), 'buildObjectListFromSQL'),
'nb_site_id',
'select * '
. 'from nb_site '
. 'where nb_customer_id=%cust_id$d',
array(
'cust_id' => $nb_customer_id
),
$nb_customer
);
} else {
$retval = new CNabuSiteList();
}
return $retval;
} | php | public static function getAllSites(CNabuCustomer $nb_customer)
{
$nb_customer_id = nb_getMixedValue($nb_customer, 'nb_customer_id');
if (is_numeric($nb_customer_id)) {
$retval = forward_static_call(
array(get_called_class(), 'buildObjectListFromSQL'),
'nb_site_id',
'select * '
. 'from nb_site '
. 'where nb_customer_id=%cust_id$d',
array(
'cust_id' => $nb_customer_id
),
$nb_customer
);
} else {
$retval = new CNabuSiteList();
}
return $retval;
} | [
"public",
"static",
"function",
"getAllSites",
"(",
"CNabuCustomer",
"$",
"nb_customer",
")",
"{",
"$",
"nb_customer_id",
"=",
"nb_getMixedValue",
"(",
"$",
"nb_customer",
",",
"'nb_customer_id'",
")",
";",
"if",
"(",
"is_numeric",
"(",
"$",
"nb_customer_id",
")... | Get all items in the storage as an associative array where the field 'nb_site_id' is the index, and each value
is an instance of class CNabuSiteBase.
@param CNabuCustomer $nb_customer The CNabuCustomer instance of the Customer that owns the Site List.
@return mixed Returns and array with all items. | [
"Get",
"all",
"items",
"in",
"the",
"storage",
"as",
"an",
"associative",
"array",
"where",
"the",
"field",
"nb_site_id",
"is",
"the",
"index",
"and",
"each",
"value",
"is",
"an",
"instance",
"of",
"class",
"CNabuSiteBase",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L185-L205 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setMountingOrder | public function setMountingOrder(int $mounting_order = 0) : CNabuDataObject
{
if ($mounting_order === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$mounting_order")
);
}
$this->setValue('nb_site_mounting_order', $mounting_order);
return $this;
} | php | public function setMountingOrder(int $mounting_order = 0) : CNabuDataObject
{
if ($mounting_order === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$mounting_order")
);
}
$this->setValue('nb_site_mounting_order', $mounting_order);
return $this;
} | [
"public",
"function",
"setMountingOrder",
"(",
"int",
"$",
"mounting_order",
"=",
"0",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"mounting_order",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ERROR_NULL... | Sets the Site Mounting Order attribute value.
@param int $mounting_order New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Mounting",
"Order",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L686-L697 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setPublished | public function setPublished(string $published = "F") : CNabuDataObject
{
if ($published === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$published")
);
}
$this->setValue('nb_site_published', $published);
return $this;
} | php | public function setPublished(string $published = "F") : CNabuDataObject
{
if ($published === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$published")
);
}
$this->setValue('nb_site_published', $published);
return $this;
} | [
"public",
"function",
"setPublished",
"(",
"string",
"$",
"published",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"published",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ERROR_NULL_VALUE_... | Sets the Site Published attribute value.
@param string $published New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Published",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L761-L772 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setPublicBasePathEnabled | public function setPublicBasePathEnabled(string $public_base_path_enabled = "F") : CNabuDataObject
{
if ($public_base_path_enabled === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$public_base_path_enabled")
);
}
$this->setValue('nb_site_public_base_path_enabled', $public_base_path_enabled);
return $this;
} | php | public function setPublicBasePathEnabled(string $public_base_path_enabled = "F") : CNabuDataObject
{
if ($public_base_path_enabled === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$public_base_path_enabled")
);
}
$this->setValue('nb_site_public_base_path_enabled', $public_base_path_enabled);
return $this;
} | [
"public",
"function",
"setPublicBasePathEnabled",
"(",
"string",
"$",
"public_base_path_enabled",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"public_base_path_enabled",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCo... | Sets the Site Public Base Path Enabled attribute value.
@param string $public_base_path_enabled New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Public",
"Base",
"Path",
"Enabled",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L788-L799 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setDefaultTargetUseURI | public function setDefaultTargetUseURI(string $default_target_use_uri = "N") : CNabuDataObject
{
if ($default_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$default_target_use_uri")
);
}
$this->setValue('nb_site_default_target_use_uri', $default_target_use_uri);
return $this;
} | php | public function setDefaultTargetUseURI(string $default_target_use_uri = "N") : CNabuDataObject
{
if ($default_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$default_target_use_uri")
);
}
$this->setValue('nb_site_default_target_use_uri', $default_target_use_uri);
return $this;
} | [
"public",
"function",
"setDefaultTargetUseURI",
"(",
"string",
"$",
"default_target_use_uri",
"=",
"\"N\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"default_target_use_uri",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreExce... | Sets the Site Default Target Use URI attribute value.
@param string $default_target_use_uri New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Default",
"Target",
"Use",
"URI",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L815-L826 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setDefaultErrorCode | public function setDefaultErrorCode(int $default_error_code = 301) : CNabuDataObject
{
if ($default_error_code === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$default_error_code")
);
}
$this->setValue('nb_site_default_error_code', $default_error_code);
return $this;
} | php | public function setDefaultErrorCode(int $default_error_code = 301) : CNabuDataObject
{
if ($default_error_code === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$default_error_code")
);
}
$this->setValue('nb_site_default_error_code', $default_error_code);
return $this;
} | [
"public",
"function",
"setDefaultErrorCode",
"(",
"int",
"$",
"default_error_code",
"=",
"301",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"default_error_code",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
... | Sets the Site Default Error Code attribute value.
@param int $default_error_code New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Default",
"Error",
"Code",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L863-L874 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setPageNotFoundTargetUseURI | public function setPageNotFoundTargetUseURI(string $page_not_found_target_use_uri = "N") : CNabuDataObject
{
if ($page_not_found_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$page_not_found_target_use_uri")
);
}
$this->setValue('nb_site_page_not_found_target_use_uri', $page_not_found_target_use_uri);
return $this;
} | php | public function setPageNotFoundTargetUseURI(string $page_not_found_target_use_uri = "N") : CNabuDataObject
{
if ($page_not_found_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$page_not_found_target_use_uri")
);
}
$this->setValue('nb_site_page_not_found_target_use_uri', $page_not_found_target_use_uri);
return $this;
} | [
"public",
"function",
"setPageNotFoundTargetUseURI",
"(",
"string",
"$",
"page_not_found_target_use_uri",
"=",
"\"N\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"page_not_found_target_use_uri",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(... | Sets the Site Page Not Found Target Use URI attribute value.
@param string $page_not_found_target_use_uri New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Page",
"Not",
"Found",
"Target",
"Use",
"URI",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L890-L901 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setPageNotFoundErrorCode | public function setPageNotFoundErrorCode(int $page_not_found_error_code = 404) : CNabuDataObject
{
if ($page_not_found_error_code === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$page_not_found_error_code")
);
}
$this->setValue('nb_site_page_not_found_error_code', $page_not_found_error_code);
return $this;
} | php | public function setPageNotFoundErrorCode(int $page_not_found_error_code = 404) : CNabuDataObject
{
if ($page_not_found_error_code === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$page_not_found_error_code")
);
}
$this->setValue('nb_site_page_not_found_error_code', $page_not_found_error_code);
return $this;
} | [
"public",
"function",
"setPageNotFoundErrorCode",
"(",
"int",
"$",
"page_not_found_error_code",
"=",
"404",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"page_not_found_error_code",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreE... | Sets the Site Page Not Found Error Code attribute value.
@param int $page_not_found_error_code New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Page",
"Not",
"Found",
"Error",
"Code",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L938-L949 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setLoginMaxFailsTargetUseURI | public function setLoginMaxFailsTargetUseURI(string $login_max_fails_target_use_uri = "N") : CNabuDataObject
{
if ($login_max_fails_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$login_max_fails_target_use_uri")
);
}
$this->setValue('nb_site_login_max_fails_target_use_uri', $login_max_fails_target_use_uri);
return $this;
} | php | public function setLoginMaxFailsTargetUseURI(string $login_max_fails_target_use_uri = "N") : CNabuDataObject
{
if ($login_max_fails_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$login_max_fails_target_use_uri")
);
}
$this->setValue('nb_site_login_max_fails_target_use_uri', $login_max_fails_target_use_uri);
return $this;
} | [
"public",
"function",
"setLoginMaxFailsTargetUseURI",
"(",
"string",
"$",
"login_max_fails_target_use_uri",
"=",
"\"N\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"login_max_fails_target_use_uri",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
... | Sets the Site Login Max Fails Target Use URI attribute value.
@param string $login_max_fails_target_use_uri New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Login",
"Max",
"Fails",
"Target",
"Use",
"URI",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1091-L1102 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setAliasNotFoundTargetUseURI | public function setAliasNotFoundTargetUseURI(string $alias_not_found_target_use_uri = "N") : CNabuDataObject
{
if ($alias_not_found_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$alias_not_found_target_use_uri")
);
}
$this->setValue('nb_site_alias_not_found_target_use_uri', $alias_not_found_target_use_uri);
return $this;
} | php | public function setAliasNotFoundTargetUseURI(string $alias_not_found_target_use_uri = "N") : CNabuDataObject
{
if ($alias_not_found_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$alias_not_found_target_use_uri")
);
}
$this->setValue('nb_site_alias_not_found_target_use_uri', $alias_not_found_target_use_uri);
return $this;
} | [
"public",
"function",
"setAliasNotFoundTargetUseURI",
"(",
"string",
"$",
"alias_not_found_target_use_uri",
"=",
"\"N\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"alias_not_found_target_use_uri",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
... | Sets the Site Alias Not Found Target Use URI attribute value.
@param string $alias_not_found_target_use_uri New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Alias",
"Not",
"Found",
"Target",
"Use",
"URI",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1160-L1171 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setAliasLockedTargetUseURI | public function setAliasLockedTargetUseURI(string $alias_locked_target_use_uri = "N") : CNabuDataObject
{
if ($alias_locked_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$alias_locked_target_use_uri")
);
}
$this->setValue('nb_site_alias_locked_target_use_uri', $alias_locked_target_use_uri);
return $this;
} | php | public function setAliasLockedTargetUseURI(string $alias_locked_target_use_uri = "N") : CNabuDataObject
{
if ($alias_locked_target_use_uri === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$alias_locked_target_use_uri")
);
}
$this->setValue('nb_site_alias_locked_target_use_uri', $alias_locked_target_use_uri);
return $this;
} | [
"public",
"function",
"setAliasLockedTargetUseURI",
"(",
"string",
"$",
"alias_locked_target_use_uri",
"=",
"\"N\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"alias_locked_target_use_uri",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
... | Sets the Site Alias Locked Target Use URI attribute value.
@param string $alias_locked_target_use_uri New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Alias",
"Locked",
"Target",
"Use",
"URI",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1208-L1219 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setRequirePoliciesAfterLogin | public function setRequirePoliciesAfterLogin(string $require_policies_after_login = "F") : CNabuDataObject
{
if ($require_policies_after_login === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$require_policies_after_login")
);
}
$this->setValue('nb_site_require_policies_after_login', $require_policies_after_login);
return $this;
} | php | public function setRequirePoliciesAfterLogin(string $require_policies_after_login = "F") : CNabuDataObject
{
if ($require_policies_after_login === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$require_policies_after_login")
);
}
$this->setValue('nb_site_require_policies_after_login', $require_policies_after_login);
return $this;
} | [
"public",
"function",
"setRequirePoliciesAfterLogin",
"(",
"string",
"$",
"require_policies_after_login",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"require_policies_after_login",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"("... | Sets the Site Require Policies After Login attribute value.
@param string $require_policies_after_login New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Require",
"Policies",
"After",
"Login",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1304-L1315 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setUseCache | public function setUseCache(string $use_cache = "F") : CNabuDataObject
{
if ($use_cache === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_cache")
);
}
$this->setValue('nb_site_use_cache', $use_cache);
return $this;
} | php | public function setUseCache(string $use_cache = "F") : CNabuDataObject
{
if ($use_cache === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_cache")
);
}
$this->setValue('nb_site_use_cache', $use_cache);
return $this;
} | [
"public",
"function",
"setUseCache",
"(",
"string",
"$",
"use_cache",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"use_cache",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ERROR_NULL_VALUE_N... | Sets the Site Use Cache attribute value.
@param string $use_cache New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Use",
"Cache",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1331-L1342 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setHTTPSupport | public function setHTTPSupport(string $http_support = "F") : CNabuDataObject
{
if ($http_support === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$http_support")
);
}
$this->setValue('nb_site_http_support', $http_support);
return $this;
} | php | public function setHTTPSupport(string $http_support = "F") : CNabuDataObject
{
if ($http_support === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$http_support")
);
}
$this->setValue('nb_site_http_support', $http_support);
return $this;
} | [
"public",
"function",
"setHTTPSupport",
"(",
"string",
"$",
"http_support",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"http_support",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ERROR_NUL... | Sets the Site HTTP Support attribute value.
@param string $http_support New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"HTTP",
"Support",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1568-L1579 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setHTTPSSupport | public function setHTTPSSupport(string $https_support = "F") : CNabuDataObject
{
if ($https_support === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$https_support")
);
}
$this->setValue('nb_site_https_support', $https_support);
return $this;
} | php | public function setHTTPSSupport(string $https_support = "F") : CNabuDataObject
{
if ($https_support === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$https_support")
);
}
$this->setValue('nb_site_https_support', $https_support);
return $this;
} | [
"public",
"function",
"setHTTPSSupport",
"(",
"string",
"$",
"https_support",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"https_support",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ERROR_... | Sets the Site HTTPS Support attribute value.
@param string $https_support New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"HTTPS",
"Support",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1595-L1606 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setUseAWStats | public function setUseAWStats(string $use_awstats = "F") : CNabuDataObject
{
if ($use_awstats === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_awstats")
);
}
$this->setValue('nb_site_use_awstats', $use_awstats);
return $this;
} | php | public function setUseAWStats(string $use_awstats = "F") : CNabuDataObject
{
if ($use_awstats === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_awstats")
);
}
$this->setValue('nb_site_use_awstats', $use_awstats);
return $this;
} | [
"public",
"function",
"setUseAWStats",
"(",
"string",
"$",
"use_awstats",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"use_awstats",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ERROR_NULL_V... | Sets the Site Use AWStats attribute value.
@param string $use_awstats New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Use",
"AWStats",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1664-L1675 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setWSearchEnabled | public function setWSearchEnabled(string $wsearch_enabled = "F") : CNabuDataObject
{
if ($wsearch_enabled === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$wsearch_enabled")
);
}
$this->setValue('nb_site_wsearch_enabled', $wsearch_enabled);
return $this;
} | php | public function setWSearchEnabled(string $wsearch_enabled = "F") : CNabuDataObject
{
if ($wsearch_enabled === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$wsearch_enabled")
);
}
$this->setValue('nb_site_wsearch_enabled', $wsearch_enabled);
return $this;
} | [
"public",
"function",
"setWSearchEnabled",
"(",
"string",
"$",
"wsearch_enabled",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"wsearch_enabled",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"... | Sets the Site WSearch Enabled attribute value.
@param string $wsearch_enabled New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"WSearch",
"Enabled",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1907-L1918 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setUseFramework | public function setUseFramework(string $use_framework = "F") : CNabuDataObject
{
if ($use_framework === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_framework")
);
}
$this->setValue('nb_site_use_framework', $use_framework);
return $this;
} | php | public function setUseFramework(string $use_framework = "F") : CNabuDataObject
{
if ($use_framework === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$use_framework")
);
}
$this->setValue('nb_site_use_framework', $use_framework);
return $this;
} | [
"public",
"function",
"setUseFramework",
"(",
"string",
"$",
"use_framework",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"use_framework",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ERROR_... | Sets the Site Use Framework attribute value.
@param string $use_framework New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Use",
"Framework",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1934-L1945 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setEnableVirtualHostFile | public function setEnableVirtualHostFile(string $enable_vhost_file = "F") : CNabuDataObject
{
if ($enable_vhost_file === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$enable_vhost_file")
);
}
$this->setValue('nb_site_enable_vhost_file', $enable_vhost_file);
return $this;
} | php | public function setEnableVirtualHostFile(string $enable_vhost_file = "F") : CNabuDataObject
{
if ($enable_vhost_file === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$enable_vhost_file")
);
}
$this->setValue('nb_site_enable_vhost_file', $enable_vhost_file);
return $this;
} | [
"public",
"function",
"setEnableVirtualHostFile",
"(",
"string",
"$",
"enable_vhost_file",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"enable_vhost_file",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
... | Sets the Site Enable VirtualHost File attribute value.
@param string $enable_vhost_file New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Enable",
"VirtualHost",
"File",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L1961-L1972 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setEnableSessionStrictPolicies | public function setEnableSessionStrictPolicies(string $enable_session_strict_policies = "F") : CNabuDataObject
{
if ($enable_session_strict_policies === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$enable_session_strict_policies")
);
}
$this->setValue('nb_site_enable_session_strict_policies', $enable_session_strict_policies);
return $this;
} | php | public function setEnableSessionStrictPolicies(string $enable_session_strict_policies = "F") : CNabuDataObject
{
if ($enable_session_strict_policies === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$enable_session_strict_policies")
);
}
$this->setValue('nb_site_enable_session_strict_policies', $enable_session_strict_policies);
return $this;
} | [
"public",
"function",
"setEnableSessionStrictPolicies",
"(",
"string",
"$",
"enable_session_strict_policies",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"enable_session_strict_policies",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",... | Sets the Site Enable Session Strict Policies attribute value.
@param string $enable_session_strict_policies New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Enable",
"Session",
"Strict",
"Policies",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L2030-L2041 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setStaticContentUseAlternative | public function setStaticContentUseAlternative(string $static_content_use_alternative = "D") : CNabuDataObject
{
if ($static_content_use_alternative === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$static_content_use_alternative")
);
}
$this->setValue('nb_site_static_content_use_alternative', $static_content_use_alternative);
return $this;
} | php | public function setStaticContentUseAlternative(string $static_content_use_alternative = "D") : CNabuDataObject
{
if ($static_content_use_alternative === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$static_content_use_alternative")
);
}
$this->setValue('nb_site_static_content_use_alternative', $static_content_use_alternative);
return $this;
} | [
"public",
"function",
"setStaticContentUseAlternative",
"(",
"string",
"$",
"static_content_use_alternative",
"=",
"\"D\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"static_content_use_alternative",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",... | Sets the Site Static Content Use Alternative attribute value.
@param string $static_content_use_alternative New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Static",
"Content",
"Use",
"Alternative",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L2057-L2068 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setForceCookieAsSecure | public function setForceCookieAsSecure(string $force_cookie_as_secure = "F") : CNabuDataObject
{
if ($force_cookie_as_secure === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$force_cookie_as_secure")
);
}
$this->setValue('nb_site_force_cookie_as_secure', $force_cookie_as_secure);
return $this;
} | php | public function setForceCookieAsSecure(string $force_cookie_as_secure = "F") : CNabuDataObject
{
if ($force_cookie_as_secure === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$force_cookie_as_secure")
);
}
$this->setValue('nb_site_force_cookie_as_secure', $force_cookie_as_secure);
return $this;
} | [
"public",
"function",
"setForceCookieAsSecure",
"(",
"string",
"$",
"force_cookie_as_secure",
"=",
"\"F\"",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"force_cookie_as_secure",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreExce... | Sets the Site Force Cookie As Secure attribute value.
@param string $force_cookie_as_secure New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Force",
"Cookie",
"As",
"Secure",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L2189-L2200 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setMaxSignInRetries | public function setMaxSignInRetries(int $max_signin_retries = 0) : CNabuDataObject
{
if ($max_signin_retries === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$max_signin_retries")
);
}
$this->setValue('nb_site_max_signin_retries', $max_signin_retries);
return $this;
} | php | public function setMaxSignInRetries(int $max_signin_retries = 0) : CNabuDataObject
{
if ($max_signin_retries === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$max_signin_retries")
);
}
$this->setValue('nb_site_max_signin_retries', $max_signin_retries);
return $this;
} | [
"public",
"function",
"setMaxSignInRetries",
"(",
"int",
"$",
"max_signin_retries",
"=",
"0",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"max_signin_retries",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
... | Sets the Site Max SignIn Retries attribute value.
@param int $max_signin_retries New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"Max",
"SignIn",
"Retries",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L2216-L2227 | train |
nabu-3/core | nabu/data/site/base/CNabuSiteBase.php | CNabuSiteBase.setSignInLockDelay | public function setSignInLockDelay(int $signin_lock_delay = 0) : CNabuDataObject
{
if ($signin_lock_delay === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$signin_lock_delay")
);
}
$this->setValue('nb_site_signin_lock_delay', $signin_lock_delay);
return $this;
} | php | public function setSignInLockDelay(int $signin_lock_delay = 0) : CNabuDataObject
{
if ($signin_lock_delay === null) {
throw new ENabuCoreException(
ENabuCoreException::ERROR_NULL_VALUE_NOT_ALLOWED_IN,
array("\$signin_lock_delay")
);
}
$this->setValue('nb_site_signin_lock_delay', $signin_lock_delay);
return $this;
} | [
"public",
"function",
"setSignInLockDelay",
"(",
"int",
"$",
"signin_lock_delay",
"=",
"0",
")",
":",
"CNabuDataObject",
"{",
"if",
"(",
"$",
"signin_lock_delay",
"===",
"null",
")",
"{",
"throw",
"new",
"ENabuCoreException",
"(",
"ENabuCoreException",
"::",
"ER... | Sets the Site SignIn Lock Delay attribute value.
@param int $signin_lock_delay New value for attribute
@return CNabuDataObject Returns self instance to grant chained setters call. | [
"Sets",
"the",
"Site",
"SignIn",
"Lock",
"Delay",
"attribute",
"value",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/site/base/CNabuSiteBase.php#L2243-L2254 | train |
rips/php-connector-bundle | Hydrators/StatusHydrator.php | StatusHydrator.hydrate | public static function hydrate(stdClass $status)
{
$hydrated = new StatusEntity();
if (isset($status->version)) {
$hydrated->setVersion($status->version);
}
if (isset($status->cloud)) {
$hydrated->setCloud($status->cloud);
}
if (isset($status->maintenance)) {
$hydrated->setMaintenance($status->maintenance);
}
if (isset($status->hardware_id)) {
$hydrated->setHardwareId($status->hardware_id);
}
if (isset($status->census)) {
$hydrated->setCensus(CensusHydrator::hydrate($status->census));
}
if (isset($status->trial_issue_types) && is_array($status->trial_issue_types)) {
$hydrated->setTrialIssueTypes(TypeHydrator::hydrateCollection($status->trial_issue_types));
}
if (isset($status->user)) {
$hydrated->setUser(UserHydrator::hydrate($status->user));
}
if (isset($status->organization)) {
$hydrated->setOrganization(OrgHydrator::hydrate($status->organization));
}
return $hydrated;
} | php | public static function hydrate(stdClass $status)
{
$hydrated = new StatusEntity();
if (isset($status->version)) {
$hydrated->setVersion($status->version);
}
if (isset($status->cloud)) {
$hydrated->setCloud($status->cloud);
}
if (isset($status->maintenance)) {
$hydrated->setMaintenance($status->maintenance);
}
if (isset($status->hardware_id)) {
$hydrated->setHardwareId($status->hardware_id);
}
if (isset($status->census)) {
$hydrated->setCensus(CensusHydrator::hydrate($status->census));
}
if (isset($status->trial_issue_types) && is_array($status->trial_issue_types)) {
$hydrated->setTrialIssueTypes(TypeHydrator::hydrateCollection($status->trial_issue_types));
}
if (isset($status->user)) {
$hydrated->setUser(UserHydrator::hydrate($status->user));
}
if (isset($status->organization)) {
$hydrated->setOrganization(OrgHydrator::hydrate($status->organization));
}
return $hydrated;
} | [
"public",
"static",
"function",
"hydrate",
"(",
"stdClass",
"$",
"status",
")",
"{",
"$",
"hydrated",
"=",
"new",
"StatusEntity",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"status",
"->",
"version",
")",
")",
"{",
"$",
"hydrated",
"->",
"setVersion"... | Hydrate a status object into a StatusEntity
@param \stdClass $status
@return StatusEntity | [
"Hydrate",
"a",
"status",
"object",
"into",
"a",
"StatusEntity"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Hydrators/StatusHydrator.php#L17-L54 | train |
nabu-3/core | nabu/xml/site/base/CNabuXMLSiteTargetLanguageListBase.php | CNabuXMLSiteTargetLanguageListBase.locateDataObject | protected function locateDataObject(SimpleXMLElement $element, CNabuDataObject $data_parent = null) : bool
{
$retval = false;
if (isset($element['GUID'])) {
$guid = (string)$element['GUID'];
if (!($this->nb_data_object instanceof CNabuSiteTargetLanguageList)) {
$this->nb_data_object = CNabuSiteTargetLanguageList::findByHash($guid);
} else {
$this->nb_data_object = null;
}
if (!($this->nb_data_object instanceof CNabuSiteTargetLanguageList)) {
$this->nb_data_object = new CNabuSiteTargetLanguageList();
$this->nb_data_object->setHash($guid);
}
$retval = true;
}
return $retval;
} | php | protected function locateDataObject(SimpleXMLElement $element, CNabuDataObject $data_parent = null) : bool
{
$retval = false;
if (isset($element['GUID'])) {
$guid = (string)$element['GUID'];
if (!($this->nb_data_object instanceof CNabuSiteTargetLanguageList)) {
$this->nb_data_object = CNabuSiteTargetLanguageList::findByHash($guid);
} else {
$this->nb_data_object = null;
}
if (!($this->nb_data_object instanceof CNabuSiteTargetLanguageList)) {
$this->nb_data_object = new CNabuSiteTargetLanguageList();
$this->nb_data_object->setHash($guid);
}
$retval = true;
}
return $retval;
} | [
"protected",
"function",
"locateDataObject",
"(",
"SimpleXMLElement",
"$",
"element",
",",
"CNabuDataObject",
"$",
"data_parent",
"=",
"null",
")",
":",
"bool",
"{",
"$",
"retval",
"=",
"false",
";",
"if",
"(",
"isset",
"(",
"$",
"element",
"[",
"'GUID'",
... | Locate a Data Object.
@param SimpleXMLElement $element Element to locate the Data Object.
@param CNabuDataObject $data_parent Data Parent object.
@return bool Returns true if the Data Object found or false if not. | [
"Locate",
"a",
"Data",
"Object",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/xml/site/base/CNabuXMLSiteTargetLanguageListBase.php#L70-L90 | train |
nabu-3/core | nabu/core/CNabuOS.php | CNabuOS.getOS | public static function getOS()
{
if (self::$nb_os === null) {
self::$nb_os = new CNabuOS();
self::$nb_os->init();
}
return self::$nb_os;
} | php | public static function getOS()
{
if (self::$nb_os === null) {
self::$nb_os = new CNabuOS();
self::$nb_os->init();
}
return self::$nb_os;
} | [
"public",
"static",
"function",
"getOS",
"(",
")",
"{",
"if",
"(",
"self",
"::",
"$",
"nb_os",
"===",
"null",
")",
"{",
"self",
"::",
"$",
"nb_os",
"=",
"new",
"CNabuOS",
"(",
")",
";",
"self",
"::",
"$",
"nb_os",
"->",
"init",
"(",
")",
";",
"... | Get the singleton instance of CNabuOS.
@return CNabuOS Returns the singleton instance of CNabuOS | [
"Get",
"the",
"singleton",
"instance",
"of",
"CNabuOS",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuOS.php#L83-L91 | train |
nabu-3/core | nabu/core/CNabuOS.php | CNabuOS.init | private function init()
{
$this->os_name = php_uname('s');
$this->os_version = php_uname('r');
$this->os_architecture = php_uname('m');
$this->php_version = preg_split('/\\./', phpversion());
} | php | private function init()
{
$this->os_name = php_uname('s');
$this->os_version = php_uname('r');
$this->os_architecture = php_uname('m');
$this->php_version = preg_split('/\\./', phpversion());
} | [
"private",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"os_name",
"=",
"php_uname",
"(",
"'s'",
")",
";",
"$",
"this",
"->",
"os_version",
"=",
"php_uname",
"(",
"'r'",
")",
";",
"$",
"this",
"->",
"os_architecture",
"=",
"php_uname",
"(",
... | Initiates the singleton instance and gater the OS information. | [
"Initiates",
"the",
"singleton",
"instance",
"and",
"gater",
"the",
"OS",
"information",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/core/CNabuOS.php#L105-L111 | train |
danslo/CleanCheckoutGeo | src/Helper/Directory/Data.php | Data.getDefaultCountry | public function getDefaultCountry($store = null)
{
/**
* null = not cached
* false = couldn't get country from IP
*/
if ($store === null && $this->country === null) {
$country = $this->geoService->getCountry();
$this->country = $country !== null ? $country : false;
}
return $this->country ? $this->country : parent::getDefaultCountry($store);
} | php | public function getDefaultCountry($store = null)
{
/**
* null = not cached
* false = couldn't get country from IP
*/
if ($store === null && $this->country === null) {
$country = $this->geoService->getCountry();
$this->country = $country !== null ? $country : false;
}
return $this->country ? $this->country : parent::getDefaultCountry($store);
} | [
"public",
"function",
"getDefaultCountry",
"(",
"$",
"store",
"=",
"null",
")",
"{",
"/**\n * null = not cached\n * false = couldn't get country from IP\n */",
"if",
"(",
"$",
"store",
"===",
"null",
"&&",
"$",
"this",
"->",
"country",
"===",
"n... | We prefer not to use a preference for this, but we're not allowed to create a plugin
for Magento\Directory\Helper\Data because it's a virtual type.
We also can't use a plugin on Magento\Checkout\Block\Checkout\AttributeMerger::getDefaultValue because
it's protected, also it would miss a couple of other getDefaultCountry() calls.
@param int|null $store
@return string | [
"We",
"prefer",
"not",
"to",
"use",
"a",
"preference",
"for",
"this",
"but",
"we",
"re",
"not",
"allowed",
"to",
"create",
"a",
"plugin",
"for",
"Magento",
"\\",
"Directory",
"\\",
"Helper",
"\\",
"Data",
"because",
"it",
"s",
"a",
"virtual",
"type",
"... | 786553f29577ab139e0d1df96192dfc31e42d0fb | https://github.com/danslo/CleanCheckoutGeo/blob/786553f29577ab139e0d1df96192dfc31e42d0fb/src/Helper/Directory/Data.php#L71-L82 | train |
xtlsoft/NonDB | src/Table.php | Table.sync | public function sync(){
$this->data = $this->parent->driver->getData($this->name);
return $this;
} | php | public function sync(){
$this->data = $this->parent->driver->getData($this->name);
return $this;
} | [
"public",
"function",
"sync",
"(",
")",
"{",
"$",
"this",
"->",
"data",
"=",
"$",
"this",
"->",
"parent",
"->",
"driver",
"->",
"getData",
"(",
"$",
"this",
"->",
"name",
")",
";",
"return",
"$",
"this",
";",
"}"
] | Sync the data
@return self | [
"Sync",
"the",
"data"
] | 6599c13bb5feabe77d91764fdf3c24b786c777b2 | https://github.com/xtlsoft/NonDB/blob/6599c13bb5feabe77d91764fdf3c24b786c777b2/src/Table.php#L61-L67 | train |
xtlsoft/NonDB | src/Table.php | Table.autoincrement | function autoincrement(){
if(!isset($this->data['_NonDB_System_']['_AutoIncrement_'])){
$this->data['_NonDB_System_']['_AutoIncrement_'] = 1;
}
$number = ($this->data['_NonDB_System_']['_AutoIncrement_'] ++);
$this->save();
return $number;
} | php | function autoincrement(){
if(!isset($this->data['_NonDB_System_']['_AutoIncrement_'])){
$this->data['_NonDB_System_']['_AutoIncrement_'] = 1;
}
$number = ($this->data['_NonDB_System_']['_AutoIncrement_'] ++);
$this->save();
return $number;
} | [
"function",
"autoincrement",
"(",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"data",
"[",
"'_NonDB_System_'",
"]",
"[",
"'_AutoIncrement_'",
"]",
")",
")",
"{",
"$",
"this",
"->",
"data",
"[",
"'_NonDB_System_'",
"]",
"[",
"'_AutoIncremen... | Get Auto-Increment Number
@return int | [
"Get",
"Auto",
"-",
"Increment",
"Number"
] | 6599c13bb5feabe77d91764fdf3c24b786c777b2 | https://github.com/xtlsoft/NonDB/blob/6599c13bb5feabe77d91764fdf3c24b786c777b2/src/Table.php#L89-L100 | train |
nabu-3/core | nabu/http/CNabuHTTPRequest.php | CNabuHTTPRequest.init | private function init()
{
$this->nb_response = new CNabuHTTPResponse($this->nb_plugins_manager, $this);
$this->nb_site = null;
$this->nb_site_alias = null;
$this->nb_site_target = null;
$this->nb_language = null;
$this->user_remote_ip = null;
$this->user_agent = null;
$this->accept_mimetypes = null;
$this->accept_languages = null;
$this->method = null;
$this->secure = false;
$this->zone = null;
$this->page_uri = null;
$this->variables = array();
// This block is intended for XDR IE8 & IE9 compatibility
/*
if (count($_POST) === 0) {
if (isset($HTTP_RAW_POST_DATA)) {
parse_str($HTTP_RAW_POST_DATA, $this->xdr_post);
} else {
parse_str(file_get_contents('php://input'), $this->xdr_post);
}
}
*/
} | php | private function init()
{
$this->nb_response = new CNabuHTTPResponse($this->nb_plugins_manager, $this);
$this->nb_site = null;
$this->nb_site_alias = null;
$this->nb_site_target = null;
$this->nb_language = null;
$this->user_remote_ip = null;
$this->user_agent = null;
$this->accept_mimetypes = null;
$this->accept_languages = null;
$this->method = null;
$this->secure = false;
$this->zone = null;
$this->page_uri = null;
$this->variables = array();
// This block is intended for XDR IE8 & IE9 compatibility
/*
if (count($_POST) === 0) {
if (isset($HTTP_RAW_POST_DATA)) {
parse_str($HTTP_RAW_POST_DATA, $this->xdr_post);
} else {
parse_str(file_get_contents('php://input'), $this->xdr_post);
}
}
*/
} | [
"private",
"function",
"init",
"(",
")",
"{",
"$",
"this",
"->",
"nb_response",
"=",
"new",
"CNabuHTTPResponse",
"(",
"$",
"this",
"->",
"nb_plugins_manager",
",",
"$",
"this",
")",
";",
"$",
"this",
"->",
"nb_site",
"=",
"null",
";",
"$",
"this",
"->"... | Initializes the instance.
Reset all internal variables to init values. | [
"Initializes",
"the",
"instance",
".",
"Reset",
"all",
"internal",
"variables",
"to",
"init",
"values",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/http/CNabuHTTPRequest.php#L213-L245 | train |
nabu-3/core | nabu/http/CNabuHTTPRequest.php | CNabuHTTPRequest.locateURI | private function locateURI() : string
{
$this->page_uri = filter_input(
INPUT_GET,
NABU_PATH_PARAM,
FILTER_SANITIZE_STRING,
FILTER_FLAG_EMPTY_STRING_NULL
);
if (!is_string($this->page_uri) || strlen($this->page_uri) === 0) {
$this->page_uri = $this->nb_application->getHTTPServer()->getRequestURI();
}
if (!is_string($this->page_uri) || strlen($this->page_uri) === 0) {
throw new ENabuCoreException(ENabuCoreException::ERROR_PAGE_URI_NOT_FOUND);
}
CNabuEngine::getEngine()->traceLog("Page requested", $this->page_uri);
return $this->page_uri;
} | php | private function locateURI() : string
{
$this->page_uri = filter_input(
INPUT_GET,
NABU_PATH_PARAM,
FILTER_SANITIZE_STRING,
FILTER_FLAG_EMPTY_STRING_NULL
);
if (!is_string($this->page_uri) || strlen($this->page_uri) === 0) {
$this->page_uri = $this->nb_application->getHTTPServer()->getRequestURI();
}
if (!is_string($this->page_uri) || strlen($this->page_uri) === 0) {
throw new ENabuCoreException(ENabuCoreException::ERROR_PAGE_URI_NOT_FOUND);
}
CNabuEngine::getEngine()->traceLog("Page requested", $this->page_uri);
return $this->page_uri;
} | [
"private",
"function",
"locateURI",
"(",
")",
":",
"string",
"{",
"$",
"this",
"->",
"page_uri",
"=",
"filter_input",
"(",
"INPUT_GET",
",",
"NABU_PATH_PARAM",
",",
"FILTER_SANITIZE_STRING",
",",
"FILTER_FLAG_EMPTY_STRING_NULL",
")",
";",
"if",
"(",
"!",
"is_str... | Search requested URIs using different alternatives.
@return string Returns the URI string if found or null elsewhere.
@throws ENabuCoreException Raises an exception if no URI found. | [
"Search",
"requested",
"URIs",
"using",
"different",
"alternatives",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/http/CNabuHTTPRequest.php#L575-L595 | train |
nabu-3/core | nabu/http/CNabuHTTPRequest.php | CNabuHTTPRequest.getCombinedPostIndexes | public function getCombinedPostIndexes(array $fields = null)
{
if ($fields === null) {
$fields = $this->getPOSTFieldNames();
}
$keys = array();
if (count($fields) > 0) {
if (is_array($this->xdr_post)) {
foreach ($fields as $field) {
if (array_key_exists($field, $this->xdr_post) && is_array($this->xdr_post[$field])) {
$keys = array_merge($keys, array_keys($this->xdr_post[$field]));
}
}
} elseif (is_array($_POST)) {
foreach ($fields as $field) {
if (array_key_exists($field, $_POST) && is_array($_POST[$field])) {
$keys = array_merge($keys, array_keys($_POST[$field]));
}
}
}
$keys = array_unique($keys);
}
return count($keys) > 0 ? $keys : null;
} | php | public function getCombinedPostIndexes(array $fields = null)
{
if ($fields === null) {
$fields = $this->getPOSTFieldNames();
}
$keys = array();
if (count($fields) > 0) {
if (is_array($this->xdr_post)) {
foreach ($fields as $field) {
if (array_key_exists($field, $this->xdr_post) && is_array($this->xdr_post[$field])) {
$keys = array_merge($keys, array_keys($this->xdr_post[$field]));
}
}
} elseif (is_array($_POST)) {
foreach ($fields as $field) {
if (array_key_exists($field, $_POST) && is_array($_POST[$field])) {
$keys = array_merge($keys, array_keys($_POST[$field]));
}
}
}
$keys = array_unique($keys);
}
return count($keys) > 0 ? $keys : null;
} | [
"public",
"function",
"getCombinedPostIndexes",
"(",
"array",
"$",
"fields",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"fields",
"===",
"null",
")",
"{",
"$",
"fields",
"=",
"$",
"this",
"->",
"getPOSTFieldNames",
"(",
")",
";",
"}",
"$",
"keys",
"=",
"... | Get all index key values of parameters containing arrays.
@param array|null $fields List of fields to be observed. If empty (null) then scan all fields.
@return array Returns an array containing all available fields without duplicates or null if none index is found. | [
"Get",
"all",
"index",
"key",
"values",
"of",
"parameters",
"containing",
"arrays",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/http/CNabuHTTPRequest.php#L942-L968 | train |
markusjwetzel/laravel-datamapper | src/Schema/Builder.php | Builder.create | public function create(array $metadata)
{
$schema = $this->getSchemaFromMetadata($metadata);
$statements = $schema->toSql($this->platform);
$this->build($statements);
return $statements;
} | php | public function create(array $metadata)
{
$schema = $this->getSchemaFromMetadata($metadata);
$statements = $schema->toSql($this->platform);
$this->build($statements);
return $statements;
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"metadata",
")",
"{",
"$",
"schema",
"=",
"$",
"this",
"->",
"getSchemaFromMetadata",
"(",
"$",
"metadata",
")",
";",
"$",
"statements",
"=",
"$",
"schema",
"->",
"toSql",
"(",
"$",
"this",
"->",
"plat... | Create all tables.
@param array $metadata
@return array | [
"Create",
"all",
"tables",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Schema/Builder.php#L74-L83 | train |
markusjwetzel/laravel-datamapper | src/Schema/Builder.php | Builder.update | public function update(array $metadata, $saveMode=false)
{
$fromSchema = $this->schemaManager->createSchema();
$toSchema = $this->getSchemaFromMetadata($metadata);
$comparator = new Comparator;
$schemaDiff = $comparator->compare($fromSchema, $toSchema);
if ($saveMode) {
$statements = $schemaDiff->toSaveSql($this->platform);
} else {
$statements = $schemaDiff->toSql($this->platform);
}
$this->build($statements);
return $statements;
} | php | public function update(array $metadata, $saveMode=false)
{
$fromSchema = $this->schemaManager->createSchema();
$toSchema = $this->getSchemaFromMetadata($metadata);
$comparator = new Comparator;
$schemaDiff = $comparator->compare($fromSchema, $toSchema);
if ($saveMode) {
$statements = $schemaDiff->toSaveSql($this->platform);
} else {
$statements = $schemaDiff->toSql($this->platform);
}
$this->build($statements);
return $statements;
} | [
"public",
"function",
"update",
"(",
"array",
"$",
"metadata",
",",
"$",
"saveMode",
"=",
"false",
")",
"{",
"$",
"fromSchema",
"=",
"$",
"this",
"->",
"schemaManager",
"->",
"createSchema",
"(",
")",
";",
"$",
"toSchema",
"=",
"$",
"this",
"->",
"getS... | Update all tables.
@param array $metadata
@param boolean $saveMode
@return array | [
"Update",
"all",
"tables",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Schema/Builder.php#L92-L109 | train |
markusjwetzel/laravel-datamapper | src/Schema/Builder.php | Builder.drop | public function drop(array $metadata)
{
$visitor = new DropSchemaSqlCollector($this->platform);
$schema = $this->getSchemaFromMetadata($metadata);
$fullSchema = $this->schemaManager->createSchema();
foreach ($fullSchema->getTables() as $table) {
if ($schema->hasTable($table->getName())) {
$visitor->acceptTable($table);
}
}
$statements = $visitor->getQueries();
$this->build($statements);
return $statements;
} | php | public function drop(array $metadata)
{
$visitor = new DropSchemaSqlCollector($this->platform);
$schema = $this->getSchemaFromMetadata($metadata);
$fullSchema = $this->schemaManager->createSchema();
foreach ($fullSchema->getTables() as $table) {
if ($schema->hasTable($table->getName())) {
$visitor->acceptTable($table);
}
}
$statements = $visitor->getQueries();
$this->build($statements);
return $statements;
} | [
"public",
"function",
"drop",
"(",
"array",
"$",
"metadata",
")",
"{",
"$",
"visitor",
"=",
"new",
"DropSchemaSqlCollector",
"(",
"$",
"this",
"->",
"platform",
")",
";",
"$",
"schema",
"=",
"$",
"this",
"->",
"getSchemaFromMetadata",
"(",
"$",
"metadata",... | Drop all tables.
@param array $metadata
@return array | [
"Drop",
"all",
"tables",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Schema/Builder.php#L117-L136 | train |
markusjwetzel/laravel-datamapper | src/Schema/Builder.php | Builder.getSchemaFromMetadata | public function getSchemaFromMetadata(array $metadata)
{
$entityMetadataSchemaConfig = $this->schemaManager->createSchemaConfig();
$schema = new Schema([], [], $entityMetadataSchemaConfig);
$pivotTables = [];
foreach ($metadata as $entityMetadata) {
$this->generateTableFromMetadata($schema, $entityMetadata['table']);
// create version table
if (! empty($entityMetadata['versionTable'])) {
$this->generateTableFromMetadata($schema, $entityMetadata['versionTable']);
}
foreach ($entityMetadata['relations'] as $relationMetadata) {
if (! empty($relationMetadata['pivotTable'])) {
// create pivot table for many to many relations
if (! in_array($relationMetadata['pivotTable']['name'], $pivotTables)) {
$this->generateTableFromMetadata($schema, $relationMetadata['pivotTable']);
}
$pivotTables[] = $relationMetadata['pivotTable']['name'];
}
}
}
return $schema;
} | php | public function getSchemaFromMetadata(array $metadata)
{
$entityMetadataSchemaConfig = $this->schemaManager->createSchemaConfig();
$schema = new Schema([], [], $entityMetadataSchemaConfig);
$pivotTables = [];
foreach ($metadata as $entityMetadata) {
$this->generateTableFromMetadata($schema, $entityMetadata['table']);
// create version table
if (! empty($entityMetadata['versionTable'])) {
$this->generateTableFromMetadata($schema, $entityMetadata['versionTable']);
}
foreach ($entityMetadata['relations'] as $relationMetadata) {
if (! empty($relationMetadata['pivotTable'])) {
// create pivot table for many to many relations
if (! in_array($relationMetadata['pivotTable']['name'], $pivotTables)) {
$this->generateTableFromMetadata($schema, $relationMetadata['pivotTable']);
}
$pivotTables[] = $relationMetadata['pivotTable']['name'];
}
}
}
return $schema;
} | [
"public",
"function",
"getSchemaFromMetadata",
"(",
"array",
"$",
"metadata",
")",
"{",
"$",
"entityMetadataSchemaConfig",
"=",
"$",
"this",
"->",
"schemaManager",
"->",
"createSchemaConfig",
"(",
")",
";",
"$",
"schema",
"=",
"new",
"Schema",
"(",
"[",
"]",
... | Create schema instance from metadata
@param array $metadata
@return \Doctrine\DBAL\Schema\Schema | [
"Create",
"schema",
"instance",
"from",
"metadata"
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Schema/Builder.php#L157-L183 | train |
markusjwetzel/laravel-datamapper | src/Schema/Builder.php | Builder.generateTableFromMetadata | protected function generateTableFromMetadata($schema, TableDefinition $tableMetadata)
{
$primaryKeys = [];
$uniqueIndexes = [];
$indexes = [];
$table = $schema->createTable($this->connection->getTablePrefix().$tableMetadata['name']);
foreach ($tableMetadata['columns'] as $columnMetadata) {
$columnMetadata = $this->getDoctrineColumnAliases($columnMetadata);
// add column
$options = $this->getDoctrineColumnOptions($columnMetadata);
$table->addColumn($columnMetadata['name'], $columnMetadata['type'], $options);
// add primary keys, unique indexes and indexes
if (! empty($columnMetadata['primary'])) {
$primaryKeys[] = $columnMetadata['name'];
}
if (! empty($columnMetadata['unique'])) {
$uniqueIndexes[] = $columnMetadata['name'];
}
if (! empty($columnMetadata['index'])) {
$indexes[] = $columnMetadata['name'];
}
}
// add primary keys, unique indexes and indexes
if (! empty($primaryKeys)) {
$table->setPrimaryKey($primaryKeys);
}
if (! empty($uniqueIndexes)) {
$table->addUniqueIndex($uniqueIndexes);
}
if (! empty($indexes)) {
$table->addIndex($indexes);
}
} | php | protected function generateTableFromMetadata($schema, TableDefinition $tableMetadata)
{
$primaryKeys = [];
$uniqueIndexes = [];
$indexes = [];
$table = $schema->createTable($this->connection->getTablePrefix().$tableMetadata['name']);
foreach ($tableMetadata['columns'] as $columnMetadata) {
$columnMetadata = $this->getDoctrineColumnAliases($columnMetadata);
// add column
$options = $this->getDoctrineColumnOptions($columnMetadata);
$table->addColumn($columnMetadata['name'], $columnMetadata['type'], $options);
// add primary keys, unique indexes and indexes
if (! empty($columnMetadata['primary'])) {
$primaryKeys[] = $columnMetadata['name'];
}
if (! empty($columnMetadata['unique'])) {
$uniqueIndexes[] = $columnMetadata['name'];
}
if (! empty($columnMetadata['index'])) {
$indexes[] = $columnMetadata['name'];
}
}
// add primary keys, unique indexes and indexes
if (! empty($primaryKeys)) {
$table->setPrimaryKey($primaryKeys);
}
if (! empty($uniqueIndexes)) {
$table->addUniqueIndex($uniqueIndexes);
}
if (! empty($indexes)) {
$table->addIndex($indexes);
}
} | [
"protected",
"function",
"generateTableFromMetadata",
"(",
"$",
"schema",
",",
"TableDefinition",
"$",
"tableMetadata",
")",
"{",
"$",
"primaryKeys",
"=",
"[",
"]",
";",
"$",
"uniqueIndexes",
"=",
"[",
"]",
";",
"$",
"indexes",
"=",
"[",
"]",
";",
"$",
"... | Generate a table from metadata.
@param table \Doctrine\DBAL\Schema\Schema
@param \ProAI\Datamapper\Metadata\Definitions\Table $tableMetadata
@return void | [
"Generate",
"a",
"table",
"from",
"metadata",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Schema/Builder.php#L192-L229 | train |
markusjwetzel/laravel-datamapper | src/Schema/Builder.php | Builder.getDoctrineColumnOptions | protected function getDoctrineColumnOptions(ColumnDefinition $columnMetadata)
{
$options = $columnMetadata['options'];
// alias for nullable option
if (! empty($columnMetadata['nullable'])) {
$options['notnull'] = ! $columnMetadata['nullable'];
}
// alias for default option
if (! empty($columnMetadata['default'])) {
$options['default'] = $columnMetadata['default'];
}
// alias for unsigned option
if (! empty($columnMetadata['options']['unsigned'])) {
$options['unsigned'] = $columnMetadata['options']['unsigned'];
}
// alias for autoincrement option
if (! empty($columnMetadata['options']['autoIncrement'])) {
$options['autoincrement'] = $columnMetadata['options']['autoIncrement'];
}
// alias for fixed option
if (! empty($columnMetadata['options']['fixed'])) {
$options['fixed'] = $columnMetadata['options']['fixed'];
}
return $options;
} | php | protected function getDoctrineColumnOptions(ColumnDefinition $columnMetadata)
{
$options = $columnMetadata['options'];
// alias for nullable option
if (! empty($columnMetadata['nullable'])) {
$options['notnull'] = ! $columnMetadata['nullable'];
}
// alias for default option
if (! empty($columnMetadata['default'])) {
$options['default'] = $columnMetadata['default'];
}
// alias for unsigned option
if (! empty($columnMetadata['options']['unsigned'])) {
$options['unsigned'] = $columnMetadata['options']['unsigned'];
}
// alias for autoincrement option
if (! empty($columnMetadata['options']['autoIncrement'])) {
$options['autoincrement'] = $columnMetadata['options']['autoIncrement'];
}
// alias for fixed option
if (! empty($columnMetadata['options']['fixed'])) {
$options['fixed'] = $columnMetadata['options']['fixed'];
}
return $options;
} | [
"protected",
"function",
"getDoctrineColumnOptions",
"(",
"ColumnDefinition",
"$",
"columnMetadata",
")",
"{",
"$",
"options",
"=",
"$",
"columnMetadata",
"[",
"'options'",
"]",
";",
"// alias for nullable option",
"if",
"(",
"!",
"empty",
"(",
"$",
"columnMetadata"... | Get the doctrine column options.
@param \ProAI\Datamapper\Metadata\Definitions\Column $columnMetadata
@return array | [
"Get",
"the",
"doctrine",
"column",
"options",
"."
] | 8fac20e5bca8fb81eefa7dacc49269b4a6241cbf | https://github.com/markusjwetzel/laravel-datamapper/blob/8fac20e5bca8fb81eefa7dacc49269b4a6241cbf/src/Schema/Builder.php#L275-L305 | train |
nabu-3/core | nabu/data/security/CNabuUserGroupMember.php | CNabuUserGroupMember.getMembersOfGroup | public static function getMembersOfGroup($nb_user_group) : CNabuUserGroupMemberList
{
if (is_numeric($nb_user_group_id = nb_getMixedValue($nb_user_group, 'nb_user_group_id'))) {
$retval = CNabuUserGroupMember::buildObjectListFromSQL(
'nb_user_id',
"select ugm.* "
. "from nb_user_group_member ugm, nb_user_group ug "
. "where ugm.nb_user_group_id=ug.nb_user_group_id "
. "and ugm.nb_user_group_id=%group_id\$d",
array(
'group_id' => $nb_user_group_id
)
);
} else {
$retval = new CNabuUserGroupMemberList();
}
return $retval;
} | php | public static function getMembersOfGroup($nb_user_group) : CNabuUserGroupMemberList
{
if (is_numeric($nb_user_group_id = nb_getMixedValue($nb_user_group, 'nb_user_group_id'))) {
$retval = CNabuUserGroupMember::buildObjectListFromSQL(
'nb_user_id',
"select ugm.* "
. "from nb_user_group_member ugm, nb_user_group ug "
. "where ugm.nb_user_group_id=ug.nb_user_group_id "
. "and ugm.nb_user_group_id=%group_id\$d",
array(
'group_id' => $nb_user_group_id
)
);
} else {
$retval = new CNabuUserGroupMemberList();
}
return $retval;
} | [
"public",
"static",
"function",
"getMembersOfGroup",
"(",
"$",
"nb_user_group",
")",
":",
"CNabuUserGroupMemberList",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"nb_user_group_id",
"=",
"nb_getMixedValue",
"(",
"$",
"nb_user_group",
",",
"'nb_user_group_id'",
")",
")",... | Gets all Members of a Group.
@param mixed $nb_user_group A valid ID, an object containing a field called nb_user_group_id or a User Group instance.
@return CNabuUserGroupMemberList Returns a list with available members. | [
"Gets",
"all",
"Members",
"of",
"a",
"Group",
"."
] | 8a93a91ba146536d66f57821e6f23f9175d8bd11 | https://github.com/nabu-3/core/blob/8a93a91ba146536d66f57821e6f23f9175d8bd11/nabu/data/security/CNabuUserGroupMember.php#L41-L59 | train |
rips/php-connector-bundle | Services/Application/Scan/SinkService.php | SinkService.getAll | public function getAll($appId, $scanId, array $queryParams = [])
{
$response = $this->api
->applications()
->scans()
->sinks()
->getAll($appId, $scanId, $queryParams);
return new SinksResponse($response);
} | php | public function getAll($appId, $scanId, array $queryParams = [])
{
$response = $this->api
->applications()
->scans()
->sinks()
->getAll($appId, $scanId, $queryParams);
return new SinksResponse($response);
} | [
"public",
"function",
"getAll",
"(",
"$",
"appId",
",",
"$",
"scanId",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"applications",
"(",
")",
"->",
"scans",
"(",
")",
"->",
"sinks"... | Get all sinks for a scan
@param int $appId
@param int $scanId
@param array $queryParams
@return SinksResponse | [
"Get",
"all",
"sinks",
"for",
"a",
"scan"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Scan/SinkService.php#L34-L43 | train |
rips/php-connector-bundle | Services/Application/Scan/SinkService.php | SinkService.getById | public function getById($appId, $scanId, $sinkId, array $queryParams = [])
{
$response = $this->api
->applications()
->scans()
->sinks()
->getById($appId, $scanId, $sinkId, $queryParams);
return new SinkResponse($response);
} | php | public function getById($appId, $scanId, $sinkId, array $queryParams = [])
{
$response = $this->api
->applications()
->scans()
->sinks()
->getById($appId, $scanId, $sinkId, $queryParams);
return new SinkResponse($response);
} | [
"public",
"function",
"getById",
"(",
"$",
"appId",
",",
"$",
"scanId",
",",
"$",
"sinkId",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"applications",
"(",
")",
"->",
"scans",
"(... | Get sink for scan by id
@param int $appId
@param int $scanId
@param int $sinkId
@param array $queryParams
@return SinkResponse | [
"Get",
"sink",
"for",
"scan",
"by",
"id"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/Application/Scan/SinkService.php#L54-L63 | train |
rips/php-connector-bundle | Services/TeamService.php | TeamService.getAll | public function getAll(array $queryParams = [])
{
$response = $this->api->teams()->getAll($queryParams);
return new TeamsResponse($response);
} | php | public function getAll(array $queryParams = [])
{
$response = $this->api->teams()->getAll($queryParams);
return new TeamsResponse($response);
} | [
"public",
"function",
"getAll",
"(",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"teams",
"(",
")",
"->",
"getAll",
"(",
"$",
"queryParams",
")",
";",
"return",
"new",
"TeamsResponse",
"... | Get all teams
@param array $queryParams
@return TeamsResponse | [
"Get",
"all",
"teams"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/TeamService.php#L33-L38 | train |
rips/php-connector-bundle | Services/TeamService.php | TeamService.getById | public function getById($teamId, array $queryParams = [])
{
$response = $this->api->teams()->getById($teamId, $queryParams);
return new TeamResponse($response);
} | php | public function getById($teamId, array $queryParams = [])
{
$response = $this->api->teams()->getById($teamId, $queryParams);
return new TeamResponse($response);
} | [
"public",
"function",
"getById",
"(",
"$",
"teamId",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"teams",
"(",
")",
"->",
"getById",
"(",
"$",
"teamId",
",",
"$",
"queryParams",
"... | Get team by id
@param int $teamId
@param array $queryParams
@return TeamResponse | [
"Get",
"team",
"by",
"id"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/TeamService.php#L47-L52 | train |
rips/php-connector-bundle | Services/TeamService.php | TeamService.create | public function create(TeamBuilder $input, array $queryParams = [])
{
$response = $this->api->teams()->create($input->toArray(), $queryParams);
return new TeamResponse($response);
} | php | public function create(TeamBuilder $input, array $queryParams = [])
{
$response = $this->api->teams()->create($input->toArray(), $queryParams);
return new TeamResponse($response);
} | [
"public",
"function",
"create",
"(",
"TeamBuilder",
"$",
"input",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"teams",
"(",
")",
"->",
"create",
"(",
"$",
"input",
"->",
"toArray",
... | Create a new team
@param TeamBuilder $input
@param array $queryParams
@return TeamResponse | [
"Create",
"a",
"new",
"team"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/TeamService.php#L61-L66 | train |
rips/php-connector-bundle | Services/TeamService.php | TeamService.update | public function update($teamId, TeamBuilder $input, array $queryParams = [])
{
$response = $this->api->teams()->update($teamId, $input->toArray(), $queryParams);
return new TeamResponse($response);
} | php | public function update($teamId, TeamBuilder $input, array $queryParams = [])
{
$response = $this->api->teams()->update($teamId, $input->toArray(), $queryParams);
return new TeamResponse($response);
} | [
"public",
"function",
"update",
"(",
"$",
"teamId",
",",
"TeamBuilder",
"$",
"input",
",",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"teams",
"(",
")",
"->",
"update",
"(",
"$",
"tea... | Update an existing team
@param int $teamId
@param TeamBuilder $input
@param array $queryParams
@return TeamResponse | [
"Update",
"an",
"existing",
"team"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/TeamService.php#L76-L81 | train |
rips/php-connector-bundle | Services/TeamService.php | TeamService.deleteAll | public function deleteAll(array $queryParams = [])
{
$response = $this->api->teams()->deleteAll($queryParams);
return new BaseResponse($response);
} | php | public function deleteAll(array $queryParams = [])
{
$response = $this->api->teams()->deleteAll($queryParams);
return new BaseResponse($response);
} | [
"public",
"function",
"deleteAll",
"(",
"array",
"$",
"queryParams",
"=",
"[",
"]",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"api",
"->",
"teams",
"(",
")",
"->",
"deleteAll",
"(",
"$",
"queryParams",
")",
";",
"return",
"new",
"BaseResponse"... | Delete all teams
@param array $queryParams
@return BaseResponse | [
"Delete",
"all",
"teams"
] | 34ac080a7988d4d91f8129419998e51291261f55 | https://github.com/rips/php-connector-bundle/blob/34ac080a7988d4d91f8129419998e51291261f55/Services/TeamService.php#L89-L94 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.