repository_name stringlengths 5 67 | func_path_in_repository stringlengths 4 234 | func_name stringlengths 0 314 | whole_func_string stringlengths 52 3.87M | language stringclasses 6
values | func_code_string stringlengths 52 3.87M | func_code_tokens listlengths 15 672k | func_documentation_string stringlengths 1 47.2k | func_documentation_tokens listlengths 1 3.92k | split_name stringclasses 1
value | func_code_url stringlengths 85 339 |
|---|---|---|---|---|---|---|---|---|---|---|
Lansoweb/LosBase | src/LosBase/DBAL/Types/BrPriceType.php | BrPriceType.convertToDatabaseValue | public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return;
}
$formatter = new \NumberFormatter('pt_BR', \NumberFormatter::DECIMAL);
$formatted = $formatter->parse($value);
return $formatted;
} | php | public function convertToDatabaseValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return;
}
$formatter = new \NumberFormatter('pt_BR', \NumberFormatter::DECIMAL);
$formatted = $formatter->parse($value);
return $formatted;
} | [
"public",
"function",
"convertToDatabaseValue",
"(",
"$",
"value",
",",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"formatter",
"=",
"new",
"\\",
"NumberFormatter",
"(",
"'pt_BR... | @param string|int|float|null $value
@param Doctrine\DBAL\Platforms\AbstractPlatform $platform
@return mixed | [
"@param",
"string|int|float|null",
"$value",
"@param",
"Doctrine",
"\\",
"DBAL",
"\\",
"Platforms",
"\\",
"AbstractPlatform",
"$platform"
] | train | https://github.com/Lansoweb/LosBase/blob/90e18a53d29c1bd841c149dca43aa365eecc656d/src/LosBase/DBAL/Types/BrPriceType.php#L16-L26 |
Lansoweb/LosBase | src/LosBase/DBAL/Types/BrPriceType.php | BrPriceType.convertToPHPValue | public function convertToPHPValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return;
}
$formatted = \number_format($value, 2, ',', '.');
return $formatted;
} | php | public function convertToPHPValue($value, AbstractPlatform $platform)
{
if ($value === null) {
return;
}
$formatted = \number_format($value, 2, ',', '.');
return $formatted;
} | [
"public",
"function",
"convertToPHPValue",
"(",
"$",
"value",
",",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"if",
"(",
"$",
"value",
"===",
"null",
")",
"{",
"return",
";",
"}",
"$",
"formatted",
"=",
"\\",
"number_format",
"(",
"$",
"value",
",",
... | @param string $value
@param DoctrineDBALPlatformsAbstractPlatform $platform
@return string|null
@throws DoctrineDBALTypesConversionException | [
"@param",
"string",
"$value",
"@param",
"DoctrineDBALPlatformsAbstractPlatform",
"$platform"
] | train | https://github.com/Lansoweb/LosBase/blob/90e18a53d29c1bd841c149dca43aa365eecc656d/src/LosBase/DBAL/Types/BrPriceType.php#L36-L44 |
Lansoweb/LosBase | src/LosBase/DBAL/Types/BrPriceType.php | BrPriceType.getSQLDeclaration | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
$fieldDeclaration['precision'] = (!isset($fieldDeclaration['precision']) || empty($fieldDeclaration['precision'])) ? 9 : $fieldDeclaration['precision'];
$fieldDeclaration['scale'] = (!isset($fieldDeclaration['sc... | php | public function getSQLDeclaration(array $fieldDeclaration, AbstractPlatform $platform)
{
$fieldDeclaration['precision'] = (!isset($fieldDeclaration['precision']) || empty($fieldDeclaration['precision'])) ? 9 : $fieldDeclaration['precision'];
$fieldDeclaration['scale'] = (!isset($fieldDeclaration['sc... | [
"public",
"function",
"getSQLDeclaration",
"(",
"array",
"$",
"fieldDeclaration",
",",
"AbstractPlatform",
"$",
"platform",
")",
"{",
"$",
"fieldDeclaration",
"[",
"'precision'",
"]",
"=",
"(",
"!",
"isset",
"(",
"$",
"fieldDeclaration",
"[",
"'precision'",
"]",... | {@inheritdoc} | [
"{"
] | train | https://github.com/Lansoweb/LosBase/blob/90e18a53d29c1bd841c149dca43aa365eecc656d/src/LosBase/DBAL/Types/BrPriceType.php#L49-L55 |
PeekAndPoke/psi | src/Operation/FullSet/GroupByOperation.php | GroupByOperation.apply | public function apply(\Iterator $set)
{
$ret = [];
$func = $this->function;
foreach ($set as $key => $item) {
$group = $func($item, $key);
$ret[$group][] = $item;
}
return new \ArrayIterator($ret);
} | php | public function apply(\Iterator $set)
{
$ret = [];
$func = $this->function;
foreach ($set as $key => $item) {
$group = $func($item, $key);
$ret[$group][] = $item;
}
return new \ArrayIterator($ret);
} | [
"public",
"function",
"apply",
"(",
"\\",
"Iterator",
"$",
"set",
")",
"{",
"$",
"ret",
"=",
"[",
"]",
";",
"$",
"func",
"=",
"$",
"this",
"->",
"function",
";",
"foreach",
"(",
"$",
"set",
"as",
"$",
"key",
"=>",
"$",
"item",
")",
"{",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Operation/FullSet/GroupByOperation.php#L21-L33 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Http/Response.php | Zend_Http_Response.getHeader | public function getHeader($header)
{
$header = ucwords(strtolower($header));
if (! is_string($header) || ! isset($this->headers[$header])) return null;
return $this->headers[$header];
} | php | public function getHeader($header)
{
$header = ucwords(strtolower($header));
if (! is_string($header) || ! isset($this->headers[$header])) return null;
return $this->headers[$header];
} | [
"public",
"function",
"getHeader",
"(",
"$",
"header",
")",
"{",
"$",
"header",
"=",
"ucwords",
"(",
"strtolower",
"(",
"$",
"header",
")",
")",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"header",
")",
"||",
"!",
"isset",
"(",
"$",
"this",
"->",
... | Get a specific header as string, or null if it is not set
@param string$header
@return string|array|null | [
"Get",
"a",
"specific",
"header",
"as",
"string",
"or",
"null",
"if",
"it",
"is",
"not",
"set"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Http/Response.php#L350-L356 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Http/Response.php | Zend_Http_Response.getHeadersAsString | public function getHeadersAsString($status_line = true, $br = "\n")
{
$str = '';
if ($status_line) {
$str = "HTTP/{$this->version} {$this->code} {$this->message}{$br}";
}
// Iterate over the headers and stringify them
foreach ($this->headers as $name => $value)
... | php | public function getHeadersAsString($status_line = true, $br = "\n")
{
$str = '';
if ($status_line) {
$str = "HTTP/{$this->version} {$this->code} {$this->message}{$br}";
}
// Iterate over the headers and stringify them
foreach ($this->headers as $name => $value)
... | [
"public",
"function",
"getHeadersAsString",
"(",
"$",
"status_line",
"=",
"true",
",",
"$",
"br",
"=",
"\"\\n\"",
")",
"{",
"$",
"str",
"=",
"''",
";",
"if",
"(",
"$",
"status_line",
")",
"{",
"$",
"str",
"=",
"\"HTTP/{$this->version} {$this->code} {$this->m... | Get all headers as string
@param boolean $status_line Whether to return the first status line (IE "HTTP 200 OK")
@param string $br Line breaks (eg. "\n", "\r\n", "<br />")
@return string | [
"Get",
"all",
"headers",
"as",
"string"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Http/Response.php#L365-L387 |
nyeholt/silverstripe-external-content | thirdparty/Zend/Http/Response.php | Zend_Http_Response.decodeChunkedBody | public static function decodeChunkedBody($body)
{
$decBody = '';
while (trim($body)) {
if (! preg_match("/^([\da-fA-F]+)[^\r\n]*\r\n/sm", $body, $m)) {
require_once 'Zend/Http/Exception.php';
throw new Zend_Http_Exception("Error parsing body - doe... | php | public static function decodeChunkedBody($body)
{
$decBody = '';
while (trim($body)) {
if (! preg_match("/^([\da-fA-F]+)[^\r\n]*\r\n/sm", $body, $m)) {
require_once 'Zend/Http/Exception.php';
throw new Zend_Http_Exception("Error parsing body - doe... | [
"public",
"static",
"function",
"decodeChunkedBody",
"(",
"$",
"body",
")",
"{",
"$",
"decBody",
"=",
"''",
";",
"while",
"(",
"trim",
"(",
"$",
"body",
")",
")",
"{",
"if",
"(",
"!",
"preg_match",
"(",
"\"/^([\\da-fA-F]+)[^\\r\\n]*\\r\\n/sm\"",
",",
"$",
... | Decode a "chunked" transfer-encoded body and return the decoded text
@param string $body
@return string | [
"Decode",
"a",
"chunked",
"transfer",
"-",
"encoded",
"body",
"and",
"return",
"the",
"decoded",
"text"
] | train | https://github.com/nyeholt/silverstripe-external-content/blob/1c6da8c56ef717225ff904e1522aff94ed051601/thirdparty/Zend/Http/Response.php#L550-L568 |
ClanCats/Core | src/classes/CCError/Inspector.php | CCError_Inspector.trace | public function trace( $add_self = false )
{
if ( is_null( $this->trace ) )
{
$this->trace = array();
if ( $add_self )
{
$this->trace[] = new CCError_Trace( array(
'file' => $this->exception->getFile(),
'line' => $this->exception->getLine(),
'class' => $this->exception_name(),
)... | php | public function trace( $add_self = false )
{
if ( is_null( $this->trace ) )
{
$this->trace = array();
if ( $add_self )
{
$this->trace[] = new CCError_Trace( array(
'file' => $this->exception->getFile(),
'line' => $this->exception->getLine(),
'class' => $this->exception_name(),
)... | [
"public",
"function",
"trace",
"(",
"$",
"add_self",
"=",
"false",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"trace",
")",
")",
"{",
"$",
"this",
"->",
"trace",
"=",
"array",
"(",
")",
";",
"if",
"(",
"$",
"add_self",
")",
"{",
"$... | get the inspector trace
@param bool $add_self Adds the current exception also to trace. | [
"get",
"the",
"inspector",
"trace"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError/Inspector.php#L110-L132 |
ClanCats/Core | src/classes/CCError/Inspector.php | CCError_Inspector.tables | public function tables()
{
$tables = array();
foreach( static::$info_callbacks as $name => $callback )
{
$tables[$name] = call_user_func( $callback );
}
return array_merge( $tables , array(
'Server / request data' => $_SERVER,
'Get parameters' => $_GET,
'Post parameters' => $_POST,
'Cook... | php | public function tables()
{
$tables = array();
foreach( static::$info_callbacks as $name => $callback )
{
$tables[$name] = call_user_func( $callback );
}
return array_merge( $tables , array(
'Server / request data' => $_SERVER,
'Get parameters' => $_GET,
'Post parameters' => $_POST,
'Cook... | [
"public",
"function",
"tables",
"(",
")",
"{",
"$",
"tables",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"static",
"::",
"$",
"info_callbacks",
"as",
"$",
"name",
"=>",
"$",
"callback",
")",
"{",
"$",
"tables",
"[",
"$",
"name",
"]",
"=",
"call_u... | returns all debug tables
@return array | [
"returns",
"all",
"debug",
"tables"
] | train | https://github.com/ClanCats/Core/blob/9f6ec72c1a439de4b253d0223f1029f7f85b6ef8/src/classes/CCError/Inspector.php#L139-L155 |
Ocramius/OcraDiCompiler | src/OcraDiCompiler/ServiceManager/Di/DiAbstractServiceFactory.php | DiAbstractServiceFactory.createServiceWithName | public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $serviceName, $requestedName)
{
$this->serviceLocator = $serviceLocator;
return $this->get($requestedName);
} | php | public function createServiceWithName(ServiceLocatorInterface $serviceLocator, $serviceName, $requestedName)
{
$this->serviceLocator = $serviceLocator;
return $this->get($requestedName);
} | [
"public",
"function",
"createServiceWithName",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
",",
"$",
"serviceName",
",",
"$",
"requestedName",
")",
"{",
"$",
"this",
"->",
"serviceLocator",
"=",
"$",
"serviceLocator",
";",
"return",
"$",
"this",
"->",
... | {@inheritDoc} | [
"{"
] | train | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/ServiceManager/Di/DiAbstractServiceFactory.php#L79-L84 |
Ocramius/OcraDiCompiler | src/OcraDiCompiler/ServiceManager/Di/DiAbstractServiceFactory.php | DiAbstractServiceFactory.get | public function get($name, array $params = array())
{
if (null === $this->serviceLocator) {
throw new DomainException('No ServiceLocator defined, use `createServiceWithName` instead of `get`');
}
if (self::USE_SL_BEFORE_DI === $this->useServiceLocator && $this->serviceLocator->h... | php | public function get($name, array $params = array())
{
if (null === $this->serviceLocator) {
throw new DomainException('No ServiceLocator defined, use `createServiceWithName` instead of `get`');
}
if (self::USE_SL_BEFORE_DI === $this->useServiceLocator && $this->serviceLocator->h... | [
"public",
"function",
"get",
"(",
"$",
"name",
",",
"array",
"$",
"params",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"serviceLocator",
")",
"{",
"throw",
"new",
"DomainException",
"(",
"'No ServiceLocator defined, use ... | Overrides Zend\Di to allow the given serviceLocator's services to be reused by Di itself
{@inheritDoc} | [
"Overrides",
"Zend",
"\\",
"Di",
"to",
"allow",
"the",
"given",
"serviceLocator",
"s",
"services",
"to",
"be",
"reused",
"by",
"Di",
"itself"
] | train | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/ServiceManager/Di/DiAbstractServiceFactory.php#L91-L114 |
Ocramius/OcraDiCompiler | src/OcraDiCompiler/ServiceManager/Di/DiAbstractServiceFactory.php | DiAbstractServiceFactory.canCreateServiceWithName | public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
return $this->instanceManager->hasSharedInstance($requestedName)
|| $this->instanceManager->hasAlias($requestedName)
|| $this->instanceManager->hasConfig($requestedName)
... | php | public function canCreateServiceWithName(ServiceLocatorInterface $serviceLocator, $name, $requestedName)
{
return $this->instanceManager->hasSharedInstance($requestedName)
|| $this->instanceManager->hasAlias($requestedName)
|| $this->instanceManager->hasConfig($requestedName)
... | [
"public",
"function",
"canCreateServiceWithName",
"(",
"ServiceLocatorInterface",
"$",
"serviceLocator",
",",
"$",
"name",
",",
"$",
"requestedName",
")",
"{",
"return",
"$",
"this",
"->",
"instanceManager",
"->",
"hasSharedInstance",
"(",
"$",
"requestedName",
")",... | {@inheritDoc} | [
"{"
] | train | https://github.com/Ocramius/OcraDiCompiler/blob/667f4b24771f27fb9c8d6c38ffaf72d9cd55ca4a/src/OcraDiCompiler/ServiceManager/Di/DiAbstractServiceFactory.php#L119-L126 |
webforge-labs/psc-cms | lib/Psc/Data/SetMeta.php | SetMeta.getFieldType | public function getFieldType($field) {
try {
$key = $this->getKey($field);
// dies kann auch einen verschachtelten Array von Types zurück geben, wenn der Schlüssel den man angibt noch Untertypen hat
return $this->types->get($key, DataInput::THROW_EXCEPTION, DataInput::THROW_EXCEPTION);
... | php | public function getFieldType($field) {
try {
$key = $this->getKey($field);
// dies kann auch einen verschachtelten Array von Types zurück geben, wenn der Schlüssel den man angibt noch Untertypen hat
return $this->types->get($key, DataInput::THROW_EXCEPTION, DataInput::THROW_EXCEPTION);
... | [
"public",
"function",
"getFieldType",
"(",
"$",
"field",
")",
"{",
"try",
"{",
"$",
"key",
"=",
"$",
"this",
"->",
"getKey",
"(",
"$",
"field",
")",
";",
"// dies kann auch einen verschachtelten Array von Types zurück geben, wenn der Schlüssel den man angibt noch Untertyp... | Gibt den Typ eines Feldes zurück
@param string|array wenn string dann ebenen mit . getrennt
@return Webforge\Types
@throws FieldNotDefinedException | [
"Gibt",
"den",
"Typ",
"eines",
"Feldes",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Data/SetMeta.php#L33-L48 |
webforge-labs/psc-cms | lib/Psc/Data/SetMeta.php | SetMeta.setFieldType | public function setFieldType($field, Type $type) {
$this->types->set($this->getKey($field), $type);
return $this;
} | php | public function setFieldType($field, Type $type) {
$this->types->set($this->getKey($field), $type);
return $this;
} | [
"public",
"function",
"setFieldType",
"(",
"$",
"field",
",",
"Type",
"$",
"type",
")",
"{",
"$",
"this",
"->",
"types",
"->",
"set",
"(",
"$",
"this",
"->",
"getKey",
"(",
"$",
"field",
")",
",",
"$",
"type",
")",
";",
"return",
"$",
"this",
";"... | Setzt den Typ für ein Feld
wenn das Feld nicht existiert, wird es angelegt
@param string|array wenn string dann ebenen mit . getrennt | [
"Setzt",
"den",
"Typ",
"für",
"ein",
"Feld"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Data/SetMeta.php#L63-L66 |
webforge-labs/psc-cms | lib/Psc/Data/SetMeta.php | SetMeta.getTypes | public function getTypes() {
$typesExport = array();
foreach ($this->types->toArray() as $key => $type) {
$typesExport[str_replace(':','.',$key)] = $type;
}
return $typesExport;
} | php | public function getTypes() {
$typesExport = array();
foreach ($this->types->toArray() as $key => $type) {
$typesExport[str_replace(':','.',$key)] = $type;
}
return $typesExport;
} | [
"public",
"function",
"getTypes",
"(",
")",
"{",
"$",
"typesExport",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"types",
"->",
"toArray",
"(",
")",
"as",
"$",
"key",
"=>",
"$",
"type",
")",
"{",
"$",
"typesExport",
"[",
"str_re... | Gibt alle Typen zurück
@return array die Schlüssel des Arrays sind mit . getrennt (und umspannen alle Ebenen) | [
"Gibt",
"alle",
"Typen",
"zurück"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/Data/SetMeta.php#L101-L107 |
kuria/event | src/ObservableTrait.php | ObservableTrait.on | function on(string $event, $callback, int $priority = 0): void
{
$this->getEventEmitter()->on($event, $callback, $priority);
} | php | function on(string $event, $callback, int $priority = 0): void
{
$this->getEventEmitter()->on($event, $callback, $priority);
} | [
"function",
"on",
"(",
"string",
"$",
"event",
",",
"$",
"callback",
",",
"int",
"$",
"priority",
"=",
"0",
")",
":",
"void",
"{",
"$",
"this",
"->",
"getEventEmitter",
"(",
")",
"->",
"on",
"(",
"$",
"event",
",",
"$",
"callback",
",",
"$",
"pri... | Register a callback | [
"Register",
"a",
"callback"
] | train | https://github.com/kuria/event/blob/9ee95e751270831d5aca04f3a34a2e03b786ff41/src/ObservableTrait.php#L19-L22 |
kuria/event | src/ObservableTrait.php | ObservableTrait.off | function off(string $event, $callback): bool
{
return $this->getEventEmitter()->off($event, $callback);
} | php | function off(string $event, $callback): bool
{
return $this->getEventEmitter()->off($event, $callback);
} | [
"function",
"off",
"(",
"string",
"$",
"event",
",",
"$",
"callback",
")",
":",
"bool",
"{",
"return",
"$",
"this",
"->",
"getEventEmitter",
"(",
")",
"->",
"off",
"(",
"$",
"event",
",",
"$",
"callback",
")",
";",
"}"
] | Unregister a callback | [
"Unregister",
"a",
"callback"
] | train | https://github.com/kuria/event/blob/9ee95e751270831d5aca04f3a34a2e03b786ff41/src/ObservableTrait.php#L27-L30 |
kuria/event | src/ObservableTrait.php | ObservableTrait.emit | function emit(string $event, ...$args): void
{
// only emit if the event emitter has been initialized already
// (if it has not been initialized, there can be no listeners)
if ($this->eventEmitter) {
$this->eventEmitter->emit($event, ...$args);
}
} | php | function emit(string $event, ...$args): void
{
// only emit if the event emitter has been initialized already
// (if it has not been initialized, there can be no listeners)
if ($this->eventEmitter) {
$this->eventEmitter->emit($event, ...$args);
}
} | [
"function",
"emit",
"(",
"string",
"$",
"event",
",",
"...",
"$",
"args",
")",
":",
"void",
"{",
"// only emit if the event emitter has been initialized already",
"// (if it has not been initialized, there can be no listeners)",
"if",
"(",
"$",
"this",
"->",
"eventEmitter",... | Emit an event | [
"Emit",
"an",
"event"
] | train | https://github.com/kuria/event/blob/9ee95e751270831d5aca04f3a34a2e03b786ff41/src/ObservableTrait.php#L51-L58 |
fubhy/graphql-php | src/Type/Definition/Types/AbstractType.php | AbstractType.getTypeOf | public function getTypeOf($value)
{
foreach ($this->getPossibleTypes() as $type) {
if ($isTypeOf = $type->isTypeOf($value)) {
return $type;
}
if (!isset($isTypeOf)) {
throw new \Exception(sprintf(
'Non-Object Type %s do... | php | public function getTypeOf($value)
{
foreach ($this->getPossibleTypes() as $type) {
if ($isTypeOf = $type->isTypeOf($value)) {
return $type;
}
if (!isset($isTypeOf)) {
throw new \Exception(sprintf(
'Non-Object Type %s do... | [
"public",
"function",
"getTypeOf",
"(",
"$",
"value",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getPossibleTypes",
"(",
")",
"as",
"$",
"type",
")",
"{",
"if",
"(",
"$",
"isTypeOf",
"=",
"$",
"type",
"->",
"isTypeOf",
"(",
"$",
"value",
")",
")... | @param mixed $value
@return \Fubhy\GraphQL\Type\Definition\Types\ObjectType|null
@throws \Exception | [
"@param",
"mixed",
"$value"
] | train | https://github.com/fubhy/graphql-php/blob/c1de2233c731ca29e5c5db4c43f3b9db36478c83/src/Type/Definition/Types/AbstractType.php#L14-L31 |
phpmob/changmin | src/PhpMob/CmsBundle/Translation/AddDefinedTranslation.php | AddDefinedTranslation.addTranslations | public function addTranslations(DefinedTranslationInterface $definedTranslation)
{
$translations = $definedTranslation->getDefinedTranslations();
if (empty($translations)) {
return;
}
foreach ($translations as $localeCode => $messages) {
if (empty($messages)... | php | public function addTranslations(DefinedTranslationInterface $definedTranslation)
{
$translations = $definedTranslation->getDefinedTranslations();
if (empty($translations)) {
return;
}
foreach ($translations as $localeCode => $messages) {
if (empty($messages)... | [
"public",
"function",
"addTranslations",
"(",
"DefinedTranslationInterface",
"$",
"definedTranslation",
")",
"{",
"$",
"translations",
"=",
"$",
"definedTranslation",
"->",
"getDefinedTranslations",
"(",
")",
";",
"if",
"(",
"empty",
"(",
"$",
"translations",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/CmsBundle/Translation/AddDefinedTranslation.php#L57-L74 |
phpmob/changmin | src/PhpMob/MediaBundle/Util/Base64ToFile.php | Base64ToFile.createFileInfo | public static function createFileInfo(string $base64String): \SplFileInfo
{
preg_match('/data:(.*);/', $base64String, $matchMime);
preg_match('/data:image\/(.*);base64/', $base64String, $matchExt);
$fileName = sprintf('/%s.%s', uniqid(), $matchExt[1]);
$outputFile = sys_get_temp_dir... | php | public static function createFileInfo(string $base64String): \SplFileInfo
{
preg_match('/data:(.*);/', $base64String, $matchMime);
preg_match('/data:image\/(.*);base64/', $base64String, $matchExt);
$fileName = sprintf('/%s.%s', uniqid(), $matchExt[1]);
$outputFile = sys_get_temp_dir... | [
"public",
"static",
"function",
"createFileInfo",
"(",
"string",
"$",
"base64String",
")",
":",
"\\",
"SplFileInfo",
"{",
"preg_match",
"(",
"'/data:(.*);/'",
",",
"$",
"base64String",
",",
"$",
"matchMime",
")",
";",
"preg_match",
"(",
"'/data:image\\/(.*);base64... | @param string $base64String
@return \SplFileInfo | [
"@param",
"string",
"$base64String"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/MediaBundle/Util/Base64ToFile.php#L26-L40 |
phpmob/changmin | src/PhpMob/MediaBundle/Util/Base64ToFile.php | Base64ToFile.createUploadedFile | public static function createUploadedFile(string $base64String): UploadedFile
{
$file = self::createFileInfo($base64String);
return new UploadedFile(
$file->getRealPath(), $file->getFilename(), mime_content_type($file->getRealPath())
);
} | php | public static function createUploadedFile(string $base64String): UploadedFile
{
$file = self::createFileInfo($base64String);
return new UploadedFile(
$file->getRealPath(), $file->getFilename(), mime_content_type($file->getRealPath())
);
} | [
"public",
"static",
"function",
"createUploadedFile",
"(",
"string",
"$",
"base64String",
")",
":",
"UploadedFile",
"{",
"$",
"file",
"=",
"self",
"::",
"createFileInfo",
"(",
"$",
"base64String",
")",
";",
"return",
"new",
"UploadedFile",
"(",
"$",
"file",
... | @param string $base64String
@return UploadedFile | [
"@param",
"string",
"$base64String"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/MediaBundle/Util/Base64ToFile.php#L47-L54 |
anexia-it/anexia-laravel-encryption | src/DatabaseEncryptionQueryBuilder.php | DatabaseEncryptionQueryBuilder.addEncryptionSelect | public function addEncryptionSelect($column = [])
{
$columnName = (isset($column['alias']) && !empty($column['alias'])) ? $column['alias'] : $column['column'];
$this->encryptionColumns[$columnName] = $column;
return $this;
} | php | public function addEncryptionSelect($column = [])
{
$columnName = (isset($column['alias']) && !empty($column['alias'])) ? $column['alias'] : $column['column'];
$this->encryptionColumns[$columnName] = $column;
return $this;
} | [
"public",
"function",
"addEncryptionSelect",
"(",
"$",
"column",
"=",
"[",
"]",
")",
"{",
"$",
"columnName",
"=",
"(",
"isset",
"(",
"$",
"column",
"[",
"'alias'",
"]",
")",
"&&",
"!",
"empty",
"(",
"$",
"column",
"[",
"'alias'",
"]",
")",
")",
"?"... | Add a new select encryption_column to the query.
@param array $column; array with [originalColumnName => selectValue]
@return $this | [
"Add",
"a",
"new",
"select",
"encryption_column",
"to",
"the",
"query",
"."
] | train | https://github.com/anexia-it/anexia-laravel-encryption/blob/b7c72d99916ebca2d2cf2dbab1d4c0f84e383081/src/DatabaseEncryptionQueryBuilder.php#L36-L42 |
anexia-it/anexia-laravel-encryption | src/DatabaseEncryptionQueryBuilder.php | DatabaseEncryptionQueryBuilder.get | public function get($columns = ['*'])
{
$original = $this->columns;
if (is_null($original)) {
$this->columns = $columns;
}
// encrypted columns replace their default (original) columns
if ($this->encryptionModel instanceof Model
&& method_exists($thi... | php | public function get($columns = ['*'])
{
$original = $this->columns;
if (is_null($original)) {
$this->columns = $columns;
}
// encrypted columns replace their default (original) columns
if ($this->encryptionModel instanceof Model
&& method_exists($thi... | [
"public",
"function",
"get",
"(",
"$",
"columns",
"=",
"[",
"'*'",
"]",
")",
"{",
"$",
"original",
"=",
"$",
"this",
"->",
"columns",
";",
"if",
"(",
"is_null",
"(",
"$",
"original",
")",
")",
"{",
"$",
"this",
"->",
"columns",
"=",
"$",
"columns... | Execute the query as a "select" statement.
@param array $columns
@return \Illuminate\Support\Collection | [
"Execute",
"the",
"query",
"as",
"a",
"select",
"statement",
"."
] | train | https://github.com/anexia-it/anexia-laravel-encryption/blob/b7c72d99916ebca2d2cf2dbab1d4c0f84e383081/src/DatabaseEncryptionQueryBuilder.php#L50-L118 |
jpcercal/resource-query-language | src/ExprBuilder.php | ExprBuilder.between | public function between($field, $from, $to)
{
$this->enqueue(new BetweenExpr($field, $from, $to));
return $this;
} | php | public function between($field, $from, $to)
{
$this->enqueue(new BetweenExpr($field, $from, $to));
return $this;
} | [
"public",
"function",
"between",
"(",
"$",
"field",
",",
"$",
"from",
",",
"$",
"to",
")",
"{",
"$",
"this",
"->",
"enqueue",
"(",
"new",
"BetweenExpr",
"(",
"$",
"field",
",",
"$",
"from",
",",
"$",
"to",
")",
")",
";",
"return",
"$",
"this",
... | @param string $field
@param string $from
@param string $to
@return ExprBuilder | [
"@param",
"string",
"$field",
"@param",
"string",
"$from",
"@param",
"string",
"$to"
] | train | https://github.com/jpcercal/resource-query-language/blob/2a1520198c717a8199cd8d3d85ca2557e24cb7f5/src/ExprBuilder.php#L44-L49 |
atkrad/data-tables | src/Extension/ColReorder.php | ColReorder.setReorderCallback | public function setReorderCallback($reorderCallback)
{
$hash = sha1($reorderCallback);
$this->properties['reorderCallback'] = $hash;
$this->callbacks[$hash] = $reorderCallback;
return $this;
} | php | public function setReorderCallback($reorderCallback)
{
$hash = sha1($reorderCallback);
$this->properties['reorderCallback'] = $hash;
$this->callbacks[$hash] = $reorderCallback;
return $this;
} | [
"public",
"function",
"setReorderCallback",
"(",
"$",
"reorderCallback",
")",
"{",
"$",
"hash",
"=",
"sha1",
"(",
"$",
"reorderCallback",
")",
";",
"$",
"this",
"->",
"properties",
"[",
"'reorderCallback'",
"]",
"=",
"$",
"hash",
";",
"$",
"this",
"->",
... | Callback function which can be used to perform actions when the columns have
been reordered.
Input parameters: void
Return parameter: void
@param string $reorderCallback Callback function which can be used to perform
actions when the columns have been reordered.
@return ColReorder
@see http://datatables.net/ex... | [
"Callback",
"function",
"which",
"can",
"be",
"used",
"to",
"perform",
"actions",
"when",
"the",
"columns",
"have",
"been",
"reordered",
"."
] | train | https://github.com/atkrad/data-tables/blob/5afcc337ab624ca626e29d9674459c5105982b16/src/Extension/ColReorder.php#L107-L114 |
kattsoftware/phassets | src/Phassets/AssetsMergers/NewLineAssetsMerger.php | NewLineAssetsMerger.mergeFilenames | public function mergeFilenames($assets, Asset $outputAsset)
{
$filename = '';
foreach($assets as $asset) {
$filename .= $asset->getFilename();
}
$outputAsset->setFilename(md5($filename));
} | php | public function mergeFilenames($assets, Asset $outputAsset)
{
$filename = '';
foreach($assets as $asset) {
$filename .= $asset->getFilename();
}
$outputAsset->setFilename(md5($filename));
} | [
"public",
"function",
"mergeFilenames",
"(",
"$",
"assets",
",",
"Asset",
"$",
"outputAsset",
")",
"{",
"$",
"filename",
"=",
"''",
";",
"foreach",
"(",
"$",
"assets",
"as",
"$",
"asset",
")",
"{",
"$",
"filename",
".=",
"$",
"asset",
"->",
"getFilenam... | Using an internal algorithm, try to create an unique filename of received assets,
writing the changes to $outputAsset::setFilename().
Note: There is no need to set the $outputAsset::setOutputExtension().
@param Asset[] $assets Array of assets for merging their filenames
@param Asset $outputAsset Asset Asset instance w... | [
"Using",
"an",
"internal",
"algorithm",
"try",
"to",
"create",
"an",
"unique",
"filename",
"of",
"received",
"assets",
"writing",
"the",
"changes",
"to",
"$outputAsset",
"::",
"setFilename",
"()",
".",
"Note",
":",
"There",
"is",
"no",
"need",
"to",
"set",
... | train | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/AssetsMergers/NewLineAssetsMerger.php#L31-L40 |
kattsoftware/phassets | src/Phassets/AssetsMergers/NewLineAssetsMerger.php | NewLineAssetsMerger.mergeContents | public function mergeContents($assets, Asset $outputAsset)
{
$contents = '';
foreach ($assets as $asset) {
$contents .= $asset->getContents() . PHP_EOL;
}
$outputAsset->setContents($contents);
} | php | public function mergeContents($assets, Asset $outputAsset)
{
$contents = '';
foreach ($assets as $asset) {
$contents .= $asset->getContents() . PHP_EOL;
}
$outputAsset->setContents($contents);
} | [
"public",
"function",
"mergeContents",
"(",
"$",
"assets",
",",
"Asset",
"$",
"outputAsset",
")",
"{",
"$",
"contents",
"=",
"''",
";",
"foreach",
"(",
"$",
"assets",
"as",
"$",
"asset",
")",
"{",
"$",
"contents",
".=",
"$",
"asset",
"->",
"getContents... | Using an internal algorithm, try to merge all contents of an array of assets,
writing the changes to $outputAsset::setContents().
@param Asset[] $assets Array of assets to be merged
@param Asset $outputAsset Asset Asset instance whose contents should be
modified according to the internal algorithm.
@throws PhassetsInt... | [
"Using",
"an",
"internal",
"algorithm",
"try",
"to",
"merge",
"all",
"contents",
"of",
"an",
"array",
"of",
"assets",
"writing",
"the",
"changes",
"to",
"$outputAsset",
"::",
"setContents",
"()",
"."
] | train | https://github.com/kattsoftware/phassets/blob/cc982cf1941eb5776287d64f027218bd4835ed2b/src/Phassets/AssetsMergers/NewLineAssetsMerger.php#L51-L60 |
phpmob/changmin | src/PhpMob/MediaBundle/Form/Type/ImageType.php | ImageType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
$types = $this->imageTypeRegistry->getSectionTypes($this->getFilterSection());
if (!empty($types)) {
if (count($types) > 1) {
$builder->add('type', ChoiceType::class, [
'requir... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
$types = $this->imageTypeRegistry->getSectionTypes($this->getFilterSection());
if (!empty($types)) {
if (count($types) > 1) {
$builder->add('type', ChoiceType::class, [
'requir... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"$",
"types",
"=",
"$",
"this",
"->",
"imageTypeRegistry",
"->",
"getSectionTypes",
"(",
"$",
"this",
"->",
"getFilterSection",
"(",
")",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/phpmob/changmin/blob/bfebb1561229094d1c138574abab75f2f1d17d66/src/PhpMob/MediaBundle/Form/Type/ImageType.php#L51-L96 |
egeloen/IvorySerializerBundle | DependencyInjection/IvorySerializerExtension.php | IvorySerializerExtension.loadInternal | protected function loadInternal(array $config, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$resources = [
'cache',
'common',
'event',
'fos',
'mapping',
... | php | protected function loadInternal(array $config, ContainerBuilder $container)
{
$loader = new XmlFileLoader($container, new FileLocator(__DIR__.'/../Resources/config'));
$resources = [
'cache',
'common',
'event',
'fos',
'mapping',
... | [
"protected",
"function",
"loadInternal",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"loader",
"=",
"new",
"XmlFileLoader",
"(",
"$",
"container",
",",
"new",
"FileLocator",
"(",
"__DIR__",
".",
"'/../Resources/config'"... | {@inheritdoc} | [
"{"
] | train | https://github.com/egeloen/IvorySerializerBundle/blob/a2bdd912bf715c61b823cf7257ee232d5c823dd3/DependencyInjection/IvorySerializerExtension.php#L44-L69 |
egeloen/IvorySerializerBundle | DependencyInjection/IvorySerializerExtension.php | IvorySerializerExtension.resolveMappingPaths | private function resolveMappingPaths(array $config, ContainerBuilder $container)
{
$paths = [];
if ($config['auto']['enabled']) {
$bundles = $container->getParameter('kernel.bundles');
foreach ($bundles as $bundle) {
$bundlePath = dirname((new \ReflectionCla... | php | private function resolveMappingPaths(array $config, ContainerBuilder $container)
{
$paths = [];
if ($config['auto']['enabled']) {
$bundles = $container->getParameter('kernel.bundles');
foreach ($bundles as $bundle) {
$bundlePath = dirname((new \ReflectionCla... | [
"private",
"function",
"resolveMappingPaths",
"(",
"array",
"$",
"config",
",",
"ContainerBuilder",
"$",
"container",
")",
"{",
"$",
"paths",
"=",
"[",
"]",
";",
"if",
"(",
"$",
"config",
"[",
"'auto'",
"]",
"[",
"'enabled'",
"]",
")",
"{",
"$",
"bundl... | @param mixed[] $config
@param ContainerBuilder $container
@return string[] | [
"@param",
"mixed",
"[]",
"$config",
"@param",
"ContainerBuilder",
"$container"
] | train | https://github.com/egeloen/IvorySerializerBundle/blob/a2bdd912bf715c61b823cf7257ee232d5c823dd3/DependencyInjection/IvorySerializerExtension.php#L251-L272 |
titon/db | src/Titon/Db/Behavior/SoftDeleteBehavior.php | SoftDeleteBehavior.preFind | public function preFind(Event $event, Query $query, $finder) {
$config = $this->allConfig();
if ($config['filterDeleted']) {
$where = $query->getWhere();
if ($config['useFlag']) {
if (!$where->hasParam($config['flagField'])) {
$query->where($... | php | public function preFind(Event $event, Query $query, $finder) {
$config = $this->allConfig();
if ($config['filterDeleted']) {
$where = $query->getWhere();
if ($config['useFlag']) {
if (!$where->hasParam($config['flagField'])) {
$query->where($... | [
"public",
"function",
"preFind",
"(",
"Event",
"$",
"event",
",",
"Query",
"$",
"query",
",",
"$",
"finder",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"allConfig",
"(",
")",
";",
"if",
"(",
"$",
"config",
"[",
"'filterDeleted'",
"]",
")",
"{... | Filter out all soft deleted records from a select query if $filterDeleted is true.
Only apply the filter if the field being filtered on is not part of the original query.
@param \Titon\Event\Event $event
@param \Titon\Db\Query $query
@param string $finder
@return bool | [
"Filter",
"out",
"all",
"soft",
"deleted",
"records",
"from",
"a",
"select",
"query",
"if",
"$filterDeleted",
"is",
"true",
".",
"Only",
"apply",
"the",
"filter",
"if",
"the",
"field",
"being",
"filtered",
"on",
"is",
"not",
"part",
"of",
"the",
"original"... | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/SoftDeleteBehavior.php#L61-L77 |
titon/db | src/Titon/Db/Behavior/SoftDeleteBehavior.php | SoftDeleteBehavior.purgeDeleted | public function purgeDeleted($timeFrame) {
$config = $this->allConfig();
return $this->getRepository()->deleteMany(function(Query $query) use ($timeFrame, $config) {
if ($timeFrame) {
$query->where($config['deleteField'], '>=', Time::toUnix($timeFrame));
} else ... | php | public function purgeDeleted($timeFrame) {
$config = $this->allConfig();
return $this->getRepository()->deleteMany(function(Query $query) use ($timeFrame, $config) {
if ($timeFrame) {
$query->where($config['deleteField'], '>=', Time::toUnix($timeFrame));
} else ... | [
"public",
"function",
"purgeDeleted",
"(",
"$",
"timeFrame",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"allConfig",
"(",
")",
";",
"return",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"deleteMany",
"(",
"function",
"(",
"Query",
"$",
"q... | Purge all soft deleted records from the database.
If a time frame is provided, delete all records within that time frame.
If no time frame is provided, delete all records based on flag or timestamp being not null.
@uses \Titon\Utility\Time
@param int|string $timeFrame
@return int | [
"Purge",
"all",
"soft",
"deleted",
"records",
"from",
"the",
"database",
".",
"If",
"a",
"time",
"frame",
"is",
"provided",
"delete",
"all",
"records",
"within",
"that",
"time",
"frame",
".",
"If",
"no",
"time",
"frame",
"is",
"provided",
"delete",
"all",
... | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/SoftDeleteBehavior.php#L102-L119 |
titon/db | src/Titon/Db/Behavior/SoftDeleteBehavior.php | SoftDeleteBehavior.softDelete | public function softDelete($id) {
return $this->getRepository()->update($id, [
$this->getConfig('flagField') => true,
$this->getConfig('deleteField') => time()
], [
'before' => false,
'after' => false
]);
} | php | public function softDelete($id) {
return $this->getRepository()->update($id, [
$this->getConfig('flagField') => true,
$this->getConfig('deleteField') => time()
], [
'before' => false,
'after' => false
]);
} | [
"public",
"function",
"softDelete",
"(",
"$",
"id",
")",
"{",
"return",
"$",
"this",
"->",
"getRepository",
"(",
")",
"->",
"update",
"(",
"$",
"id",
",",
"[",
"$",
"this",
"->",
"getConfig",
"(",
"'flagField'",
")",
"=>",
"true",
",",
"$",
"this",
... | Perform a soft delete by marking a record as deleted and updating a timestamp.
Do not delete the actual record.
@param int|int[] $id
@return int | [
"Perform",
"a",
"soft",
"delete",
"by",
"marking",
"a",
"record",
"as",
"deleted",
"and",
"updating",
"a",
"timestamp",
".",
"Do",
"not",
"delete",
"the",
"actual",
"record",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Behavior/SoftDeleteBehavior.php#L138-L146 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.getEntityInRevision | public function getEntityInRevision($parentIdentifier, $revision, $subResource = NULL, $query = NULL) {
try {
$entity = $this->hydrateEntityInRevision($parentIdentifier, $revision);
} catch (EntityNotFoundException $e) {
throw $this->err->resourceNotFound(__FUNCTION__, 'entity', array('identifier'=>... | php | public function getEntityInRevision($parentIdentifier, $revision, $subResource = NULL, $query = NULL) {
try {
$entity = $this->hydrateEntityInRevision($parentIdentifier, $revision);
} catch (EntityNotFoundException $e) {
throw $this->err->resourceNotFound(__FUNCTION__, 'entity', array('identifier'=>... | [
"public",
"function",
"getEntityInRevision",
"(",
"$",
"parentIdentifier",
",",
"$",
"revision",
",",
"$",
"subResource",
"=",
"NULL",
",",
"$",
"query",
"=",
"NULL",
")",
"{",
"try",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"hydrateEntityInRevision",
"... | Returns a revision from the entity with the $parentIdentifier
if no revision or identifier is found an Resource Not Found HTTP Error is raised
@return Entity | [
"Returns",
"a",
"revision",
"from",
"the",
"entity",
"with",
"the",
"$parentIdentifier"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L156-L172 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.hydrateEntityInRevision | protected function hydrateEntityInRevision($parentIdentifier, $revision) {
$parentIdentifier = $this->v->validateIdentifier($parentIdentifier, $this->getEntityMeta());
if ($revision === $this->defaultRevision) {
return $this->repository->hydrate($parentIdentifier);
} else {
throw EntityNotF... | php | protected function hydrateEntityInRevision($parentIdentifier, $revision) {
$parentIdentifier = $this->v->validateIdentifier($parentIdentifier, $this->getEntityMeta());
if ($revision === $this->defaultRevision) {
return $this->repository->hydrate($parentIdentifier);
} else {
throw EntityNotF... | [
"protected",
"function",
"hydrateEntityInRevision",
"(",
"$",
"parentIdentifier",
",",
"$",
"revision",
")",
"{",
"$",
"parentIdentifier",
"=",
"$",
"this",
"->",
"v",
"->",
"validateIdentifier",
"(",
"$",
"parentIdentifier",
",",
"$",
"this",
"->",
"getEntityMe... | Returns the $revision of the entity with the $parentIdentifier
notice that the returned Entity may not have the same identifier as $parentIdentifier
@return Entity | [
"Returns",
"the",
"$revision",
"of",
"the",
"entity",
"with",
"the",
"$parentIdentifier"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L180-L188 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.saveEntity | public function saveEntity($identifier, FormData $requestData, $subResource = NULL) {
$revision = $this->defaultRevision;
$entity = $this->getEntity($identifier);
if ($subResource !== NULL && array_key_exists($subResource, $this->customActions)) {
return $this->callCustomAction($this->customActio... | php | public function saveEntity($identifier, FormData $requestData, $subResource = NULL) {
$revision = $this->defaultRevision;
$entity = $this->getEntity($identifier);
if ($subResource !== NULL && array_key_exists($subResource, $this->customActions)) {
return $this->callCustomAction($this->customActio... | [
"public",
"function",
"saveEntity",
"(",
"$",
"identifier",
",",
"FormData",
"$",
"requestData",
",",
"$",
"subResource",
"=",
"NULL",
")",
"{",
"$",
"revision",
"=",
"$",
"this",
"->",
"defaultRevision",
";",
"$",
"entity",
"=",
"$",
"this",
"->",
"getE... | Saves the Entity default Revision
@controller-api
@return Entity | [
"Saves",
"the",
"Entity",
"default",
"Revision"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L280-L289 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.saveEntityAsRevision | public function saveEntityAsRevision($parentIdentifier, $revision, FormData $requestData, $subResource = NULL) {
try {
$entity = $this->hydrateEntityInRevision($parentIdentifier, $revision);
} catch (EntityNotFoundException $e) {
$parentEntity = $this->getEntity($parentIdentifier);
$ent... | php | public function saveEntityAsRevision($parentIdentifier, $revision, FormData $requestData, $subResource = NULL) {
try {
$entity = $this->hydrateEntityInRevision($parentIdentifier, $revision);
} catch (EntityNotFoundException $e) {
$parentEntity = $this->getEntity($parentIdentifier);
$ent... | [
"public",
"function",
"saveEntityAsRevision",
"(",
"$",
"parentIdentifier",
",",
"$",
"revision",
",",
"FormData",
"$",
"requestData",
",",
"$",
"subResource",
"=",
"NULL",
")",
"{",
"try",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"hydrateEntityInRevision",... | Saves an Entity ($parentIdentifier) as a new Entity in a specific $evision
notice: think of a save as... - button
this does NOT use getEntityInRevision to retrieve the revision-entity. it uses hydrateEntityInRevision
a new Revision is created (if it does not exist in db) with createNewRevisionFrom()
@controller-api
@... | [
"Saves",
"an",
"Entity",
"(",
"$parentIdentifier",
")",
"as",
"a",
"new",
"Entity",
"in",
"a",
"specific",
"$evision"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L301-L315 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.updateEntityRevision | protected function updateEntityRevision(Entity $entity, $revision, FormData $requestData) {
$this->setRevisionMetadata($revision);
$this->beginTransaction();
// validiert und processed die daten aus requestData und setzt diese im Entity
$this->processEntityFormRequest($entity, $requestData, $r... | php | protected function updateEntityRevision(Entity $entity, $revision, FormData $requestData) {
$this->setRevisionMetadata($revision);
$this->beginTransaction();
// validiert und processed die daten aus requestData und setzt diese im Entity
$this->processEntityFormRequest($entity, $requestData, $r... | [
"protected",
"function",
"updateEntityRevision",
"(",
"Entity",
"$",
"entity",
",",
"$",
"revision",
",",
"FormData",
"$",
"requestData",
")",
"{",
"$",
"this",
"->",
"setRevisionMetadata",
"(",
"$",
"revision",
")",
";",
"$",
"this",
"->",
"beginTransaction",... | Saves the specific Entity with the $requestData in $revision
this does not create new revisions of the entity, it just stores the current with the requestdata
@return Entity | [
"Saves",
"the",
"specific",
"Entity",
"with",
"the",
"$requestData",
"in",
"$revision"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L323-L338 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.insertEntity | public function insertEntity(FormData $requestData, $subResource = NULL) {
return $this->insertEntityRevision($this->defaultRevision, $requestData, $subResource);
} | php | public function insertEntity(FormData $requestData, $subResource = NULL) {
return $this->insertEntityRevision($this->defaultRevision, $requestData, $subResource);
} | [
"public",
"function",
"insertEntity",
"(",
"FormData",
"$",
"requestData",
",",
"$",
"subResource",
"=",
"NULL",
")",
"{",
"return",
"$",
"this",
"->",
"insertEntityRevision",
"(",
"$",
"this",
"->",
"defaultRevision",
",",
"$",
"requestData",
",",
"$",
"sub... | Inserts a new Entity in default Revision
@controller-api
@return Psc\CMS\Entity | [
"Inserts",
"a",
"new",
"Entity",
"in",
"default",
"Revision"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L381-L383 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.insertEntityRevision | public function insertEntityRevision($revision, FormData $requestData, $subResource = NULL) {
$entity = $this->createEmptyEntity($revision);
if ($subResource !== NULL && array_key_exists($subResource, $this->customActions)) {
return $this->callCustomAction($this->customActions[$subResource], array($e... | php | public function insertEntityRevision($revision, FormData $requestData, $subResource = NULL) {
$entity = $this->createEmptyEntity($revision);
if ($subResource !== NULL && array_key_exists($subResource, $this->customActions)) {
return $this->callCustomAction($this->customActions[$subResource], array($e... | [
"public",
"function",
"insertEntityRevision",
"(",
"$",
"revision",
",",
"FormData",
"$",
"requestData",
",",
"$",
"subResource",
"=",
"NULL",
")",
"{",
"$",
"entity",
"=",
"$",
"this",
"->",
"createEmptyEntity",
"(",
"$",
"revision",
")",
";",
"if",
"(",
... | Inserts a new Entity in specific Revision
@controller-api | [
"Inserts",
"a",
"new",
"Entity",
"in",
"specific",
"Revision"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L390-L401 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.getEntityGrid | public function getEntityGrid(EntityMeta $entityMeta, $entities) {
$this->init(array('ev.componentMapper', 'ev.labeler'));
$panel = $this->createGridPanel($entityMeta);
$this->init(array('ev.gridPanel'));
// entities zuweisen
$panel->addEntities($entities);
return $panel;
} | php | public function getEntityGrid(EntityMeta $entityMeta, $entities) {
$this->init(array('ev.componentMapper', 'ev.labeler'));
$panel = $this->createGridPanel($entityMeta);
$this->init(array('ev.gridPanel'));
// entities zuweisen
$panel->addEntities($entities);
return $panel;
} | [
"public",
"function",
"getEntityGrid",
"(",
"EntityMeta",
"$",
"entityMeta",
",",
"$",
"entities",
")",
"{",
"$",
"this",
"->",
"init",
"(",
"array",
"(",
"'ev.componentMapper'",
",",
"'ev.labeler'",
")",
")",
";",
"$",
"panel",
"=",
"$",
"this",
"->",
"... | Der Grid ist eine pflegbare Liste in dem die Items als Buttons dargestellt werden
@controller-api | [
"Der",
"Grid",
"ist",
"eine",
"pflegbare",
"Liste",
"in",
"dem",
"die",
"Items",
"als",
"Buttons",
"dargestellt",
"werden"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L555-L565 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.saveSort | public function saveSort(Array $sortMap) {
$this->beginTransaction();
$field = $this->getSortField();
$sorts = array();
foreach ($sortMap as $sort => $identifier) {
$sorts[$identifier] = $sort+1;
$this->repository->persist(
$this->getEntity($identifier)->callSetter($field, $sort... | php | public function saveSort(Array $sortMap) {
$this->beginTransaction();
$field = $this->getSortField();
$sorts = array();
foreach ($sortMap as $sort => $identifier) {
$sorts[$identifier] = $sort+1;
$this->repository->persist(
$this->getEntity($identifier)->callSetter($field, $sort... | [
"public",
"function",
"saveSort",
"(",
"Array",
"$",
"sortMap",
")",
"{",
"$",
"this",
"->",
"beginTransaction",
"(",
")",
";",
"$",
"field",
"=",
"$",
"this",
"->",
"getSortField",
"(",
")",
";",
"$",
"sorts",
"=",
"array",
"(",
")",
";",
"foreach",... | Speichert die Reihenfolge (wenn vorhanden) für die Entities des Controllers ab
dies ist die Hilfs-Implementierung für SortingController
die Sortierung wird von 1-basierend von unten nach oben durchnummeriert
@return array $identifier => $savedSortInteger | [
"Speichert",
"die",
"Reihenfolge",
"(",
"wenn",
"vorhanden",
")",
"für",
"die",
"Entities",
"des",
"Controllers",
"ab"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L575-L591 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.getEntitySearchPanel | public function getEntitySearchPanel(EntityMeta $entityMeta, Array $query) {
$panel = $this->ev->createSearchPanel($entityMeta, $query);
$this->init(array('ev.searchPanel'));
return $panel;
} | php | public function getEntitySearchPanel(EntityMeta $entityMeta, Array $query) {
$panel = $this->ev->createSearchPanel($entityMeta, $query);
$this->init(array('ev.searchPanel'));
return $panel;
} | [
"public",
"function",
"getEntitySearchPanel",
"(",
"EntityMeta",
"$",
"entityMeta",
",",
"Array",
"$",
"query",
")",
"{",
"$",
"panel",
"=",
"$",
"this",
"->",
"ev",
"->",
"createSearchPanel",
"(",
"$",
"entityMeta",
",",
"$",
"query",
")",
";",
"$",
"th... | Der Grid ist eine pflegbare Liste in dem die Items als Buttons dargestellt werden
@param array $query noch nicht benutzt.
@controller-api | [
"Der",
"Grid",
"ist",
"eine",
"pflegbare",
"Liste",
"in",
"dem",
"die",
"Items",
"als",
"Buttons",
"dargestellt",
"werden"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L599-L604 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.createEmptyEntity | public function createEmptyEntity($revision = NULL) {
// @TODO check ob entity einen constructor hat, der parameter braucht?
$c = $this->getEntityName();
try {
$gClass = new GClass($c);
// wir rufen hier nicht den constructor auf
return $gClass->newInstance(array(), GClass... | php | public function createEmptyEntity($revision = NULL) {
// @TODO check ob entity einen constructor hat, der parameter braucht?
$c = $this->getEntityName();
try {
$gClass = new GClass($c);
// wir rufen hier nicht den constructor auf
return $gClass->newInstance(array(), GClass... | [
"public",
"function",
"createEmptyEntity",
"(",
"$",
"revision",
"=",
"NULL",
")",
"{",
"// @TODO check ob entity einen constructor hat, der parameter braucht?",
"$",
"c",
"=",
"$",
"this",
"->",
"getEntityName",
"(",
")",
";",
"try",
"{",
"$",
"gClass",
"=",
"new... | Erstellt ein leeres Entity
kann abgeleitet werden, falls der constructor von {$this->getEntityName()} Parameter braucht | [
"Erstellt",
"ein",
"leeres",
"Entity"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L624-L642 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.initGridPanel | protected function initGridPanel(\Psc\CMS\EntityGridPanel $panel) {
if ($this instanceof SortingController) {
$panel->setSortable(TRUE);
$panel->setSortableName($this->getSortField());
}
$panel->addControlColumn();
$panel->addControlButtons();
foreach ($this->getWhiteListProper... | php | protected function initGridPanel(\Psc\CMS\EntityGridPanel $panel) {
if ($this instanceof SortingController) {
$panel->setSortable(TRUE);
$panel->setSortableName($this->getSortField());
}
$panel->addControlColumn();
$panel->addControlButtons();
foreach ($this->getWhiteListProper... | [
"protected",
"function",
"initGridPanel",
"(",
"\\",
"Psc",
"\\",
"CMS",
"\\",
"EntityGridPanel",
"$",
"panel",
")",
"{",
"if",
"(",
"$",
"this",
"instanceof",
"SortingController",
")",
"{",
"$",
"panel",
"->",
"setSortable",
"(",
"TRUE",
")",
";",
"$",
... | Fügt per Default alle Whitelist Properties der Tabelle hinzu | [
"Fügt",
"per",
"Default",
"alle",
"Whitelist",
"Properties",
"der",
"Tabelle",
"hinzu"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L729-L741 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.onEntityRelationComponentCreated | protected function onEntityRelationComponentCreated(Component $component, ComponentsCreater $creater, Event $event, EntityMeta $relationEntityMeta) {
if ($component instanceof \Psc\UI\Component\ComboDropBox) {
// in der ComboDropBox werden ja fremde Entities mit Ajax geladen, d.h. wir müssen hier relatio... | php | protected function onEntityRelationComponentCreated(Component $component, ComponentsCreater $creater, Event $event, EntityMeta $relationEntityMeta) {
if ($component instanceof \Psc\UI\Component\ComboDropBox) {
// in der ComboDropBox werden ja fremde Entities mit Ajax geladen, d.h. wir müssen hier relatio... | [
"protected",
"function",
"onEntityRelationComponentCreated",
"(",
"Component",
"$",
"component",
",",
"ComponentsCreater",
"$",
"creater",
",",
"Event",
"$",
"event",
",",
"EntityMeta",
"$",
"relationEntityMeta",
")",
"{",
"if",
"(",
"$",
"component",
"instanceof",
... | Fügt Metadaten zu Relations hinzu, die z. B. die FormComboDropBox braucht | [
"Fügt",
"Metadaten",
"zu",
"Relations",
"hinzu",
"die",
"z",
".",
"B",
".",
"die",
"FormComboDropBox",
"braucht"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L761-L771 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.onComponentCreated | public function onComponentCreated(Component $component, ComponentsCreater $creater, Event $event) {
$entityMeta = $this->getEntityMeta();
$propertyMeta = $entityMeta->getPropertyMeta($event->getData()->name);
if (($hint = $propertyMeta->getHint()) !== NULL) {
$event->getData()->hint = $hint;
... | php | public function onComponentCreated(Component $component, ComponentsCreater $creater, Event $event) {
$entityMeta = $this->getEntityMeta();
$propertyMeta = $entityMeta->getPropertyMeta($event->getData()->name);
if (($hint = $propertyMeta->getHint()) !== NULL) {
$event->getData()->hint = $hint;
... | [
"public",
"function",
"onComponentCreated",
"(",
"Component",
"$",
"component",
",",
"ComponentsCreater",
"$",
"creater",
",",
"Event",
"$",
"event",
")",
"{",
"$",
"entityMeta",
"=",
"$",
"this",
"->",
"getEntityMeta",
"(",
")",
";",
"$",
"propertyMeta",
"=... | /* Interface ComponentsCreaterListener | [
"/",
"*",
"Interface",
"ComponentsCreaterListener"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L803-L823 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.trans | public function trans($key, Array $parameters = array(), $domain = NULL) {
if (!isset($domain)) $domain = 'project';
return $this->translationContainer->getTranslator()->trans($key, $parameters, $domain);
} | php | public function trans($key, Array $parameters = array(), $domain = NULL) {
if (!isset($domain)) $domain = 'project';
return $this->translationContainer->getTranslator()->trans($key, $parameters, $domain);
} | [
"public",
"function",
"trans",
"(",
"$",
"key",
",",
"Array",
"$",
"parameters",
"=",
"array",
"(",
")",
",",
"$",
"domain",
"=",
"NULL",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"domain",
")",
")",
"$",
"domain",
"=",
"'project'",
";",
"retu... | public for usage in 5.3 in closures | [
"public",
"for",
"usage",
"in",
"5",
".",
"3",
"in",
"closures"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L937-L941 |
webforge-labs/psc-cms | lib/Psc/CMS/Controller/AbstractEntityController.php | AbstractEntityController.initPropertyTranslations | protected function initPropertyTranslations($domain = NULL) {
$entityMeta = $this->getEntityMeta();
$translator = $this->translationContainer->getTranslator();
$this->on('init.labeler', function ($labeler) use ($domain, $entityMeta, $translator) {
foreach ($entityMeta->getSetMeta()->getKeys() as $pro... | php | protected function initPropertyTranslations($domain = NULL) {
$entityMeta = $this->getEntityMeta();
$translator = $this->translationContainer->getTranslator();
$this->on('init.labeler', function ($labeler) use ($domain, $entityMeta, $translator) {
foreach ($entityMeta->getSetMeta()->getKeys() as $pro... | [
"protected",
"function",
"initPropertyTranslations",
"(",
"$",
"domain",
"=",
"NULL",
")",
"{",
"$",
"entityMeta",
"=",
"$",
"this",
"->",
"getEntityMeta",
"(",
")",
";",
"$",
"translator",
"=",
"$",
"this",
"->",
"translationContainer",
"->",
"getTranslator",... | Loads translations keys for each property of the entity of the controller with labels
domain: project (if not specified)
key:
entities.<entityName>.<propertyName>
for example:
entities.news-entry.published
entities.news-entry.teaser
if property is i18n property the i18n will be stripped | [
"Loads",
"translations",
"keys",
"for",
"each",
"property",
"of",
"the",
"entity",
"of",
"the",
"controller",
"with",
"labels"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/CMS/Controller/AbstractEntityController.php#L956-L974 |
kherge-abandoned/lib-exception | src/lib/Phine/Exception/Exception.php | Exception.createUsingFormat | public static function createUsingFormat($format)
{
$previous = null;
if (1 < func_num_args()) {
$args = array_slice(func_get_args(), 1);
// extract $previous exception
if (end($args) instanceof \Exception) {
$previous = array_pop($args);
... | php | public static function createUsingFormat($format)
{
$previous = null;
if (1 < func_num_args()) {
$args = array_slice(func_get_args(), 1);
// extract $previous exception
if (end($args) instanceof \Exception) {
$previous = array_pop($args);
... | [
"public",
"static",
"function",
"createUsingFormat",
"(",
"$",
"format",
")",
"{",
"$",
"previous",
"=",
"null",
";",
"if",
"(",
"1",
"<",
"func_num_args",
"(",
")",
")",
"{",
"$",
"args",
"=",
"array_slice",
"(",
"func_get_args",
"(",
")",
",",
"1",
... | Creates a new exception using a formatted message.
A new exception is created after formatting the given arguments using
`vsprintf()`. If the last argument is an instance of the `Exception`
class, it will be used as the `$previous` exception in the new one
that is created.
@param string $format The message for... | [
"Creates",
"a",
"new",
"exception",
"using",
"a",
"formatted",
"message",
"."
] | train | https://github.com/kherge-abandoned/lib-exception/blob/3f50754bcc416df91235766cc3d5d5ce6ed6d612/src/lib/Phine/Exception/Exception.php#L26-L44 |
webforge-labs/psc-cms | lib/Psc/MailChimp/API.php | API.listSubscribe | public function listSubscribe($listId, $email, Array $mergeVars = NULL, $emailType = 'text', $doubleOptin = true, $updateExisting = false, $replaceInterests = true, $sendWelcome = true) {
$response = $this->dispatch(__FUNCTION__, array(
'id'=>$listId,
'email_address'=>$email,
'email_type'=>$emailT... | php | public function listSubscribe($listId, $email, Array $mergeVars = NULL, $emailType = 'text', $doubleOptin = true, $updateExisting = false, $replaceInterests = true, $sendWelcome = true) {
$response = $this->dispatch(__FUNCTION__, array(
'id'=>$listId,
'email_address'=>$email,
'email_type'=>$emailT... | [
"public",
"function",
"listSubscribe",
"(",
"$",
"listId",
",",
"$",
"email",
",",
"Array",
"$",
"mergeVars",
"=",
"NULL",
",",
"$",
"emailType",
"=",
"'text'",
",",
"$",
"doubleOptin",
"=",
"true",
",",
"$",
"updateExisting",
"=",
"false",
",",
"$",
"... | Subscribe the provided email to a list. By default this sends a confirmation email - you will not see new members until the link contained in it is clicked!
listSubscribe(string apikey, string id, string email_address, array merge_vars, string email_type, bool double_optin, bool update_existing, bool replace_interests... | [
"Subscribe",
"the",
"provided",
"email",
"to",
"a",
"list",
".",
"By",
"default",
"this",
"sends",
"a",
"confirmation",
"email",
"-",
"you",
"will",
"not",
"see",
"new",
"members",
"until",
"the",
"link",
"contained",
"in",
"it",
"is",
"clicked!"
] | train | https://github.com/webforge-labs/psc-cms/blob/467bfa2547e6b4fa487d2d7f35fa6cc618dbc763/lib/Psc/MailChimp/API.php#L59-L72 |
titon/db | src/Titon/Db/Query/ExprAware.php | ExprAware.expr | public static function expr($field, $operator = null, $value = null) {
return new Expr($field, $operator, $value);
} | php | public static function expr($field, $operator = null, $value = null) {
return new Expr($field, $operator, $value);
} | [
"public",
"static",
"function",
"expr",
"(",
"$",
"field",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"return",
"new",
"Expr",
"(",
"$",
"field",
",",
"$",
"operator",
",",
"$",
"value",
")",
";",
"}"
] | Instantiate a new database expression.
@param string $field
@param string $operator
@param mixed $value
@return \Titon\Db\Query\Expr | [
"Instantiate",
"a",
"new",
"database",
"expression",
"."
] | train | https://github.com/titon/db/blob/fbc5159d1ce9d2139759c9367565986981485604/src/Titon/Db/Query/ExprAware.php#L25-L27 |
rayrutjes/domain-foundation | src/UnitOfWork/AggregateRootContainer.php | AggregateRootContainer.add | public function add(AggregateRoot $aggregateRoot, EventBus $eventBus, SaveAggregateCallback $saveAggregateCallback)
{
$previouslyRegisteredAggregateRoot = $this->findSimilarAggregateRoot($aggregateRoot);
if (null !== $previouslyRegisteredAggregateRoot) {
return $previouslyRegisteredAggre... | php | public function add(AggregateRoot $aggregateRoot, EventBus $eventBus, SaveAggregateCallback $saveAggregateCallback)
{
$previouslyRegisteredAggregateRoot = $this->findSimilarAggregateRoot($aggregateRoot);
if (null !== $previouslyRegisteredAggregateRoot) {
return $previouslyRegisteredAggre... | [
"public",
"function",
"add",
"(",
"AggregateRoot",
"$",
"aggregateRoot",
",",
"EventBus",
"$",
"eventBus",
",",
"SaveAggregateCallback",
"$",
"saveAggregateCallback",
")",
"{",
"$",
"previouslyRegisteredAggregateRoot",
"=",
"$",
"this",
"->",
"findSimilarAggregateRoot",... | @param AggregateRoot $aggregateRoot
@param EventBus $eventBus
@param SaveAggregateCallback $saveAggregateCallback
@return AggregateRoot | [
"@param",
"AggregateRoot",
"$aggregateRoot",
"@param",
"EventBus",
"$eventBus",
"@param",
"SaveAggregateCallback",
"$saveAggregateCallback"
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/UnitOfWork/AggregateRootContainer.php#L40-L55 |
rayrutjes/domain-foundation | src/UnitOfWork/AggregateRootContainer.php | AggregateRootContainer.saveAggregateRoots | public function saveAggregateRoots()
{
foreach ($this->aggregateRoots as $aggregateRootHash => $aggregateRoot) {
$this->aggregateRootSaveCallbacks[$aggregateRootHash]->save($aggregateRoot);
}
} | php | public function saveAggregateRoots()
{
foreach ($this->aggregateRoots as $aggregateRootHash => $aggregateRoot) {
$this->aggregateRootSaveCallbacks[$aggregateRootHash]->save($aggregateRoot);
}
} | [
"public",
"function",
"saveAggregateRoots",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"aggregateRoots",
"as",
"$",
"aggregateRootHash",
"=>",
"$",
"aggregateRoot",
")",
"{",
"$",
"this",
"->",
"aggregateRootSaveCallbacks",
"[",
"$",
"aggregateRootHash",
... | Triggers all saving callbacks on all staged aggregates. | [
"Triggers",
"all",
"saving",
"callbacks",
"on",
"all",
"staged",
"aggregates",
"."
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/UnitOfWork/AggregateRootContainer.php#L68-L73 |
rayrutjes/domain-foundation | src/UnitOfWork/AggregateRootContainer.php | AggregateRootContainer.findSimilarAggregateRoot | private function findSimilarAggregateRoot(AggregateRoot $aggregateRoot)
{
foreach ($this->aggregateRoots as $registeredAggregateRoot) {
if ($registeredAggregateRoot->sameIdentityAs($aggregateRoot)) {
return $registeredAggregateRoot;
}
}
return;
} | php | private function findSimilarAggregateRoot(AggregateRoot $aggregateRoot)
{
foreach ($this->aggregateRoots as $registeredAggregateRoot) {
if ($registeredAggregateRoot->sameIdentityAs($aggregateRoot)) {
return $registeredAggregateRoot;
}
}
return;
} | [
"private",
"function",
"findSimilarAggregateRoot",
"(",
"AggregateRoot",
"$",
"aggregateRoot",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"aggregateRoots",
"as",
"$",
"registeredAggregateRoot",
")",
"{",
"if",
"(",
"$",
"registeredAggregateRoot",
"->",
"sameIdenti... | @param AggregateRoot $aggregateRoot
@return AggregateRoot|null | [
"@param",
"AggregateRoot",
"$aggregateRoot"
] | train | https://github.com/rayrutjes/domain-foundation/blob/2bce7cd6a6612f718e70e3176589c1abf39d1a3e/src/UnitOfWork/AggregateRootContainer.php#L80-L89 |
opis/http | src/MimeType.php | MimeType.get | public static function get(string $file, bool $guess = true): string
{
if($guess === true) {
$extension = pathinfo($file, PATHINFO_EXTENSION);
if(isset(self::$defaultMime[$extension])) {
return self::$defaultMime[$extension];
}
}
// Get mi... | php | public static function get(string $file, bool $guess = true): string
{
if($guess === true) {
$extension = pathinfo($file, PATHINFO_EXTENSION);
if(isset(self::$defaultMime[$extension])) {
return self::$defaultMime[$extension];
}
}
// Get mi... | [
"public",
"static",
"function",
"get",
"(",
"string",
"$",
"file",
",",
"bool",
"$",
"guess",
"=",
"true",
")",
":",
"string",
"{",
"if",
"(",
"$",
"guess",
"===",
"true",
")",
"{",
"$",
"extension",
"=",
"pathinfo",
"(",
"$",
"file",
",",
"PATHINF... | Returns the mime type of a file.
@param string $file Full path to the file
@param boolean $guess (optional) Set to false to disable mime type guessing
@return string | [
"Returns",
"the",
"mime",
"type",
"of",
"a",
"file",
"."
] | train | https://github.com/opis/http/blob/70b813ba97d65b53fad3fb58b800add8b10d7291/src/MimeType.php#L805-L824 |
whisller/IrcBotBundle | EventListener/Plugins/Commands/SeenCommandListener.php | SeenCommandListener.onCommand | public function onCommand(BotCommandFoundEvent $event)
{
$arguments = $event->getArguments();
if (!isset($arguments[0])) {
$this->noNickname($event);
} else {
$seen = $this->readFromSeen($arguments[0]);
if ($seen) {
$this->sendMessage(arra... | php | public function onCommand(BotCommandFoundEvent $event)
{
$arguments = $event->getArguments();
if (!isset($arguments[0])) {
$this->noNickname($event);
} else {
$seen = $this->readFromSeen($arguments[0]);
if ($seen) {
$this->sendMessage(arra... | [
"public",
"function",
"onCommand",
"(",
"BotCommandFoundEvent",
"$",
"event",
")",
"{",
"$",
"arguments",
"=",
"$",
"event",
"->",
"getArguments",
"(",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"arguments",
"[",
"0",
"]",
")",
")",
"{",
"$",
"this... | {@inheritdoc} | [
"{"
] | train | https://github.com/whisller/IrcBotBundle/blob/d8bcafc1599cbbc7756b0a59f51ee988a2de0f2e/EventListener/Plugins/Commands/SeenCommandListener.php#L24-L38 |
aedart/laravel-helpers | src/Traits/Mail/MailQueueTrait.php | MailQueueTrait.getMailQueue | public function getMailQueue(): ?MailQueue
{
if (!$this->hasMailQueue()) {
$this->setMailQueue($this->getDefaultMailQueue());
}
return $this->mailQueue;
} | php | public function getMailQueue(): ?MailQueue
{
if (!$this->hasMailQueue()) {
$this->setMailQueue($this->getDefaultMailQueue());
}
return $this->mailQueue;
} | [
"public",
"function",
"getMailQueue",
"(",
")",
":",
"?",
"MailQueue",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasMailQueue",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setMailQueue",
"(",
"$",
"this",
"->",
"getDefaultMailQueue",
"(",
")",
")",
";",
"... | Get mail queue
If no mail queue has been set, this method will
set and return a default mail queue, if any such
value is available
@see getDefaultMailQueue()
@return MailQueue|null mail queue or null if none mail queue has been set | [
"Get",
"mail",
"queue"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Mail/MailQueueTrait.php#L53-L59 |
dunkelfrosch/phpcoverfish | src/PHPCoverFish/Common/CoverFishColor.php | CoverFishColor.setColor | public static function setColor($color, $string)
{
if (!isset(self::$colorTable[$color]))
{
throw new \Exception('ansi color is not defined');
}
return sprintf("\033[%sm%s\033[0m", self::$colorTable[$color], $string);
} | php | public static function setColor($color, $string)
{
if (!isset(self::$colorTable[$color]))
{
throw new \Exception('ansi color is not defined');
}
return sprintf("\033[%sm%s\033[0m", self::$colorTable[$color], $string);
} | [
"public",
"static",
"function",
"setColor",
"(",
"$",
"color",
",",
"$",
"string",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"self",
"::",
"$",
"colorTable",
"[",
"$",
"color",
"]",
")",
")",
"{",
"throw",
"new",
"\\",
"Exception",
"(",
"'ansi color is... | Make string appear in color
@param string $color
@param string $string
@return string
@throws \Exception | [
"Make",
"string",
"appear",
"in",
"color"
] | train | https://github.com/dunkelfrosch/phpcoverfish/blob/779bd399ec8f4cadb3b7854200695c5eb3f5a8ad/src/PHPCoverFish/Common/CoverFishColor.php#L63-L71 |
nguyenanhung/nusoap | src/nusoap_wsdlcache.php | nusoap_wsdlcache.get | function get($wsdl)
{
$filename = $this->createFilename($wsdl);
if ($this->obtainMutex($filename, "r")) {
// check for expired WSDL that must be removed from the cache
if ($this->cache_lifetime > 0) {
if (file_exists($filename) && (time() - filemtime($fi... | php | function get($wsdl)
{
$filename = $this->createFilename($wsdl);
if ($this->obtainMutex($filename, "r")) {
// check for expired WSDL that must be removed from the cache
if ($this->cache_lifetime > 0) {
if (file_exists($filename) && (time() - filemtime($fi... | [
"function",
"get",
"(",
"$",
"wsdl",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"createFilename",
"(",
"$",
"wsdl",
")",
";",
"if",
"(",
"$",
"this",
"->",
"obtainMutex",
"(",
"$",
"filename",
",",
"\"r\"",
")",
")",
"{",
"// check for expire... | gets a wsdl instance from the cache
@param string $wsdl The URL of the wsdl instance
@return object wsdl The cached wsdl instance, null if the instance is not in the cache
@access public | [
"gets",
"a",
"wsdl",
"instance",
"from",
"the",
"cache"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src/nusoap_wsdlcache.php#L92-L130 |
nguyenanhung/nusoap | src/nusoap_wsdlcache.php | nusoap_wsdlcache.obtainMutex | function obtainMutex($filename, $mode)
{
if (isset($this->fplock[md5($filename)])) {
$this->debug("Lock for $filename already exists");
return FALSE;
}
$this->fplock[md5($filename)] = fopen($filename . ".lock", "w");
if ($mode == "r") {
r... | php | function obtainMutex($filename, $mode)
{
if (isset($this->fplock[md5($filename)])) {
$this->debug("Lock for $filename already exists");
return FALSE;
}
$this->fplock[md5($filename)] = fopen($filename . ".lock", "w");
if ($mode == "r") {
r... | [
"function",
"obtainMutex",
"(",
"$",
"filename",
",",
"$",
"mode",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"fplock",
"[",
"md5",
"(",
"$",
"filename",
")",
"]",
")",
")",
"{",
"$",
"this",
"->",
"debug",
"(",
"\"Lock for $filename alrea... | obtains the local mutex
@param string $filename The Filename of the Cache to lock
@param string $mode The open-mode ("r" or "w") or the file - affects lock-mode
@return boolean Lock successfully obtained ?!
@access private | [
"obtains",
"the",
"local",
"mutex"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src/nusoap_wsdlcache.php#L141-L154 |
nguyenanhung/nusoap | src/nusoap_wsdlcache.php | nusoap_wsdlcache.put | function put($wsdl_instance)
{
$filename = $this->createFilename($wsdl_instance->wsdl);
$s = serialize($wsdl_instance);
if ($this->obtainMutex($filename, "w")) {
$fp = fopen($filename, "w");
if (!$fp) {
$this->debug("Cannot write $wsdl_in... | php | function put($wsdl_instance)
{
$filename = $this->createFilename($wsdl_instance->wsdl);
$s = serialize($wsdl_instance);
if ($this->obtainMutex($filename, "w")) {
$fp = fopen($filename, "w");
if (!$fp) {
$this->debug("Cannot write $wsdl_in... | [
"function",
"put",
"(",
"$",
"wsdl_instance",
")",
"{",
"$",
"filename",
"=",
"$",
"this",
"->",
"createFilename",
"(",
"$",
"wsdl_instance",
"->",
"wsdl",
")",
";",
"$",
"s",
"=",
"serialize",
"(",
"$",
"wsdl_instance",
")",
";",
"if",
"(",
"$",
"th... | adds a wsdl instance to the cache
@param object wsdl $wsdl_instance The wsdl instance to add
@return boolean WSDL successfully cached
@access public | [
"adds",
"a",
"wsdl",
"instance",
"to",
"the",
"cache"
] | train | https://github.com/nguyenanhung/nusoap/blob/a9b4d98f4f3fe748f8e5d9f8091dfc53585d2556/src/nusoap_wsdlcache.php#L164-L187 |
forxer/tao | src/Tao/Database/Model.php | Model.has | public function has($primaryKey, $column = null)
{
if (null === $column) {
$column = $this->getPrimaryKey();
}
return (boolean)$this->app['db']->fetchColumn(
'SELECT COUNT(:column) FROM ' . $this->getTable() . ' WHERE '.$this->getPrimaryKey().' = :pk',
[
... | php | public function has($primaryKey, $column = null)
{
if (null === $column) {
$column = $this->getPrimaryKey();
}
return (boolean)$this->app['db']->fetchColumn(
'SELECT COUNT(:column) FROM ' . $this->getTable() . ' WHERE '.$this->getPrimaryKey().' = :pk',
[
... | [
"public",
"function",
"has",
"(",
"$",
"primaryKey",
",",
"$",
"column",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"column",
")",
"{",
"$",
"column",
"=",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
";",
"}",
"return",
"(",
"boolean",... | Indicate if a given entry exists.
@param mixed $primaryKey
@param string $column
@return boolean | [
"Indicate",
"if",
"a",
"given",
"entry",
"exists",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Database/Model.php#L49-L62 |
forxer/tao | src/Tao/Database/Model.php | Model.insert | public function insert(array $data)
{
$this->normalizeDataColumns($data);
$this->setSearchIndexableData($data);
return $this->app['db']->insert($this->getTable(), $data);
} | php | public function insert(array $data)
{
$this->normalizeDataColumns($data);
$this->setSearchIndexableData($data);
return $this->app['db']->insert($this->getTable(), $data);
} | [
"public",
"function",
"insert",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"this",
"->",
"normalizeDataColumns",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"setSearchIndexableData",
"(",
"$",
"data",
")",
";",
"return",
"$",
"this",
"->",
"app",
"["... | Insert an entry.
@param array $data | [
"Insert",
"an",
"entry",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Database/Model.php#L69-L76 |
forxer/tao | src/Tao/Database/Model.php | Model.update | public function update(array $data, $primaryKey)
{
$this->normalizeDataColumns($data);
$this->setSearchIndexableData($data);
return $this->app['db']->update($this->getTable(), $data, [ $this->getPrimaryKey() => $primaryKey]);
} | php | public function update(array $data, $primaryKey)
{
$this->normalizeDataColumns($data);
$this->setSearchIndexableData($data);
return $this->app['db']->update($this->getTable(), $data, [ $this->getPrimaryKey() => $primaryKey]);
} | [
"public",
"function",
"update",
"(",
"array",
"$",
"data",
",",
"$",
"primaryKey",
")",
"{",
"$",
"this",
"->",
"normalizeDataColumns",
"(",
"$",
"data",
")",
";",
"$",
"this",
"->",
"setSearchIndexableData",
"(",
"$",
"data",
")",
";",
"return",
"$",
... | Update an entry.
@param array $data
@param mixed $primaryKey | [
"Update",
"an",
"entry",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Database/Model.php#L84-L91 |
forxer/tao | src/Tao/Database/Model.php | Model.delete | public function delete($primaryKey)
{
return $this->app['db']->delete($this->getTable(), [ $this->getPrimaryKey() => $primaryKey]);
} | php | public function delete($primaryKey)
{
return $this->app['db']->delete($this->getTable(), [ $this->getPrimaryKey() => $primaryKey]);
} | [
"public",
"function",
"delete",
"(",
"$",
"primaryKey",
")",
"{",
"return",
"$",
"this",
"->",
"app",
"[",
"'db'",
"]",
"->",
"delete",
"(",
"$",
"this",
"->",
"getTable",
"(",
")",
",",
"[",
"$",
"this",
"->",
"getPrimaryKey",
"(",
")",
"=>",
"$",... | Delete an entry.
@param mixed $primaryKey | [
"Delete",
"an",
"entry",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Database/Model.php#L98-L101 |
forxer/tao | src/Tao/Database/Model.php | Model.getColumns | public function getColumns($bWithoutForeignKey = true, $bAliased = true, $bPrefixed = false)
{
$aColumns = $this->columns;
if ($bWithoutForeignKey) {
$aColumns = $this->removeForeignKeyColumns($aColumns);
}
if ($bAliased) {
$aColumns = $this->aliaseColumns($... | php | public function getColumns($bWithoutForeignKey = true, $bAliased = true, $bPrefixed = false)
{
$aColumns = $this->columns;
if ($bWithoutForeignKey) {
$aColumns = $this->removeForeignKeyColumns($aColumns);
}
if ($bAliased) {
$aColumns = $this->aliaseColumns($... | [
"public",
"function",
"getColumns",
"(",
"$",
"bWithoutForeignKey",
"=",
"true",
",",
"$",
"bAliased",
"=",
"true",
",",
"$",
"bPrefixed",
"=",
"false",
")",
"{",
"$",
"aColumns",
"=",
"$",
"this",
"->",
"columns",
";",
"if",
"(",
"$",
"bWithoutForeignKe... | Get the columns names.
@param boolean $bWithoutForeignKey Return with or without foreign keys.
@param boolean $bAliased Return or not aliased columns names.
@param boolean $bPrefixed Return or not prefixed columns names.
@return array | [
"Get",
"the",
"columns",
"names",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Database/Model.php#L187-L204 |
forxer/tao | src/Tao/Database/Model.php | Model.getPrimaryKey | public function getPrimaryKey($bAliased = false)
{
return $bAliased
? $this->getAlias() . '.' . $this->primaryKey
: $this->primaryKey;
} | php | public function getPrimaryKey($bAliased = false)
{
return $bAliased
? $this->getAlias() . '.' . $this->primaryKey
: $this->primaryKey;
} | [
"public",
"function",
"getPrimaryKey",
"(",
"$",
"bAliased",
"=",
"false",
")",
"{",
"return",
"$",
"bAliased",
"?",
"$",
"this",
"->",
"getAlias",
"(",
")",
".",
"'.'",
".",
"$",
"this",
"->",
"primaryKey",
":",
"$",
"this",
"->",
"primaryKey",
";",
... | Get the table primary key.
@param boolean $bAliased Return or not aliased primary key.
@return string | [
"Get",
"the",
"table",
"primary",
"key",
"."
] | train | https://github.com/forxer/tao/blob/b5e9109c244a29a72403ae6a58633ab96a67c660/src/Tao/Database/Model.php#L222-L227 |
yuncms/framework | src/behaviors/JsonBehavior.php | JsonBehavior.initialization | protected function initialization()
{
foreach ($this->attributes as $attribute) {
$this->owner->setAttribute($attribute, new JsonObject());
}
} | php | protected function initialization()
{
foreach ($this->attributes as $attribute) {
$this->owner->setAttribute($attribute, new JsonObject());
}
} | [
"protected",
"function",
"initialization",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"attributes",
"as",
"$",
"attribute",
")",
"{",
"$",
"this",
"->",
"owner",
"->",
"setAttribute",
"(",
"$",
"attribute",
",",
"new",
"JsonObject",
"(",
")",
")",... | 初始化 | [
"初始化"
] | train | https://github.com/yuncms/framework/blob/af42e28ea4ae15ab8eead3f6d119f93863b94154/src/behaviors/JsonBehavior.php#L77-L82 |
nexusnetsoftgmbh/nexuscli | src/Nexus/CustomCommand/Business/CustomCommandFacade.php | CustomCommandFacade.hydrateCommands | public function hydrateCommands(array $commands, string $directory, bool $recursive): array
{
return $this->getFactory()->createCommandHydrator($directory, $recursive)->hydrateCommands($commands);
} | php | public function hydrateCommands(array $commands, string $directory, bool $recursive): array
{
return $this->getFactory()->createCommandHydrator($directory, $recursive)->hydrateCommands($commands);
} | [
"public",
"function",
"hydrateCommands",
"(",
"array",
"$",
"commands",
",",
"string",
"$",
"directory",
",",
"bool",
"$",
"recursive",
")",
":",
"array",
"{",
"return",
"$",
"this",
"->",
"getFactory",
"(",
")",
"->",
"createCommandHydrator",
"(",
"$",
"d... | @param array $commands
@param string $directory
@param bool $recursive
@return array | [
"@param",
"array",
"$commands",
"@param",
"string",
"$directory",
"@param",
"bool",
"$recursive"
] | train | https://github.com/nexusnetsoftgmbh/nexuscli/blob/8416b43d31ad56ea379ae2b0bf85d456e78ba67a/src/Nexus/CustomCommand/Business/CustomCommandFacade.php#L21-L24 |
PeekAndPoke/psi | src/Operation/Terminal/MaxOperation.php | MaxOperation.apply | public function apply(\Iterator $set)
{
$data = iterator_to_array($set);
return count($data) > 0 ? max($data) : 0;
} | php | public function apply(\Iterator $set)
{
$data = iterator_to_array($set);
return count($data) > 0 ? max($data) : 0;
} | [
"public",
"function",
"apply",
"(",
"\\",
"Iterator",
"$",
"set",
")",
"{",
"$",
"data",
"=",
"iterator_to_array",
"(",
"$",
"set",
")",
";",
"return",
"count",
"(",
"$",
"data",
")",
">",
"0",
"?",
"max",
"(",
"$",
"data",
")",
":",
"0",
";",
... | {@inheritdoc}
@return float | [
"{",
"@inheritdoc",
"}"
] | train | https://github.com/PeekAndPoke/psi/blob/cfd45d995d3a2c2ea6ba5b1ce7b5fcc71179456f/src/Operation/Terminal/MaxOperation.php#L24-L29 |
lelivrescolaire/SQSBundle | DependencyInjection/LLSSQSExtension.php | LLSSQSExtension.loadQueues | public function loadQueues(ContainerBuilder $container, array $config)
{
foreach ($config as $name => $attributes) {
$container
->setDefinition(
self::getQueueServiceKey($name),
new Definition(
$container->getParamet... | php | public function loadQueues(ContainerBuilder $container, array $config)
{
foreach ($config as $name => $attributes) {
$container
->setDefinition(
self::getQueueServiceKey($name),
new Definition(
$container->getParamet... | [
"public",
"function",
"loadQueues",
"(",
"ContainerBuilder",
"$",
"container",
",",
"array",
"$",
"config",
")",
"{",
"foreach",
"(",
"$",
"config",
"as",
"$",
"name",
"=>",
"$",
"attributes",
")",
"{",
"$",
"container",
"->",
"setDefinition",
"(",
"self",... | Load queues from user configuration
@param ContainerBuilder $container SF2 Container Builder
@param array $config Configuration array
@return {$this} | [
"Load",
"queues",
"from",
"user",
"configuration"
] | train | https://github.com/lelivrescolaire/SQSBundle/blob/bba3fa6d63d0ae1bddbc7b2fe3c2e737f49d6559/DependencyInjection/LLSSQSExtension.php#L46-L66 |
aedart/config-loader | src/Traits/ConfigLoaderTrait.php | ConfigLoaderTrait.getConfigLoader | public function getConfigLoader(): ?ConfigLoader
{
if (!$this->hasConfigLoader()) {
$this->setConfigLoader($this->getDefaultConfigLoader());
}
return $this->configLoader;
} | php | public function getConfigLoader(): ?ConfigLoader
{
if (!$this->hasConfigLoader()) {
$this->setConfigLoader($this->getDefaultConfigLoader());
}
return $this->configLoader;
} | [
"public",
"function",
"getConfigLoader",
"(",
")",
":",
"?",
"ConfigLoader",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasConfigLoader",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setConfigLoader",
"(",
"$",
"this",
"->",
"getDefaultConfigLoader",
"(",
")",
... | Get config loader
If no config loader has been set, this method will
set and return a default config loader, if any such
value is available
@see getDefaultConfigLoader()
@return ConfigLoader|null config loader or null if none config loader has been set | [
"Get",
"config",
"loader"
] | train | https://github.com/aedart/config-loader/blob/9e1cf592bee46ba4930bb9c352aaf475d81266ea/src/Traits/ConfigLoaderTrait.php#L53-L59 |
ruvents/ruwork-upload-bundle | Form/DataMapper/UploadMapper.php | UploadMapper.mapFormsToData | public function mapFormsToData($forms, &$data)
{
/** @var FormInterface[] $formsArray */
$formsArray = iterator_to_array($forms);
$fileForm = $formsArray[$this->fileName];
$pathForm = $formsArray[$this->pathName];
if (!$fileForm->isEmpty()) {
$form = $fileForm->g... | php | public function mapFormsToData($forms, &$data)
{
/** @var FormInterface[] $formsArray */
$formsArray = iterator_to_array($forms);
$fileForm = $formsArray[$this->fileName];
$pathForm = $formsArray[$this->pathName];
if (!$fileForm->isEmpty()) {
$form = $fileForm->g... | [
"public",
"function",
"mapFormsToData",
"(",
"$",
"forms",
",",
"&",
"$",
"data",
")",
"{",
"/** @var FormInterface[] $formsArray */",
"$",
"formsArray",
"=",
"iterator_to_array",
"(",
"$",
"forms",
")",
";",
"$",
"fileForm",
"=",
"$",
"formsArray",
"[",
"$",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/ruvents/ruwork-upload-bundle/blob/8ad09cc2dce6ab389105c440d791346696da43af/Form/DataMapper/UploadMapper.php#L55-L75 |
steeffeen/FancyManiaLinks | FML/Script/Features/Tooltip.php | Tooltip.setHoverControl | public function setHoverControl(Control $hoverControl)
{
$hoverControl->checkId();
if ($hoverControl instanceof Scriptable) {
$hoverControl->setScriptEvents(true);
}
$this->hoverControl = $hoverControl;
return $this;
} | php | public function setHoverControl(Control $hoverControl)
{
$hoverControl->checkId();
if ($hoverControl instanceof Scriptable) {
$hoverControl->setScriptEvents(true);
}
$this->hoverControl = $hoverControl;
return $this;
} | [
"public",
"function",
"setHoverControl",
"(",
"Control",
"$",
"hoverControl",
")",
"{",
"$",
"hoverControl",
"->",
"checkId",
"(",
")",
";",
"if",
"(",
"$",
"hoverControl",
"instanceof",
"Scriptable",
")",
"{",
"$",
"hoverControl",
"->",
"setScriptEvents",
"("... | Set the Hover Control
@api
@param Control $hoverControl Hover Control
@return static | [
"Set",
"the",
"Hover",
"Control"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Tooltip.php#L94-L102 |
steeffeen/FancyManiaLinks | FML/Script/Features/Tooltip.php | Tooltip.setTooltipControl | public function setTooltipControl(Control $tooltipControl)
{
$tooltipControl->checkId();
$tooltipControl->setVisible(false);
$this->tooltipControl = $tooltipControl;
return $this;
} | php | public function setTooltipControl(Control $tooltipControl)
{
$tooltipControl->checkId();
$tooltipControl->setVisible(false);
$this->tooltipControl = $tooltipControl;
return $this;
} | [
"public",
"function",
"setTooltipControl",
"(",
"Control",
"$",
"tooltipControl",
")",
"{",
"$",
"tooltipControl",
"->",
"checkId",
"(",
")",
";",
"$",
"tooltipControl",
"->",
"setVisible",
"(",
"false",
")",
";",
"$",
"this",
"->",
"tooltipControl",
"=",
"$... | Set the Tooltip Control
@api
@param Control $tooltipControl Tooltip Control
@return static | [
"Set",
"the",
"Tooltip",
"Control"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/Script/Features/Tooltip.php#L122-L128 |
aedart/laravel-helpers | src/Traits/Routing/URLTrait.php | URLTrait.getUrl | public function getUrl(): ?UrlGenerator
{
if (!$this->hasUrl()) {
$this->setUrl($this->getDefaultUrl());
}
return $this->url;
} | php | public function getUrl(): ?UrlGenerator
{
if (!$this->hasUrl()) {
$this->setUrl($this->getDefaultUrl());
}
return $this->url;
} | [
"public",
"function",
"getUrl",
"(",
")",
":",
"?",
"UrlGenerator",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasUrl",
"(",
")",
")",
"{",
"$",
"this",
"->",
"setUrl",
"(",
"$",
"this",
"->",
"getDefaultUrl",
"(",
")",
")",
";",
"}",
"return",
"$"... | Get url
If no url has been set, this method will
set and return a default url, if any such
value is available
@see getDefaultUrl()
@return UrlGenerator|null url or null if none url has been set | [
"Get",
"url"
] | train | https://github.com/aedart/laravel-helpers/blob/8b81a2d6658f3f8cb62b6be2c34773aaa2df219a/src/Traits/Routing/URLTrait.php#L53-L59 |
cohesion/cohesion-core | src/Util/Email.php | Email.sendEmail | public function sendEmail($to, $view, $vars = null, $subject = null, $params = null) {
if (!($view instanceof EmailView)) {
$view = $this->generateView($view);
}
if (!$subject) {
$subject = $view->getSubject();
}
if (!$subject) {
throw new Inva... | php | public function sendEmail($to, $view, $vars = null, $subject = null, $params = null) {
if (!($view instanceof EmailView)) {
$view = $this->generateView($view);
}
if (!$subject) {
$subject = $view->getSubject();
}
if (!$subject) {
throw new Inva... | [
"public",
"function",
"sendEmail",
"(",
"$",
"to",
",",
"$",
"view",
",",
"$",
"vars",
"=",
"null",
",",
"$",
"subject",
"=",
"null",
",",
"$",
"params",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"(",
"$",
"view",
"instanceof",
"EmailView",
")",
")"... | Send an email.
Uses named parameters
@param $to mixed Either an email address or an array of addresses
@param $view string Optional view name
@param $vars array Optional array of additional vars to be rendered
@param $subject string The email subject
@param $params array additional parameters
cc mixed Same as the to f... | [
"Send",
"an",
"email",
"."
] | train | https://github.com/cohesion/cohesion-core/blob/c6352aef7336e06285f0943da68235dc45523998/src/Util/Email.php#L52-L119 |
voda/php-translator | Antee/i18n/NetteTranslator.php | NetteTranslator.addTranslationContext | public static function addTranslationContext($value, $context) {
if (is_array($value) || $value instanceof Traversable) {
$array = array();
foreach ($value as $key => $string) {
$array[$key] = self::addTranslationContext($string, $context);
}
return $array;
}
return (string)$context . chr(4) . (st... | php | public static function addTranslationContext($value, $context) {
if (is_array($value) || $value instanceof Traversable) {
$array = array();
foreach ($value as $key => $string) {
$array[$key] = self::addTranslationContext($string, $context);
}
return $array;
}
return (string)$context . chr(4) . (st... | [
"public",
"static",
"function",
"addTranslationContext",
"(",
"$",
"value",
",",
"$",
"context",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"value",
")",
"||",
"$",
"value",
"instanceof",
"Traversable",
")",
"{",
"$",
"array",
"=",
"array",
"(",
")",
"... | Add context to given string(s).
@param string|array|Traversable $value
@param string $context
@return string|array
@throws InvalidArgumentException | [
"Add",
"context",
"to",
"given",
"string",
"(",
"s",
")",
"."
] | train | https://github.com/voda/php-translator/blob/b1890ce89f7185b8958e6cf89cf2ad231d5e5f58/Antee/i18n/NetteTranslator.php#L57-L66 |
voda/php-translator | Antee/i18n/NetteTranslator.php | NetteTranslator.translate | public function translate($message, $count = null) {
$isContext = false;
$context = "";
$plural = "";
$isPlural = is_array($message);
if ($isPlural) {
list($message, $plural) = $message;
}
if (strpos($message, chr(4)) !== false) {
$isContext = true;
list ($context, $message) = explode(chr(4), $me... | php | public function translate($message, $count = null) {
$isContext = false;
$context = "";
$plural = "";
$isPlural = is_array($message);
if ($isPlural) {
list($message, $plural) = $message;
}
if (strpos($message, chr(4)) !== false) {
$isContext = true;
list ($context, $message) = explode(chr(4), $me... | [
"public",
"function",
"translate",
"(",
"$",
"message",
",",
"$",
"count",
"=",
"null",
")",
"{",
"$",
"isContext",
"=",
"false",
";",
"$",
"context",
"=",
"\"\"",
";",
"$",
"plural",
"=",
"\"\"",
";",
"$",
"isPlural",
"=",
"is_array",
"(",
"$",
"m... | * \Nette\ITranslator ************************************************** | [
"*",
"\\",
"Nette",
"\\",
"ITranslator",
"**************************************************"
] | train | https://github.com/voda/php-translator/blob/b1890ce89f7185b8958e6cf89cf2ad231d5e5f58/Antee/i18n/NetteTranslator.php#L70-L99 |
steeffeen/FancyManiaLinks | FML/ManiaCode/JoinServer.php | JoinServer.setLogin | public function setLogin($login)
{
$this->login = (string)$login;
$this->ip = null;
$this->port = null;
return $this;
} | php | public function setLogin($login)
{
$this->login = (string)$login;
$this->ip = null;
$this->port = null;
return $this;
} | [
"public",
"function",
"setLogin",
"(",
"$",
"login",
")",
"{",
"$",
"this",
"->",
"login",
"=",
"(",
"string",
")",
"$",
"login",
";",
"$",
"this",
"->",
"ip",
"=",
"null",
";",
"$",
"this",
"->",
"port",
"=",
"null",
";",
"return",
"$",
"this",
... | Set the server login
@api
@param string $login Server login
@return static | [
"Set",
"the",
"server",
"login"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode/JoinServer.php#L77-L83 |
steeffeen/FancyManiaLinks | FML/ManiaCode/JoinServer.php | JoinServer.setIp | public function setIp($ip, $port = null)
{
$this->login = null;
$this->ip = (string)$ip;
if ($port) {
$this->setPort($port);
}
return $this;
} | php | public function setIp($ip, $port = null)
{
$this->login = null;
$this->ip = (string)$ip;
if ($port) {
$this->setPort($port);
}
return $this;
} | [
"public",
"function",
"setIp",
"(",
"$",
"ip",
",",
"$",
"port",
"=",
"null",
")",
"{",
"$",
"this",
"->",
"login",
"=",
"null",
";",
"$",
"this",
"->",
"ip",
"=",
"(",
"string",
")",
"$",
"ip",
";",
"if",
"(",
"$",
"port",
")",
"{",
"$",
"... | Set the server ip and port
@api
@param string $ip Server ip
@param int $port (optional) Server port
@return static | [
"Set",
"the",
"server",
"ip",
"and",
"port"
] | train | https://github.com/steeffeen/FancyManiaLinks/blob/227b0759306f0a3c75873ba50276e4163a93bfa6/FML/ManiaCode/JoinServer.php#L104-L112 |
hametuha/gapiwp | src/Hametuha/GapiWP/Service/Prototype.php | Prototype.show_message | protected function show_message($msg, $error = false){
add_action("admin_notices", function() use($msg, $error){
printf('<div class="%s"><p>%s</p></div>', $error ? 'error' : 'updated', esc_html($msg) );
});
} | php | protected function show_message($msg, $error = false){
add_action("admin_notices", function() use($msg, $error){
printf('<div class="%s"><p>%s</p></div>', $error ? 'error' : 'updated', esc_html($msg) );
});
} | [
"protected",
"function",
"show_message",
"(",
"$",
"msg",
",",
"$",
"error",
"=",
"false",
")",
"{",
"add_action",
"(",
"\"admin_notices\"",
",",
"function",
"(",
")",
"use",
"(",
"$",
"msg",
",",
"$",
"error",
")",
"{",
"printf",
"(",
"'<div class=\"%s\... | Show message on admin screen
@param string $msg
@param bool $error | [
"Show",
"message",
"on",
"admin",
"screen"
] | train | https://github.com/hametuha/gapiwp/blob/7b9716d0ebd54c4ab79cca94a4c5aef099a54266/src/Hametuha/GapiWP/Service/Prototype.php#L31-L35 |
boekkooi/tactician-amqp | src/Publisher/ExchangePublisher.php | ExchangePublisher.publish | public function publish(Message $message)
{
$exchange = $this->getExchange($message);
if (!$exchange instanceof \AMQPExchange) {
throw MissingExchangeException::forMessage($message);
}
try {
return $this->publishToExchange($message, $exchange);
} catc... | php | public function publish(Message $message)
{
$exchange = $this->getExchange($message);
if (!$exchange instanceof \AMQPExchange) {
throw MissingExchangeException::forMessage($message);
}
try {
return $this->publishToExchange($message, $exchange);
} catc... | [
"public",
"function",
"publish",
"(",
"Message",
"$",
"message",
")",
"{",
"$",
"exchange",
"=",
"$",
"this",
"->",
"getExchange",
"(",
"$",
"message",
")",
";",
"if",
"(",
"!",
"$",
"exchange",
"instanceof",
"\\",
"AMQPExchange",
")",
"{",
"throw",
"M... | {@inheritdoc} | [
"{"
] | train | https://github.com/boekkooi/tactician-amqp/blob/55cbb8b9e20aab7891e6a6090b248377c599360e/src/Publisher/ExchangePublisher.php#L16-L28 |
boekkooi/tactician-amqp | src/Publisher/ExchangePublisher.php | ExchangePublisher.publishToExchange | protected function publishToExchange(Message $message, \AMQPExchange $exchange)
{
$isPublished = $exchange->publish(
$message->getMessage(),
$message->getRoutingKey(),
$message->getFlags(),
$message->getAttributes()
);
if (!$isPublished) {
... | php | protected function publishToExchange(Message $message, \AMQPExchange $exchange)
{
$isPublished = $exchange->publish(
$message->getMessage(),
$message->getRoutingKey(),
$message->getFlags(),
$message->getAttributes()
);
if (!$isPublished) {
... | [
"protected",
"function",
"publishToExchange",
"(",
"Message",
"$",
"message",
",",
"\\",
"AMQPExchange",
"$",
"exchange",
")",
"{",
"$",
"isPublished",
"=",
"$",
"exchange",
"->",
"publish",
"(",
"$",
"message",
"->",
"getMessage",
"(",
")",
",",
"$",
"mes... | Publish the message to AMQP exchange
@param Message $message
@param \AMQPExchange $exchange
@return bool
@throws \AMQPException | [
"Publish",
"the",
"message",
"to",
"AMQP",
"exchange"
] | train | https://github.com/boekkooi/tactician-amqp/blob/55cbb8b9e20aab7891e6a6090b248377c599360e/src/Publisher/ExchangePublisher.php#L38-L52 |
boekkooi/tactician-amqp | src/Middleware/ConsumeMiddleware.php | ConsumeMiddleware.execute | public function execute($command, callable $next)
{
if (!$command instanceof Command) {
return $next($command);
}
$queue = $command->getQueue();
$deliveryTag = $command->getEnvelope()->getDeliveryTag();
try {
$res = $next($command);
$queu... | php | public function execute($command, callable $next)
{
if (!$command instanceof Command) {
return $next($command);
}
$queue = $command->getQueue();
$deliveryTag = $command->getEnvelope()->getDeliveryTag();
try {
$res = $next($command);
$queu... | [
"public",
"function",
"execute",
"(",
"$",
"command",
",",
"callable",
"$",
"next",
")",
"{",
"if",
"(",
"!",
"$",
"command",
"instanceof",
"Command",
")",
"{",
"return",
"$",
"next",
"(",
"$",
"command",
")",
";",
"}",
"$",
"queue",
"=",
"$",
"com... | {@inheritdoc} | [
"{"
] | train | https://github.com/boekkooi/tactician-amqp/blob/55cbb8b9e20aab7891e6a6090b248377c599360e/src/Middleware/ConsumeMiddleware.php#L25-L54 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.getCreated | public function getCreated($format = null)
{
if ($this->created === null) {
return null;
}
if ($this->created === '0000-00-00 00:00:00') {
// while technically this is not a default value of null,
// this seems to be closest in meaning.
return... | php | public function getCreated($format = null)
{
if ($this->created === null) {
return null;
}
if ($this->created === '0000-00-00 00:00:00') {
// while technically this is not a default value of null,
// this seems to be closest in meaning.
return... | [
"public",
"function",
"getCreated",
"(",
"$",
"format",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"created",
"===",
"null",
")",
"{",
"return",
"null",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"created",
"===",
"'0000-00-00 00:00:00'",
")",
... | Get the [optionally formatted] temporal [created] column value.
@param string $format The date/time format string (either date()-style or strftime()-style).
If format is null, then the raw DateTime object will be returned.
@return mixed Formatted date/time value as string or DateTime object (if format is null), null ... | [
"Get",
"the",
"[",
"optionally",
"formatted",
"]",
"temporal",
"[",
"created",
"]",
"column",
"value",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L306-L335 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.setStreet | public function setStreet($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->street !== $v) {
$this->street = $v;
$this->modifiedColumns[] = CustomerPeer::STREET;
}
return $this;
} | php | public function setStreet($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->street !== $v) {
$this->street = $v;
$this->modifiedColumns[] = CustomerPeer::STREET;
}
return $this;
} | [
"public",
"function",
"setStreet",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"street",
"!==",
"$",
"v",
")",
"{",
"$",
"this",... | Set the value of [street] column.
@param string $v new value
@return Customer The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"street",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L396-L409 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.setZip | public function setZip($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->zip !== $v) {
$this->zip = $v;
$this->modifiedColumns[] = CustomerPeer::ZIP;
}
return $this;
} | php | public function setZip($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->zip !== $v) {
$this->zip = $v;
$this->modifiedColumns[] = CustomerPeer::ZIP;
}
return $this;
} | [
"public",
"function",
"setZip",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"zip",
"!==",
"$",
"v",
")",
"{",
"$",
"this",
"->... | Set the value of [zip] column.
@param string $v new value
@return Customer The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"zip",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L417-L430 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.setCity | public function setCity($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->city !== $v) {
$this->city = $v;
$this->modifiedColumns[] = CustomerPeer::CITY;
}
return $this;
} | php | public function setCity($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->city !== $v) {
$this->city = $v;
$this->modifiedColumns[] = CustomerPeer::CITY;
}
return $this;
} | [
"public",
"function",
"setCity",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"city",
"!==",
"$",
"v",
")",
"{",
"$",
"this",
"... | Set the value of [city] column.
@param string $v new value
@return Customer The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"city",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L438-L451 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.setCountryId | public function setCountryId($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
}
if ($this->country_id !== $v) {
$this->country_id = $v;
$this->modifiedColumns[] = CustomerPeer::COUNTRY_ID;
}
if ($this->aCountry !== null && $this-... | php | public function setCountryId($v)
{
if ($v !== null && is_numeric($v)) {
$v = (int) $v;
}
if ($this->country_id !== $v) {
$this->country_id = $v;
$this->modifiedColumns[] = CustomerPeer::COUNTRY_ID;
}
if ($this->aCountry !== null && $this-... | [
"public",
"function",
"setCountryId",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
"&&",
"is_numeric",
"(",
"$",
"v",
")",
")",
"{",
"$",
"v",
"=",
"(",
"int",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"country_id... | Set the value of [country_id] column.
@param int $v new value
@return Customer The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"country_id",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L459-L476 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.setFax | public function setFax($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->fax !== $v) {
$this->fax = $v;
$this->modifiedColumns[] = CustomerPeer::FAX;
}
return $this;
} | php | public function setFax($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->fax !== $v) {
$this->fax = $v;
$this->modifiedColumns[] = CustomerPeer::FAX;
}
return $this;
} | [
"public",
"function",
"setFax",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"fax",
"!==",
"$",
"v",
")",
"{",
"$",
"this",
"->... | Set the value of [fax] column.
@param string $v new value
@return Customer The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"fax",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L505-L518 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.setLegalform | public function setLegalform($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->legalform !== $v) {
$this->legalform = $v;
$this->modifiedColumns[] = CustomerPeer::LEGALFORM;
}
return $this;
} | php | public function setLegalform($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->legalform !== $v) {
$this->legalform = $v;
$this->modifiedColumns[] = CustomerPeer::LEGALFORM;
}
return $this;
} | [
"public",
"function",
"setLegalform",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"legalform",
"!==",
"$",
"v",
")",
"{",
"$",
"... | Set the value of [legalform] column.
@param string $v new value
@return Customer The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"legalform",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L547-L560 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.setLogo | public function setLogo($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->logo !== $v) {
$this->logo = $v;
$this->modifiedColumns[] = CustomerPeer::LOGO;
}
return $this;
} | php | public function setLogo($v)
{
if ($v !== null) {
$v = (string) $v;
}
if ($this->logo !== $v) {
$this->logo = $v;
$this->modifiedColumns[] = CustomerPeer::LOGO;
}
return $this;
} | [
"public",
"function",
"setLogo",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"string",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"logo",
"!==",
"$",
"v",
")",
"{",
"$",
"this",
"... | Set the value of [logo] column.
@param string $v new value
@return Customer The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"logo",
"]",
"column",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L568-L581 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.setCreated | public function setCreated($v)
{
$dt = PropelDateTime::newInstance($v, null, 'DateTime');
if ($this->created !== null || $dt !== null) {
$currentDateAsString = ($this->created !== null && $tmpDt = new DateTime($this->created)) ? $tmpDt->format('Y-m-d H:i:s') : null;
$newDateA... | php | public function setCreated($v)
{
$dt = PropelDateTime::newInstance($v, null, 'DateTime');
if ($this->created !== null || $dt !== null) {
$currentDateAsString = ($this->created !== null && $tmpDt = new DateTime($this->created)) ? $tmpDt->format('Y-m-d H:i:s') : null;
$newDateA... | [
"public",
"function",
"setCreated",
"(",
"$",
"v",
")",
"{",
"$",
"dt",
"=",
"PropelDateTime",
"::",
"newInstance",
"(",
"$",
"v",
",",
"null",
",",
"'DateTime'",
")",
";",
"if",
"(",
"$",
"this",
"->",
"created",
"!==",
"null",
"||",
"$",
"dt",
"!... | Sets the value of [created] column to a normalized version of the date/time value specified.
@param mixed $v string, integer (timestamp), or DateTime value.
Empty strings are treated as null.
@return Customer The current object (for fluent API support) | [
"Sets",
"the",
"value",
"of",
"[",
"created",
"]",
"column",
"to",
"a",
"normalized",
"version",
"of",
"the",
"date",
"/",
"time",
"value",
"specified",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L590-L604 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.hydrate | public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->street = ($row[$startcol + 2... | php | public function hydrate($row, $startcol = 0, $rehydrate = false)
{
try {
$this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
$this->name = ($row[$startcol + 1] !== null) ? (string) $row[$startcol + 1] : null;
$this->street = ($row[$startcol + 2... | [
"public",
"function",
"hydrate",
"(",
"$",
"row",
",",
"$",
"startcol",
"=",
"0",
",",
"$",
"rehydrate",
"=",
"false",
")",
"{",
"try",
"{",
"$",
"this",
"->",
"id",
"=",
"(",
"$",
"row",
"[",
"$",
"startcol",
"+",
"0",
"]",
"!==",
"null",
")",... | Hydrates (populates) the object variables with values from the database resultset.
An offset (0-based "start column") is specified so that objects can be hydrated
with a subset of the columns in the resultset rows. This is needed, for example,
for results of JOIN queries where the resultset row includes columns from ... | [
"Hydrates",
"(",
"populates",
")",
"the",
"object",
"variables",
"with",
"values",
"from",
"the",
"database",
"resultset",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L655-L686 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.doSave | protected function doSave(PropelPDO $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this obj... | php | protected function doSave(PropelPDO $con)
{
$affectedRows = 0; // initialize var to track total num of affected rows
if (!$this->alreadyInSave) {
$this->alreadyInSave = true;
// We call the save method on the following object(s) if they
// were passed to this obj... | [
"protected",
"function",
"doSave",
"(",
"PropelPDO",
"$",
"con",
")",
"{",
"$",
"affectedRows",
"=",
"0",
";",
"// initialize var to track total num of affected rows",
"if",
"(",
"!",
"$",
"this",
"->",
"alreadyInSave",
")",
"{",
"$",
"this",
"->",
"alreadyInSav... | Performs the work of inserting or updating the row in the database.
If the object is new, it inserts it; otherwise an update is performed.
All related objects are also updated in this method.
@param PropelPDO $con
@return int The number of rows affected by this insert/update and any referring fk objects' ... | [
"Performs",
"the",
"work",
"of",
"inserting",
"or",
"updating",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L858-L927 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.doInsert | protected function doInsert(PropelPDO $con)
{
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = CustomerPeer::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . CustomerPeer::ID . ')');
... | php | protected function doInsert(PropelPDO $con)
{
$modifiedColumns = array();
$index = 0;
$this->modifiedColumns[] = CustomerPeer::ID;
if (null !== $this->id) {
throw new PropelException('Cannot insert a value for auto-increment primary key (' . CustomerPeer::ID . ')');
... | [
"protected",
"function",
"doInsert",
"(",
"PropelPDO",
"$",
"con",
")",
"{",
"$",
"modifiedColumns",
"=",
"array",
"(",
")",
";",
"$",
"index",
"=",
"0",
";",
"$",
"this",
"->",
"modifiedColumns",
"[",
"]",
"=",
"CustomerPeer",
"::",
"ID",
";",
"if",
... | Insert the row in the database.
@param PropelPDO $con
@throws PropelException
@see doSave() | [
"Insert",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L937-L1053 |
slashworks/control-bundle | src/Slashworks/AppBundle/Model/om/BaseCustomer.php | BaseCustomer.doValidate | protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
// We call the validate method on the following object(s) if they
// were passed to thi... | php | protected function doValidate($columns = null)
{
if (!$this->alreadyInValidation) {
$this->alreadyInValidation = true;
$retval = null;
$failureMap = array();
// We call the validate method on the following object(s) if they
// were passed to thi... | [
"protected",
"function",
"doValidate",
"(",
"$",
"columns",
"=",
"null",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"alreadyInValidation",
")",
"{",
"$",
"this",
"->",
"alreadyInValidation",
"=",
"true",
";",
"$",
"retval",
"=",
"null",
";",
"$",
"fa... | This function performs the validation work for complex object models.
In addition to checking the current object, all related objects will
also be validated. If all pass then <code>true</code> is returned; otherwise
an aggregated array of ValidationFailed objects will be returned.
@param array $columns Array of colu... | [
"This",
"function",
"performs",
"the",
"validation",
"work",
"for",
"complex",
"object",
"models",
"."
] | train | https://github.com/slashworks/control-bundle/blob/2ba86d96f1f41f9424e2229c4e2b13017e973f89/src/Slashworks/AppBundle/Model/om/BaseCustomer.php#L1122-L1169 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.