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 |
|---|---|---|---|---|---|---|---|---|---|---|
yoanm/php-jsonrpc-http-server-openapi-doc-sdk | src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php | ExternalSchemaListDocNormalizer.getMethodExternalSchemaList | protected function getMethodExternalSchemaList(MethodDoc $method) : array
{
$list = [];
// Create request params schema if provided
if (null !== $method->getParamsDoc()) {
$key = $this->definitionRefResolver->getMethodDefinitionId(
$method,
Definit... | php | protected function getMethodExternalSchemaList(MethodDoc $method) : array
{
$list = [];
// Create request params schema if provided
if (null !== $method->getParamsDoc()) {
$key = $this->definitionRefResolver->getMethodDefinitionId(
$method,
Definit... | [
"protected",
"function",
"getMethodExternalSchemaList",
"(",
"MethodDoc",
"$",
"method",
")",
":",
"array",
"{",
"$",
"list",
"=",
"[",
"]",
";",
"// Create request params schema if provided",
"if",
"(",
"null",
"!==",
"$",
"method",
"->",
"getParamsDoc",
"(",
"... | @param MethodDoc $method
@return array[]
@throws \ReflectionException | [
"@param",
"MethodDoc",
"$method"
] | train | https://github.com/yoanm/php-jsonrpc-http-server-openapi-doc-sdk/blob/52d6bb5d0671e0363bbf482c3c75fef97d7d1d5e/src/App/Normalizer/Component/ExternalSchemaListDocNormalizer.php#L129-L151 |
stubbles/stubbles-webapp-core | src/main/php/routing/RoutingAnnotations.php | RoutingAnnotations.mimeTypeClasses | public function mimeTypeClasses(): array
{
$mimeTypeClasses = [];
foreach ($this->annotations->named('SupportsMimeType') as $supportedMimeType) {
if ($supportedMimeType->hasValueByName('class')) {
$mimeTypeClasses[$supportedMimeType->mimeType()] = $this->nameForMimeTypeCl... | php | public function mimeTypeClasses(): array
{
$mimeTypeClasses = [];
foreach ($this->annotations->named('SupportsMimeType') as $supportedMimeType) {
if ($supportedMimeType->hasValueByName('class')) {
$mimeTypeClasses[$supportedMimeType->mimeType()] = $this->nameForMimeTypeCl... | [
"public",
"function",
"mimeTypeClasses",
"(",
")",
":",
"array",
"{",
"$",
"mimeTypeClasses",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"annotations",
"->",
"named",
"(",
"'SupportsMimeType'",
")",
"as",
"$",
"supportedMimeType",
")",
"{",
"if... | returns a list of all mime type classes a route supports via @SupportsMimeType
@return string[]
@since 5.1.0 | [
"returns",
"a",
"list",
"of",
"all",
"mime",
"type",
"classes",
"a",
"route",
"supports",
"via",
"@SupportsMimeType"
] | train | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/RoutingAnnotations.php#L124-L134 |
stubbles/stubbles-webapp-core | src/main/php/routing/RoutingAnnotations.php | RoutingAnnotations.statusCodes | public function statusCodes(): array
{
return array_map(
function($status)
{
return new Status($status->getCode(), $status->getDescription());
},
$this->annotations->named('Status')
);
} | php | public function statusCodes(): array
{
return array_map(
function($status)
{
return new Status($status->getCode(), $status->getDescription());
},
$this->annotations->named('Status')
);
} | [
"public",
"function",
"statusCodes",
"(",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"status",
")",
"{",
"return",
"new",
"Status",
"(",
"$",
"status",
"->",
"getCode",
"(",
")",
",",
"$",
"status",
"->",
"getDescription",
... | returns list of possible status codes on this route
@return stubbles\webapp\routing\api\Status[]
@since 6.1.0 | [
"returns",
"list",
"of",
"possible",
"status",
"codes",
"on",
"this",
"route"
] | train | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/RoutingAnnotations.php#L220-L229 |
stubbles/stubbles-webapp-core | src/main/php/routing/RoutingAnnotations.php | RoutingAnnotations.headers | public function headers(): array
{
return array_map(
function($header)
{
return new Header($header->getName(), $header->getDescription());
},
$this->annotations->named('Header')
);
} | php | public function headers(): array
{
return array_map(
function($header)
{
return new Header($header->getName(), $header->getDescription());
},
$this->annotations->named('Header')
);
} | [
"public",
"function",
"headers",
"(",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"header",
")",
"{",
"return",
"new",
"Header",
"(",
"$",
"header",
"->",
"getName",
"(",
")",
",",
"$",
"header",
"->",
"getDescription",
"(... | returns list of headers on this route
@return \stubbles\webapp\routing\api\Header[]
@since 6.1.0 | [
"returns",
"list",
"of",
"headers",
"on",
"this",
"route"
] | train | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/RoutingAnnotations.php#L248-L257 |
stubbles/stubbles-webapp-core | src/main/php/routing/RoutingAnnotations.php | RoutingAnnotations.parameters | public function parameters(): array
{
return array_map(
function($parameter)
{
$param = new Parameter(
$parameter->getName(),
$parameter->getDescription(),
$parameter->getI... | php | public function parameters(): array
{
return array_map(
function($parameter)
{
$param = new Parameter(
$parameter->getName(),
$parameter->getDescription(),
$parameter->getI... | [
"public",
"function",
"parameters",
"(",
")",
":",
"array",
"{",
"return",
"array_map",
"(",
"function",
"(",
"$",
"parameter",
")",
"{",
"$",
"param",
"=",
"new",
"Parameter",
"(",
"$",
"parameter",
"->",
"getName",
"(",
")",
",",
"$",
"parameter",
"-... | returns list of parameters
@return \stubbles\webapp\routing\api\Parameter[]
@since 6.1.0 | [
"returns",
"list",
"of",
"parameters"
] | train | https://github.com/stubbles/stubbles-webapp-core/blob/7705f129011a81d5cc3c76b4b150fab3dadac6a3/src/main/php/routing/RoutingAnnotations.php#L276-L295 |
wizbii/pipeline | DependencyInjection/Configuration.php | Configuration.getConfigTreeBuilder | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('wizbii_pipeline');
$rootNode
->children()
->scalarNode('name')->end()
->arrayNode('connection')
->children()
... | php | public function getConfigTreeBuilder()
{
$treeBuilder = new TreeBuilder();
$rootNode = $treeBuilder->root('wizbii_pipeline');
$rootNode
->children()
->scalarNode('name')->end()
->arrayNode('connection')
->children()
... | [
"public",
"function",
"getConfigTreeBuilder",
"(",
")",
"{",
"$",
"treeBuilder",
"=",
"new",
"TreeBuilder",
"(",
")",
";",
"$",
"rootNode",
"=",
"$",
"treeBuilder",
"->",
"root",
"(",
"'wizbii_pipeline'",
")",
";",
"$",
"rootNode",
"->",
"children",
"(",
"... | {@inheritDoc} | [
"{"
] | train | https://github.com/wizbii/pipeline/blob/8d22b976a53bb52abf0333b62b308ec7127cf414/DependencyInjection/Configuration.php#L18-L69 |
sanpii/assetic | src/Assetic/Filter/CleanCssFilter.php | CleanCssFilter.filterDump | public function filterDump(AssetInterface $asset)
{
$commandline = $this->getBinary();
$formats = array();
$optimizations = array();
if ($this->keepLineBreaks) {
if ($this->isV4()) {
$format[] = 'keep-breaks';
} else {
array_pu... | php | public function filterDump(AssetInterface $asset)
{
$commandline = $this->getBinary();
$formats = array();
$optimizations = array();
if ($this->keepLineBreaks) {
if ($this->isV4()) {
$format[] = 'keep-breaks';
} else {
array_pu... | [
"public",
"function",
"filterDump",
"(",
"AssetInterface",
"$",
"asset",
")",
"{",
"$",
"commandline",
"=",
"$",
"this",
"->",
"getBinary",
"(",
")",
";",
"$",
"formats",
"=",
"array",
"(",
")",
";",
"$",
"optimizations",
"=",
"array",
"(",
")",
";",
... | Run the asset through CleanCss
@see FilterInterface::filterDump() | [
"Run",
"the",
"asset",
"through",
"CleanCss"
] | train | https://github.com/sanpii/assetic/blob/5c446eee54cc396cbbd6e252108f430e6e617c95/src/Assetic/Filter/CleanCssFilter.php#L264-L421 |
Laralum/Roles | src/Traits/HasRoles.php | HasRoles.hasRole | public function hasRole(Role $role)
{
$role = !is_string($role) ?: Role::where(['name' => $role])->firstOrFail();
if ($role) {
foreach ($this->roles as $r) {
if ($r->id == $role->id) {
return true;
}
}
}
re... | php | public function hasRole(Role $role)
{
$role = !is_string($role) ?: Role::where(['name' => $role])->firstOrFail();
if ($role) {
foreach ($this->roles as $r) {
if ($r->id == $role->id) {
return true;
}
}
}
re... | [
"public",
"function",
"hasRole",
"(",
"Role",
"$",
"role",
")",
"{",
"$",
"role",
"=",
"!",
"is_string",
"(",
"$",
"role",
")",
"?",
":",
"Role",
"::",
"where",
"(",
"[",
"'name'",
"=>",
"$",
"role",
"]",
")",
"->",
"firstOrFail",
"(",
")",
";",
... | Returns true if the user has the role.
@param mixed $role
@return bool | [
"Returns",
"true",
"if",
"the",
"user",
"has",
"the",
"role",
"."
] | train | https://github.com/Laralum/Roles/blob/f934967a5dcebebf81915dd50fccdbcb7e23c113/src/Traits/HasRoles.php#L24-L37 |
gregorybesson/PlaygroundCore | src/Entity/Website.php | Website.populate | public function populate($data = array())
{
if (isset($data['name']) && $data['name'] !== null) {
$this->name = $data['name'];
}
if (isset($data['code']) && $data['code'] !== null) {
$this->code = $data['code'];
}
if (isset($data['phase']) && $data['ph... | php | public function populate($data = array())
{
if (isset($data['name']) && $data['name'] !== null) {
$this->name = $data['name'];
}
if (isset($data['code']) && $data['code'] !== null) {
$this->code = $data['code'];
}
if (isset($data['phase']) && $data['ph... | [
"public",
"function",
"populate",
"(",
"$",
"data",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"'name'",
"]",
")",
"&&",
"$",
"data",
"[",
"'name'",
"]",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"name",
"=",... | Populate from an array.
@param array $data | [
"Populate",
"from",
"an",
"array",
"."
] | train | https://github.com/gregorybesson/PlaygroundCore/blob/f8dfa4c7660b54354933b3c28c0cf35304a649df/src/Entity/Website.php#L265-L279 |
gregorybesson/PlaygroundCore | src/Controller/Plugin/ShortenUrl.php | ShortenUrl.getService | public function getService()
{
if (!$this->service) {
$this->setService($this->serviceLocator->get('playgroundcore_shortenurl_service'));
}
return $this->service;
} | php | public function getService()
{
if (!$this->service) {
$this->setService($this->serviceLocator->get('playgroundcore_shortenurl_service'));
}
return $this->service;
} | [
"public",
"function",
"getService",
"(",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"service",
")",
"{",
"$",
"this",
"->",
"setService",
"(",
"$",
"this",
"->",
"serviceLocator",
"->",
"get",
"(",
"'playgroundcore_shortenurl_service'",
")",
")",
";",
... | get mapper
@return Service | [
"get",
"mapper"
] | train | https://github.com/gregorybesson/PlaygroundCore/blob/f8dfa4c7660b54354933b3c28c0cf35304a649df/src/Controller/Plugin/ShortenUrl.php#L53-L60 |
axelitus/php-base | src/Comparer.php | Comparer.compare | final public function compare($item1, $item2)
{
if (!$this->isReady()) {
throw new \RuntimeException("The comparer is not ready, no valid callback has been set.");
}
return call_user_func_array($this->callback, [$item1, $item2, $this->options]);
} | php | final public function compare($item1, $item2)
{
if (!$this->isReady()) {
throw new \RuntimeException("The comparer is not ready, no valid callback has been set.");
}
return call_user_func_array($this->callback, [$item1, $item2, $this->options]);
} | [
"final",
"public",
"function",
"compare",
"(",
"$",
"item1",
",",
"$",
"item2",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"isReady",
"(",
")",
")",
"{",
"throw",
"new",
"\\",
"RuntimeException",
"(",
"\"The comparer is not ready, no valid callback has been ... | Compares two items.
@param mixed $item1 The left operand.
@param mixed $item2 The right operand.
@throws \RuntimeException
@return int Return <0 if $item1<$item2; 0if $item1=$item2; >1 if $item1>$item2 | [
"Compares",
"two",
"items",
"."
] | train | https://github.com/axelitus/php-base/blob/c2da680c1f0c3ee93ae6a8be5adaacd0caf7d075/src/Comparer.php#L144-L151 |
activecollab/databasestructure | src/Field/Composite/UpdatedAtField.php | UpdatedAtField.onAddedToType | public function onAddedToType(TypeInterface &$type)
{
parent::onAddedToType($type);
if ($this->getAddIndex()) {
$type->addIndex(new Index($this->name));
}
$type->addTrait(UpdatedAtInterface::class, UpdatedAtInterfaceImplementation::class)->serialize($this->name);
} | php | public function onAddedToType(TypeInterface &$type)
{
parent::onAddedToType($type);
if ($this->getAddIndex()) {
$type->addIndex(new Index($this->name));
}
$type->addTrait(UpdatedAtInterface::class, UpdatedAtInterfaceImplementation::class)->serialize($this->name);
} | [
"public",
"function",
"onAddedToType",
"(",
"TypeInterface",
"&",
"$",
"type",
")",
"{",
"parent",
"::",
"onAddedToType",
"(",
"$",
"type",
")",
";",
"if",
"(",
"$",
"this",
"->",
"getAddIndex",
"(",
")",
")",
"{",
"$",
"type",
"->",
"addIndex",
"(",
... | Method that is called when field is added to a type.
@param TypeInterface $type | [
"Method",
"that",
"is",
"called",
"when",
"field",
"is",
"added",
"to",
"a",
"type",
"."
] | train | https://github.com/activecollab/databasestructure/blob/4b2353c4422186bcfce63b3212da3e70e63eb5df/src/Field/Composite/UpdatedAtField.php#L64-L73 |
jan-dolata/crude-crud | src/Engine/Traits/FromModelTraitPart/OrderTrait.php | OrderTrait.reorder | public function reorder(array $newOrder)
{
$param = $this->crudeSetup->getOrderParameters();
$idAttr = $param['idAttr'];
$orderAttr = $param['orderAttr'];
$table = $this->model->getTable();
$data = collect($newOrder)->map(function($item) {
return "({$item['id']},... | php | public function reorder(array $newOrder)
{
$param = $this->crudeSetup->getOrderParameters();
$idAttr = $param['idAttr'];
$orderAttr = $param['orderAttr'];
$table = $this->model->getTable();
$data = collect($newOrder)->map(function($item) {
return "({$item['id']},... | [
"public",
"function",
"reorder",
"(",
"array",
"$",
"newOrder",
")",
"{",
"$",
"param",
"=",
"$",
"this",
"->",
"crudeSetup",
"->",
"getOrderParameters",
"(",
")",
";",
"$",
"idAttr",
"=",
"$",
"param",
"[",
"'idAttr'",
"]",
";",
"$",
"orderAttr",
"=",... | Set new order for selected items
@param array $newOrder - list of ids and new order positions | [
"Set",
"new",
"order",
"for",
"selected",
"items"
] | train | https://github.com/jan-dolata/crude-crud/blob/9129ea08278835cf5cecfd46a90369226ae6bdd7/src/Engine/Traits/FromModelTraitPart/OrderTrait.php#L53-L67 |
acasademont/wurfl | WURFL/Handlers/AndroidHandler.php | WURFL_Handlers_AndroidHandler.getAndroidVersion | public static function getAndroidVersion($ua, $use_default=true)
{
// Replace Android version names with their numbers
// ex: Froyo => 2.2
$ua = str_replace(array_keys(self::$androidReleaseMap), array_values(self::$androidReleaseMap), $ua);
// Initializing $version
$... | php | public static function getAndroidVersion($ua, $use_default=true)
{
// Replace Android version names with their numbers
// ex: Froyo => 2.2
$ua = str_replace(array_keys(self::$androidReleaseMap), array_values(self::$androidReleaseMap), $ua);
// Initializing $version
$... | [
"public",
"static",
"function",
"getAndroidVersion",
"(",
"$",
"ua",
",",
"$",
"use_default",
"=",
"true",
")",
"{",
"// Replace Android version names with their numbers",
"// ex: Froyo => 2.2",
"$",
"ua",
"=",
"str_replace",
"(",
"array_keys",
"(",
"self",
"::",
"$... | Get the Android version from the User Agent, or the default Android version is it cannot be determined
@param string $ua User Agent
@param boolean $use_default Return the default version on fail, else return null
@return string Android version
@see self::ANDROID_DEFAULT_VERSION | [
"Get",
"the",
"Android",
"version",
"from",
"the",
"User",
"Agent",
"or",
"the",
"default",
"Android",
"version",
"is",
"it",
"cannot",
"be",
"determined"
] | train | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/Handlers/AndroidHandler.php#L154-L175 |
bluelyte/transmission-remote | src/Remote.php | Remote.setPort | public function setPort($port)
{
if (!ctype_digit($port)) {
trigger_error('Port must be a positive integer: ' . var_export($port, true), E_USER_ERROR);
}
$this->port = $port;
} | php | public function setPort($port)
{
if (!ctype_digit($port)) {
trigger_error('Port must be a positive integer: ' . var_export($port, true), E_USER_ERROR);
}
$this->port = $port;
} | [
"public",
"function",
"setPort",
"(",
"$",
"port",
")",
"{",
"if",
"(",
"!",
"ctype_digit",
"(",
"$",
"port",
")",
")",
"{",
"trigger_error",
"(",
"'Port must be a positive integer: '",
".",
"var_export",
"(",
"$",
"port",
",",
"true",
")",
",",
"E_USER_ER... | Sets the port on which to operate the daemon.
@param string $port | [
"Sets",
"the",
"port",
"on",
"which",
"to",
"operate",
"the",
"daemon",
"."
] | train | https://github.com/bluelyte/transmission-remote/blob/82683b8b9101f623dbd6c1923348cff00380250c/src/Remote.php#L83-L89 |
bluelyte/transmission-remote | src/Remote.php | Remote.setDownloadPath | public function setDownloadPath($downloadPath)
{
if (!is_dir($downloadPath) || !is_writable($downloadPath)) {
trigger_error('Cannot write to directory: ' . $downloadPath, E_USER_ERROR);
}
$this->downloadPath = $downloadPath;
} | php | public function setDownloadPath($downloadPath)
{
if (!is_dir($downloadPath) || !is_writable($downloadPath)) {
trigger_error('Cannot write to directory: ' . $downloadPath, E_USER_ERROR);
}
$this->downloadPath = $downloadPath;
} | [
"public",
"function",
"setDownloadPath",
"(",
"$",
"downloadPath",
")",
"{",
"if",
"(",
"!",
"is_dir",
"(",
"$",
"downloadPath",
")",
"||",
"!",
"is_writable",
"(",
"$",
"downloadPath",
")",
")",
"{",
"trigger_error",
"(",
"'Cannot write to directory: '",
".",... | Sets the path at which to store downloaded files.
@param string $downloadPath | [
"Sets",
"the",
"path",
"at",
"which",
"to",
"store",
"downloaded",
"files",
"."
] | train | https://github.com/bluelyte/transmission-remote/blob/82683b8b9101f623dbd6c1923348cff00380250c/src/Remote.php#L106-L112 |
bluelyte/transmission-remote | src/Remote.php | Remote.execute | protected function execute($command)
{
$process = proc_open($command, array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);
fclose($pipes[2]);
$this->output = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$status = proc_get_status($process);
$this->st... | php | protected function execute($command)
{
$process = proc_open($command, array(1 => array('pipe', 'w'), 2 => array('pipe', 'w')), $pipes);
fclose($pipes[2]);
$this->output = stream_get_contents($pipes[1]);
fclose($pipes[1]);
$status = proc_get_status($process);
$this->st... | [
"protected",
"function",
"execute",
"(",
"$",
"command",
")",
"{",
"$",
"process",
"=",
"proc_open",
"(",
"$",
"command",
",",
"array",
"(",
"1",
"=>",
"array",
"(",
"'pipe'",
",",
"'w'",
")",
",",
"2",
"=>",
"array",
"(",
"'pipe'",
",",
"'w'",
")"... | Execute a shell command.
@param string $command | [
"Execute",
"a",
"shell",
"command",
"."
] | train | https://github.com/bluelyte/transmission-remote/blob/82683b8b9101f623dbd6c1923348cff00380250c/src/Remote.php#L131-L140 |
bluelyte/transmission-remote | src/Remote.php | Remote.start | public function start()
{
if ($this->started) {
return;
}
$auth = $this->getAuthFlag();
$command = 'transmission-remote -C ' . $auth
. ' -' . ($this->encryption ? 'er' : 'ep')
. ' -p ' . $this->port
. ' -' . ($this->upnp ? 'm' : 'M')
... | php | public function start()
{
if ($this->started) {
return;
}
$auth = $this->getAuthFlag();
$command = 'transmission-remote -C ' . $auth
. ' -' . ($this->encryption ? 'er' : 'ep')
. ' -p ' . $this->port
. ' -' . ($this->upnp ? 'm' : 'M')
... | [
"public",
"function",
"start",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"started",
")",
"{",
"return",
";",
"}",
"$",
"auth",
"=",
"$",
"this",
"->",
"getAuthFlag",
"(",
")",
";",
"$",
"command",
"=",
"'transmission-remote -C '",
".",
"$",
"auth"... | Starts the daemon. | [
"Starts",
"the",
"daemon",
"."
] | train | https://github.com/bluelyte/transmission-remote/blob/82683b8b9101f623dbd6c1923348cff00380250c/src/Remote.php#L175-L196 |
bluelyte/transmission-remote | src/Remote.php | Remote.addTorrents | public function addTorrents($paths)
{
if (is_array($paths)) {
$paths = implode(' ', $paths);
}
$this->execute('transmission-remote ' . $this->getAuthFlag() . ' -a ' . $paths);
} | php | public function addTorrents($paths)
{
if (is_array($paths)) {
$paths = implode(' ', $paths);
}
$this->execute('transmission-remote ' . $this->getAuthFlag() . ' -a ' . $paths);
} | [
"public",
"function",
"addTorrents",
"(",
"$",
"paths",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"paths",
")",
")",
"{",
"$",
"paths",
"=",
"implode",
"(",
"' '",
",",
"$",
"paths",
")",
";",
"}",
"$",
"this",
"->",
"execute",
"(",
"'transmission... | Adds a torrent to download.
@param string|array $path Space-delimited list or array of paths to
one or more .torrent files | [
"Adds",
"a",
"torrent",
"to",
"download",
"."
] | train | https://github.com/bluelyte/transmission-remote/blob/82683b8b9101f623dbd6c1923348cff00380250c/src/Remote.php#L204-L210 |
dreamcommerce/common-bundle | src/DreamCommerce/Component/Common/Http/GuzzleClient.php | GuzzleClient.send | public function send(RequestInterface $request, array $options = array()): ResponseInterface
{
return $this->guzzleClient->send($request, $options);
} | php | public function send(RequestInterface $request, array $options = array()): ResponseInterface
{
return $this->guzzleClient->send($request, $options);
} | [
"public",
"function",
"send",
"(",
"RequestInterface",
"$",
"request",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"guzzleClient",
"->",
"send",
"(",
"$",
"request",
",",
"$",
"op... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamcommerce/common-bundle/blob/adb0850e90e63c3997f10d1ce110bf13a84b63ab/src/DreamCommerce/Component/Common/Http/GuzzleClient.php#L42-L45 |
dreamcommerce/common-bundle | src/DreamCommerce/Component/Common/Http/GuzzleClient.php | GuzzleClient.request | public function request(string $method, $uri, array $options = array()): ResponseInterface
{
return $this->guzzleClient->request($method, $uri, $options);
} | php | public function request(string $method, $uri, array $options = array()): ResponseInterface
{
return $this->guzzleClient->request($method, $uri, $options);
} | [
"public",
"function",
"request",
"(",
"string",
"$",
"method",
",",
"$",
"uri",
",",
"array",
"$",
"options",
"=",
"array",
"(",
")",
")",
":",
"ResponseInterface",
"{",
"return",
"$",
"this",
"->",
"guzzleClient",
"->",
"request",
"(",
"$",
"method",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/dreamcommerce/common-bundle/blob/adb0850e90e63c3997f10d1ce110bf13a84b63ab/src/DreamCommerce/Component/Common/Http/GuzzleClient.php#L50-L53 |
braincrafted/arrayquery | src/Braincrafted/ArrayQuery/Filter/ReplaceFilter.php | ReplaceFilter.evaluate | public function evaluate($value, array $args = array())
{
if (false === isset($args[0]) || false === isset($args[1])) {
throw new \InvalidArgumentException('replace requires two arguments');
}
return str_replace($args[0], $args[1], $value);
} | php | public function evaluate($value, array $args = array())
{
if (false === isset($args[0]) || false === isset($args[1])) {
throw new \InvalidArgumentException('replace requires two arguments');
}
return str_replace($args[0], $args[1], $value);
} | [
"public",
"function",
"evaluate",
"(",
"$",
"value",
",",
"array",
"$",
"args",
"=",
"array",
"(",
")",
")",
"{",
"if",
"(",
"false",
"===",
"isset",
"(",
"$",
"args",
"[",
"0",
"]",
")",
"||",
"false",
"===",
"isset",
"(",
"$",
"args",
"[",
"1... | {@inheritDoc} | [
"{"
] | train | https://github.com/braincrafted/arrayquery/blob/8b0c44ee76cea796589422f52e2f7130676b9bd1/src/Braincrafted/ArrayQuery/Filter/ReplaceFilter.php#L36-L43 |
jasny/router | src/Router/UrlParsing.php | UrlParsing.splitUrl | protected function splitUrl($url)
{
$path = parse_url(trim($url, '/'), PHP_URL_PATH);
return $path ? explode('/', $path) : array();
} | php | protected function splitUrl($url)
{
$path = parse_url(trim($url, '/'), PHP_URL_PATH);
return $path ? explode('/', $path) : array();
} | [
"protected",
"function",
"splitUrl",
"(",
"$",
"url",
")",
"{",
"$",
"path",
"=",
"parse_url",
"(",
"trim",
"(",
"$",
"url",
",",
"'/'",
")",
",",
"PHP_URL_PATH",
")",
";",
"return",
"$",
"path",
"?",
"explode",
"(",
"'/'",
",",
"$",
"path",
")",
... | Get parts of a URL path
@param string $url
@return array | [
"Get",
"parts",
"of",
"a",
"URL",
"path"
] | train | https://github.com/jasny/router/blob/4c776665ba343150b442c21893946e3d54190896/src/Router/UrlParsing.php#L16-L20 |
vincentchalamon/VinceCmsSonataAdminBundle | Form/Type/TemplateType.php | TemplateType.buildForm | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->addViewTransformer(new ContentsTransformer($this->repository, $this->class));
$list = $this->repository->createQueryBuilder('t')
->innerJoin('t.areas', 'a')->addSelect('a')
... | php | public function buildForm(FormBuilderInterface $builder, array $options)
{
$builder->addViewTransformer(new ContentsTransformer($this->repository, $this->class));
$list = $this->repository->createQueryBuilder('t')
->innerJoin('t.areas', 'a')->addSelect('a')
... | [
"public",
"function",
"buildForm",
"(",
"FormBuilderInterface",
"$",
"builder",
",",
"array",
"$",
"options",
")",
"{",
"$",
"builder",
"->",
"addViewTransformer",
"(",
"new",
"ContentsTransformer",
"(",
"$",
"this",
"->",
"repository",
",",
"$",
"this",
"->",... | {@inheritdoc} | [
"{"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Form/Type/TemplateType.php#L75-L90 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php | AssertHelper.type | private function type($value, $type) {
switch (func_num_args()) {
case 0 :
case 1 :
return false;
case 2 :
// 二个参数时, 才执行正常处理逻辑
if (is_array($type)) {
foreach ( $type as $t ) {
... | php | private function type($value, $type) {
switch (func_num_args()) {
case 0 :
case 1 :
return false;
case 2 :
// 二个参数时, 才执行正常处理逻辑
if (is_array($type)) {
foreach ( $type as $t ) {
... | [
"private",
"function",
"type",
"(",
"$",
"value",
",",
"$",
"type",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"case",
"1",
":",
"return",
"false",
";",
"case",
"2",
":",
"// 二个参数时, 才执行正常处理逻辑",
"if",
"(",
"is_arra... | 检查变量类型是否为指定类型;
@param mixed $value
@param string | array $type
@return boolean | [
"检查变量类型是否为指定类型",
";"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php#L61-L117 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php | AssertHelper.between | private function between($value, $min = null, $max = null) {
$value = intval($value);
if ($min !== null && $max !== null) {
return $value >= intval($min) && $value <= intval($max);
}
if ($min !== null) {
return intval($min) <= $value;
}
if ($ma... | php | private function between($value, $min = null, $max = null) {
$value = intval($value);
if ($min !== null && $max !== null) {
return $value >= intval($min) && $value <= intval($max);
}
if ($min !== null) {
return intval($min) <= $value;
}
if ($ma... | [
"private",
"function",
"between",
"(",
"$",
"value",
",",
"$",
"min",
"=",
"null",
",",
"$",
"max",
"=",
"null",
")",
"{",
"$",
"value",
"=",
"intval",
"(",
"$",
"value",
")",
";",
"if",
"(",
"$",
"min",
"!==",
"null",
"&&",
"$",
"max",
"!==",
... | 断言一个数值在另外两个数值之间
@param int $value
@param int $min
@param int $max
@return boolean | [
"断言一个数值在另外两个数值之间"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php#L149-L165 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php | AssertHelper.match | private function match($value, $regStr) {
return $this -> type($value, 'string', 'number') && ($this -> equal($value, $regStr) || (preg_match(strval($regStr), strval($value)) > 0));
} | php | private function match($value, $regStr) {
return $this -> type($value, 'string', 'number') && ($this -> equal($value, $regStr) || (preg_match(strval($regStr), strval($value)) > 0));
} | [
"private",
"function",
"match",
"(",
"$",
"value",
",",
"$",
"regStr",
")",
"{",
"return",
"$",
"this",
"->",
"type",
"(",
"$",
"value",
",",
"'string'",
",",
"'number'",
")",
"&&",
"(",
"$",
"this",
"->",
"equal",
"(",
"$",
"value",
",",
"$",
"r... | 断言一个字符串匹配指定的正则表达式格式
@param string $value
@param regexpString $regStr
@return boolean | [
"断言一个字符串匹配指定的正则表达式格式"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php#L173-L175 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php | AssertHelper.not | private function not($value) {
switch (func_num_args()) {
case 0 :
return true;
case 1 :
return ! $value;
case 2 :
$varList = func_get_arg(1);
if (is_array($varList)) {
return... | php | private function not($value) {
switch (func_num_args()) {
case 0 :
return true;
case 1 :
return ! $value;
case 2 :
$varList = func_get_arg(1);
if (is_array($varList)) {
return... | [
"private",
"function",
"not",
"(",
"$",
"value",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"true",
";",
"case",
"1",
":",
"return",
"!",
"$",
"value",
";",
"case",
"2",
":",
"$",
"varList",
"=",
"fu... | 断言不等于或非
@param mixed $value
@param mixed $checkValue
@return boolean | [
"断言不等于或非"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php#L201-L221 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php | AssertHelper.maybe | private function maybe($value, $varList) {
switch(func_num_args()){
case 0:
return false;
case 1:
return !!$value;
case 2:
if (is_array($varList)) {
return array_search($value, $varList, true) !== false;
... | php | private function maybe($value, $varList) {
switch(func_num_args()){
case 0:
return false;
case 1:
return !!$value;
case 2:
if (is_array($varList)) {
return array_search($value, $varList, true) !== false;
... | [
"private",
"function",
"maybe",
"(",
"$",
"value",
",",
"$",
"varList",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"false",
";",
"case",
"1",
":",
"return",
"!",
"!",
"$",
"value",
";",
"case",
"2",
... | 断言一个值在给定的一组值之中. 如果只给定一个非数组的值, 那么则进行equal判断;
@param mixed $value
@param mixed $varList
@return boolean | [
"断言一个值在给定的一组值之中",
".",
"如果只给定一个非数组的值",
"那么则进行equal判断",
";"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php#L229-L245 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php | AssertHelper.possible | private function possible($value,$conditions = true){
switch(func_num_args()){
case 0:
return false;
case 1:
return !!$value;
case 2:
if (is_array($conditions)) {
$notInAssert = true;
fore... | php | private function possible($value,$conditions = true){
switch(func_num_args()){
case 0:
return false;
case 1:
return !!$value;
case 2:
if (is_array($conditions)) {
$notInAssert = true;
fore... | [
"private",
"function",
"possible",
"(",
"$",
"value",
",",
"$",
"conditions",
"=",
"true",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"false",
";",
"case",
"1",
":",
"return",
"!",
"!",
"$",
"value",
"... | 断言一个值会符合一组条件中的任意一项.
@param unknown $value
@param unknown $condition
@return boolean | [
"断言一个值会符合一组条件中的任意一项",
"."
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php#L252-L305 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php | AssertHelper.makesure | private function makesure($value, $conditions = false) {
switch (func_num_args()) {
case 0 :
return false;
case 1 :
return ! ! $value;
case 2 :
if (is_array($conditions)) {
// 必须全部返回true,... | php | private function makesure($value, $conditions = false) {
switch (func_num_args()) {
case 0 :
return false;
case 1 :
return ! ! $value;
case 2 :
if (is_array($conditions)) {
// 必须全部返回true,... | [
"private",
"function",
"makesure",
"(",
"$",
"value",
",",
"$",
"conditions",
"=",
"false",
")",
"{",
"switch",
"(",
"func_num_args",
"(",
")",
")",
"{",
"case",
"0",
":",
"return",
"false",
";",
"case",
"1",
":",
"return",
"!",
"!",
"$",
"value",
... | 判断一个值是否完全符合一组条件
@param mixed $value
@param array $conditions
@return boolean | [
"判断一个值是否完全符合一组条件"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/AssertHelper.php#L312-L358 |
esperecyan/dictionary-php | src/Parser.php | Parser.getBinary | public function getBinary(\SplFileInfo $file): string
{
if (!($file instanceof \SplFileObject)) {
$file = $file->openFile();
} else {
$file->rewind();
}
if ($file instanceof \SplTempFileObject) {
$binary = '';
while ($file->valid()) {
... | php | public function getBinary(\SplFileInfo $file): string
{
if (!($file instanceof \SplFileObject)) {
$file = $file->openFile();
} else {
$file->rewind();
}
if ($file instanceof \SplTempFileObject) {
$binary = '';
while ($file->valid()) {
... | [
"public",
"function",
"getBinary",
"(",
"\\",
"SplFileInfo",
"$",
"file",
")",
":",
"string",
"{",
"if",
"(",
"!",
"(",
"$",
"file",
"instanceof",
"\\",
"SplFileObject",
")",
")",
"{",
"$",
"file",
"=",
"$",
"file",
"->",
"openFile",
"(",
")",
";",
... | SplFileInfo の中身を取得します。
@param \SplFileInfo $file
@return string | [
"SplFileInfo",
"の中身を取得します。"
] | train | https://github.com/esperecyan/dictionary-php/blob/14fad08fb43006995c763094e8e7ed0dc0e26676/src/Parser.php#L57-L76 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.hydrate | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : PermissionTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (... | php | public function hydrate($row, $startcol = 0, $rehydrate = false, $indexType = TableMap::TYPE_NUM)
{
try {
$col = $row[TableMap::TYPE_NUM == $indexType ? 0 + $startcol : PermissionTableMap::translateFieldName('Id', TableMap::TYPE_PHPNAME, $indexType)];
$this->id = (null !== $col) ? (... | [
"public",
"function",
"hydrate",
"(",
"$",
"row",
",",
"$",
"startcol",
"=",
"0",
",",
"$",
"rehydrate",
"=",
"false",
",",
"$",
"indexType",
"=",
"TableMap",
"::",
"TYPE_NUM",
")",
"{",
"try",
"{",
"$",
"col",
"=",
"$",
"row",
"[",
"TableMap",
"::... | 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/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L515-L558 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.ensureConsistency | public function ensureConsistency()
{
if ($this->aPermissionRelatedByParentId !== null && $this->parent_id !== $this->aPermissionRelatedByParentId->getId()) {
$this->aPermissionRelatedByParentId = null;
}
} | php | public function ensureConsistency()
{
if ($this->aPermissionRelatedByParentId !== null && $this->parent_id !== $this->aPermissionRelatedByParentId->getId()) {
$this->aPermissionRelatedByParentId = null;
}
} | [
"public",
"function",
"ensureConsistency",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aPermissionRelatedByParentId",
"!==",
"null",
"&&",
"$",
"this",
"->",
"parent_id",
"!==",
"$",
"this",
"->",
"aPermissionRelatedByParentId",
"->",
"getId",
"(",
")",
")",... | Checks and repairs the internal consistency of the object.
This method is executed after an already-instantiated object is re-hydrated
from the database. It exists to check any foreign keys to make sure that
the objects related to the current object are correct based on foreign key.
You can override this method in t... | [
"Checks",
"and",
"repairs",
"the",
"internal",
"consistency",
"of",
"the",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L573-L578 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.setParentId | public function setParentId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->parent_id !== $v) {
$this->parent_id = $v;
$this->modifiedColumns[PermissionTableMap::COL_PARENT_ID] = true;
}
if ($this->aPermissionRelatedByParentId !== nu... | php | public function setParentId($v)
{
if ($v !== null) {
$v = (int) $v;
}
if ($this->parent_id !== $v) {
$this->parent_id = $v;
$this->modifiedColumns[PermissionTableMap::COL_PARENT_ID] = true;
}
if ($this->aPermissionRelatedByParentId !== nu... | [
"public",
"function",
"setParentId",
"(",
"$",
"v",
")",
"{",
"if",
"(",
"$",
"v",
"!==",
"null",
")",
"{",
"$",
"v",
"=",
"(",
"int",
")",
"$",
"v",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"parent_id",
"!==",
"$",
"v",
")",
"{",
"$",
"this... | Set the value of [parent_id] column.
@param int $v new value
@return $this|\Alchemy\Component\Cerberus\Model\Permission The current object (for fluent API support) | [
"Set",
"the",
"value",
"of",
"[",
"parent_id",
"]",
"column",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L706-L722 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.reload | public function reload($deep = false, ConnectionInterface $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("Cannot reload a deleted object.");
}
if ($this->isNew()) {
throw new PropelException("Cannot reload an unsaved object.");
}
... | php | public function reload($deep = false, ConnectionInterface $con = null)
{
if ($this->isDeleted()) {
throw new PropelException("Cannot reload a deleted object.");
}
if ($this->isNew()) {
throw new PropelException("Cannot reload an unsaved object.");
}
... | [
"public",
"function",
"reload",
"(",
"$",
"deep",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"isDeleted",
"(",
")",
")",
"{",
"throw",
"new",
"PropelException",
"(",
"\"Cannot reload a deleted... | Reloads this object from datastore based on primary key and (optionally) resets all associated objects.
This will only work if the object has been saved and has a valid primary key set.
@param boolean $deep (optional) Whether to also de-associated any related objects.
@param ConnectionInterface $con (option... | [
"Reloads",
"this",
"object",
"from",
"datastore",
"based",
"on",
"primary",
"key",
"and",
"(",
"optionally",
")",
"resets",
"all",
"associated",
"objects",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L734-L768 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.doSave | protected function doSave(ConnectionInterface $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 t... | php | protected function doSave(ConnectionInterface $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 t... | [
"protected",
"function",
"doSave",
"(",
"ConnectionInterface",
"$",
"con",
")",
"{",
"$",
"affectedRows",
"=",
"0",
";",
"// initialize var to track total num of affected rows",
"if",
"(",
"!",
"$",
"this",
"->",
"alreadyInSave",
")",
"{",
"$",
"this",
"->",
"al... | 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 ConnectionInterface $con
@return int The number of rows affected by this insert/update and any referri... | [
"Performs",
"the",
"work",
"of",
"inserting",
"or",
"updating",
"the",
"row",
"in",
"the",
"database",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L860-L957 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.toArray | public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['Permission'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['P... | php | public function toArray($keyType = TableMap::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
{
if (isset($alreadyDumpedObjects['Permission'][$this->getPrimaryKey()])) {
return '*RECURSION*';
}
$alreadyDumpedObjects['P... | [
"public",
"function",
"toArray",
"(",
"$",
"keyType",
"=",
"TableMap",
"::",
"TYPE_PHPNAME",
",",
"$",
"includeLazyLoadColumns",
"=",
"true",
",",
"$",
"alreadyDumpedObjects",
"=",
"array",
"(",
")",
",",
"$",
"includeForeignObjects",
"=",
"false",
")",
"{",
... | Exports the object as an array.
You can specify the key type of the array by passing one of the class
type constants.
@param string $keyType (optional) One of the class type constants TableMap::TYPE_PHPNAME, TableMap::TYPE_STUDLYPHPNAME,
TableMap::TYPE_COLNAME, TableMap::TYPE_FIELDNAME, TableMap::TYPE_NUM.
Defau... | [
"Exports",
"the",
"object",
"as",
"an",
"array",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1135-L1169 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.setByPosition | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setName($value);
break;
case 2:
$this->setCreateDate($value);
... | php | public function setByPosition($pos, $value)
{
switch ($pos) {
case 0:
$this->setId($value);
break;
case 1:
$this->setName($value);
break;
case 2:
$this->setCreateDate($value);
... | [
"public",
"function",
"setByPosition",
"(",
"$",
"pos",
",",
"$",
"value",
")",
"{",
"switch",
"(",
"$",
"pos",
")",
"{",
"case",
"0",
":",
"$",
"this",
"->",
"setId",
"(",
"$",
"value",
")",
";",
"break",
";",
"case",
"1",
":",
"$",
"this",
"-... | Sets a field from the object by Position as specified in the xml schema.
Zero-based.
@param int $pos position in xml schema
@param mixed $value field value
@return $this|\Alchemy\Component\Cerberus\Model\Permission | [
"Sets",
"a",
"field",
"from",
"the",
"object",
"by",
"Position",
"as",
"specified",
"in",
"the",
"xml",
"schema",
".",
"Zero",
"-",
"based",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1197-L1224 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.fromArray | public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = PermissionTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setId($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
$this->setName($arr[$keys... | php | public function fromArray($arr, $keyType = TableMap::TYPE_PHPNAME)
{
$keys = PermissionTableMap::getFieldNames($keyType);
if (array_key_exists($keys[0], $arr)) {
$this->setId($arr[$keys[0]]);
}
if (array_key_exists($keys[1], $arr)) {
$this->setName($arr[$keys... | [
"public",
"function",
"fromArray",
"(",
"$",
"arr",
",",
"$",
"keyType",
"=",
"TableMap",
"::",
"TYPE_PHPNAME",
")",
"{",
"$",
"keys",
"=",
"PermissionTableMap",
"::",
"getFieldNames",
"(",
"$",
"keyType",
")",
";",
"if",
"(",
"array_key_exists",
"(",
"$",... | Populates the object using an array.
This is particularly useful when populating an object from one of the
request arrays (e.g. $_POST). This method goes through the column
names, checking to see whether a matching key exists in populated
array. If so the setByName() method is called for that column.
You can specify... | [
"Populates",
"the",
"object",
"using",
"an",
"array",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1243-L1268 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.buildCriteria | public function buildCriteria()
{
$criteria = new Criteria(PermissionTableMap::DATABASE_NAME);
if ($this->isColumnModified(PermissionTableMap::COL_ID)) {
$criteria->add(PermissionTableMap::COL_ID, $this->id);
}
if ($this->isColumnModified(PermissionTableMap::COL_NAME)) {... | php | public function buildCriteria()
{
$criteria = new Criteria(PermissionTableMap::DATABASE_NAME);
if ($this->isColumnModified(PermissionTableMap::COL_ID)) {
$criteria->add(PermissionTableMap::COL_ID, $this->id);
}
if ($this->isColumnModified(PermissionTableMap::COL_NAME)) {... | [
"public",
"function",
"buildCriteria",
"(",
")",
"{",
"$",
"criteria",
"=",
"new",
"Criteria",
"(",
"PermissionTableMap",
"::",
"DATABASE_NAME",
")",
";",
"if",
"(",
"$",
"this",
"->",
"isColumnModified",
"(",
"PermissionTableMap",
"::",
"COL_ID",
")",
")",
... | Build a Criteria object containing the values of all modified columns in this object.
@return Criteria The Criteria object containing all modified values. | [
"Build",
"a",
"Criteria",
"object",
"containing",
"the",
"values",
"of",
"all",
"modified",
"columns",
"in",
"this",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1299-L1326 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.setPermissionRelatedByParentId | public function setPermissionRelatedByParentId(ChildPermission $v = null)
{
if ($v === null) {
$this->setParentId(NULL);
} else {
$this->setParentId($v->getId());
}
$this->aPermissionRelatedByParentId = $v;
// Add binding for other direction of this ... | php | public function setPermissionRelatedByParentId(ChildPermission $v = null)
{
if ($v === null) {
$this->setParentId(NULL);
} else {
$this->setParentId($v->getId());
}
$this->aPermissionRelatedByParentId = $v;
// Add binding for other direction of this ... | [
"public",
"function",
"setPermissionRelatedByParentId",
"(",
"ChildPermission",
"$",
"v",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"v",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"setParentId",
"(",
"NULL",
")",
";",
"}",
"else",
"{",
"$",
"this",
"->",... | Declares an association between this object and a ChildPermission object.
@param ChildPermission $v
@return $this|\Alchemy\Component\Cerberus\Model\Permission The current object (for fluent API support)
@throws PropelException | [
"Declares",
"an",
"association",
"between",
"this",
"object",
"and",
"a",
"ChildPermission",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1471-L1489 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.getPermissionRelatedByParentId | public function getPermissionRelatedByParentId(ConnectionInterface $con = null)
{
if ($this->aPermissionRelatedByParentId === null && ($this->parent_id !== null)) {
$this->aPermissionRelatedByParentId = ChildPermissionQuery::create()->findPk($this->parent_id, $con);
/* The following ... | php | public function getPermissionRelatedByParentId(ConnectionInterface $con = null)
{
if ($this->aPermissionRelatedByParentId === null && ($this->parent_id !== null)) {
$this->aPermissionRelatedByParentId = ChildPermissionQuery::create()->findPk($this->parent_id, $con);
/* The following ... | [
"public",
"function",
"getPermissionRelatedByParentId",
"(",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"aPermissionRelatedByParentId",
"===",
"null",
"&&",
"(",
"$",
"this",
"->",
"parent_id",
"!==",
"null",
")",
"... | Get the associated ChildPermission object
@param ConnectionInterface $con Optional Connection object.
@return ChildPermission The associated ChildPermission object.
@throws PropelException | [
"Get",
"the",
"associated",
"ChildPermission",
"object"
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1499-L1513 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.initPermissionsRelatedById | public function initPermissionsRelatedById($overrideExisting = true)
{
if (null !== $this->collPermissionsRelatedById && !$overrideExisting) {
return;
}
$this->collPermissionsRelatedById = new ObjectCollection();
$this->collPermissionsRelatedById->setModel('\Alchemy\Compo... | php | public function initPermissionsRelatedById($overrideExisting = true)
{
if (null !== $this->collPermissionsRelatedById && !$overrideExisting) {
return;
}
$this->collPermissionsRelatedById = new ObjectCollection();
$this->collPermissionsRelatedById->setModel('\Alchemy\Compo... | [
"public",
"function",
"initPermissionsRelatedById",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collPermissionsRelatedById",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"this",
... | Initializes the collPermissionsRelatedById collection.
By default this just sets the collPermissionsRelatedById collection to an empty array (like clearcollPermissionsRelatedById());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, sett... | [
"Initializes",
"the",
"collPermissionsRelatedById",
"collection",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1568-L1575 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.getPermissionsRelatedById | public function getPermissionsRelatedById(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collPermissionsRelatedByIdPartial && !$this->isNew();
if (null === $this->collPermissionsRelatedById || null !== $criteria || $partial) {
if ($this->isNew() && null ... | php | public function getPermissionsRelatedById(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collPermissionsRelatedByIdPartial && !$this->isNew();
if (null === $this->collPermissionsRelatedById || null !== $criteria || $partial) {
if ($this->isNew() && null ... | [
"public",
"function",
"getPermissionsRelatedById",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collPermissionsRelatedByIdPartial",
"&&",
"!",
"$",
"this",
... | Gets an array of ChildPermission objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $criteri... | [
"Gets",
"an",
"array",
"of",
"ChildPermission",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1591-L1633 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.setPermissionsRelatedById | public function setPermissionsRelatedById(Collection $permissionsRelatedById, ConnectionInterface $con = null)
{
/** @var ChildPermission[] $permissionsRelatedByIdToDelete */
$permissionsRelatedByIdToDelete = $this->getPermissionsRelatedById(new Criteria(), $con)->diff($permissionsRelatedById);
... | php | public function setPermissionsRelatedById(Collection $permissionsRelatedById, ConnectionInterface $con = null)
{
/** @var ChildPermission[] $permissionsRelatedByIdToDelete */
$permissionsRelatedByIdToDelete = $this->getPermissionsRelatedById(new Criteria(), $con)->diff($permissionsRelatedById);
... | [
"public",
"function",
"setPermissionsRelatedById",
"(",
"Collection",
"$",
"permissionsRelatedById",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"/** @var ChildPermission[] $permissionsRelatedByIdToDelete */",
"$",
"permissionsRelatedByIdToDelete",
"=",
"$",
... | Sets a collection of ChildPermission objects related by a one-to-many relationship
to the current object.
It will also schedule objects for deletion based on a diff between old objects (aka persisted)
and new objects from the given Propel collection.
@param Collection $permissionsRelatedById A Propel collection.
... | [
"Sets",
"a",
"collection",
"of",
"ChildPermission",
"objects",
"related",
"by",
"a",
"one",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
".",
"It",
"will",
"also",
"schedule",
"objects",
"for",
"deletion",
"based",
"on",
"a",
"... | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1645-L1666 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.countPermissionsRelatedById | public function countPermissionsRelatedById(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collPermissionsRelatedByIdPartial && !$this->isNew();
if (null === $this->collPermissionsRelatedById || null !== $criteria || $partial) {
if ($th... | php | public function countPermissionsRelatedById(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collPermissionsRelatedByIdPartial && !$this->isNew();
if (null === $this->collPermissionsRelatedById || null !== $criteria || $partial) {
if ($th... | [
"public",
"function",
"countPermissionsRelatedById",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collPermissionsRelat... | Returns the number of related Permission objects.
@param Criteria $criteria
@param boolean $distinct
@param ConnectionInterface $con
@return int Count of related Permission objects.
@throws PropelException | [
"Returns",
"the",
"number",
"of",
"related",
"Permission",
"objects",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1677-L1700 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.addPermissionRelatedById | public function addPermissionRelatedById(ChildPermission $l)
{
if ($this->collPermissionsRelatedById === null) {
$this->initPermissionsRelatedById();
$this->collPermissionsRelatedByIdPartial = true;
}
if (!$this->collPermissionsRelatedById->contains($l)) {
... | php | public function addPermissionRelatedById(ChildPermission $l)
{
if ($this->collPermissionsRelatedById === null) {
$this->initPermissionsRelatedById();
$this->collPermissionsRelatedByIdPartial = true;
}
if (!$this->collPermissionsRelatedById->contains($l)) {
... | [
"public",
"function",
"addPermissionRelatedById",
"(",
"ChildPermission",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collPermissionsRelatedById",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initPermissionsRelatedById",
"(",
")",
";",
"$",
"this",
"->"... | Method called to associate a ChildPermission object to this object
through the ChildPermission foreign key attribute.
@param ChildPermission $l ChildPermission
@return $this|\Alchemy\Component\Cerberus\Model\Permission The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ChildPermission",
"object",
"to",
"this",
"object",
"through",
"the",
"ChildPermission",
"foreign",
"key",
"attribute",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1709-L1721 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.getRolePermissions | public function getRolePermissions(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collRolePermissionsPartial && !$this->isNew();
if (null === $this->collRolePermissions || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collRolePe... | php | public function getRolePermissions(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collRolePermissionsPartial && !$this->isNew();
if (null === $this->collRolePermissions || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collRolePe... | [
"public",
"function",
"getRolePermissions",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collRolePermissionsPartial",
"&&",
"!",
"$",
"this",
"->",
"isN... | Gets an array of ChildRolePermission objects which contain a foreign key that references this object.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cached.
Next time the same method is called without $cri... | [
"Gets",
"an",
"array",
"of",
"ChildRolePermission",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1809-L1851 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.setRolePermissions | public function setRolePermissions(Collection $rolePermissions, ConnectionInterface $con = null)
{
/** @var ChildRolePermission[] $rolePermissionsToDelete */
$rolePermissionsToDelete = $this->getRolePermissions(new Criteria(), $con)->diff($rolePermissions);
//since at least one column in t... | php | public function setRolePermissions(Collection $rolePermissions, ConnectionInterface $con = null)
{
/** @var ChildRolePermission[] $rolePermissionsToDelete */
$rolePermissionsToDelete = $this->getRolePermissions(new Criteria(), $con)->diff($rolePermissions);
//since at least one column in t... | [
"public",
"function",
"setRolePermissions",
"(",
"Collection",
"$",
"rolePermissions",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"/** @var ChildRolePermission[] $rolePermissionsToDelete */",
"$",
"rolePermissionsToDelete",
"=",
"$",
"this",
"->",
"get... | Sets a collection of ChildRolePermission objects related by a one-to-many relationship
to the current object.
It will also schedule objects for deletion based on a diff between old objects (aka persisted)
and new objects from the given Propel collection.
@param Collection $rolePermissions A Propel collection.
@pa... | [
"Sets",
"a",
"collection",
"of",
"ChildRolePermission",
"objects",
"related",
"by",
"a",
"one",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
".",
"It",
"will",
"also",
"schedule",
"objects",
"for",
"deletion",
"based",
"on",
"a",... | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1863-L1887 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.countRolePermissions | public function countRolePermissions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collRolePermissionsPartial && !$this->isNew();
if (null === $this->collRolePermissions || null !== $criteria || $partial) {
if ($this->isNew() && null =... | php | public function countRolePermissions(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collRolePermissionsPartial && !$this->isNew();
if (null === $this->collRolePermissions || null !== $criteria || $partial) {
if ($this->isNew() && null =... | [
"public",
"function",
"countRolePermissions",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collRolePermissionsPartial"... | Returns the number of related RolePermission objects.
@param Criteria $criteria
@param boolean $distinct
@param ConnectionInterface $con
@return int Count of related RolePermission objects.
@throws PropelException | [
"Returns",
"the",
"number",
"of",
"related",
"RolePermission",
"objects",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1898-L1921 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.getRolePermissionsJoinRole | public function getRolePermissionsJoinRole(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildRolePermissionQuery::create(null, $criteria);
$query->joinWith('Role', $joinBehavior);
return $this->getRolePermissions($query, $con);
... | php | public function getRolePermissionsJoinRole(Criteria $criteria = null, ConnectionInterface $con = null, $joinBehavior = Criteria::LEFT_JOIN)
{
$query = ChildRolePermissionQuery::create(null, $criteria);
$query->joinWith('Role', $joinBehavior);
return $this->getRolePermissions($query, $con);
... | [
"public",
"function",
"getRolePermissionsJoinRole",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
",",
"$",
"joinBehavior",
"=",
"Criteria",
"::",
"LEFT_JOIN",
")",
"{",
"$",
"query",
"=",
"ChildRolePermissio... | If this collection has already been initialized with
an identical criteria, it returns the collection.
Otherwise if this Permission is new, it will return
an empty collection; or if this Permission has previously
been saved, it will retrieve related RolePermissions from storage.
This method is protected by default in ... | [
"If",
"this",
"collection",
"has",
"already",
"been",
"initialized",
"with",
"an",
"identical",
"criteria",
"it",
"returns",
"the",
"collection",
".",
"Otherwise",
"if",
"this",
"Permission",
"is",
"new",
"it",
"will",
"return",
"an",
"empty",
"collection",
";... | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L1990-L1996 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.getRoles | public function getRoles(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collRolesPartial && !$this->isNew();
if (null === $this->collRoles || null !== $criteria || $partial) {
if ($this->isNew()) {
// return empty collection
... | php | public function getRoles(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collRolesPartial && !$this->isNew();
if (null === $this->collRoles || null !== $criteria || $partial) {
if ($this->isNew()) {
// return empty collection
... | [
"public",
"function",
"getRoles",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collRolesPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"(",
")",
... | Gets a collection of ChildRole objects related by a many-to-many relationship
to the current object by way of the role_permission cross-reference table.
If the $criteria is not null, it is used to always fetch the results from the database.
Otherwise the results are fetched from the database the first time, then cache... | [
"Gets",
"a",
"collection",
"of",
"ChildRole",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"role_permission",
"cross",
"-",
"reference",
"table",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L2054-L2087 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.countRoles | public function countRoles(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collRolesPartial && !$this->isNew();
if (null === $this->collRoles || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collRoles) {
... | php | public function countRoles(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collRolesPartial && !$this->isNew();
if (null === $this->collRoles || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collRoles) {
... | [
"public",
"function",
"countRoles",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collRolesPartial",
"&&",
"!",
"... | Gets the number of Role objects related by a many-to-many relationship
to the current object by way of the role_permission cross-reference table.
@param Criteria $criteria Optional query object to filter the query
@param boolean $distinct Set to true to force count distinct
@param ConnectionInterface $c... | [
"Gets",
"the",
"number",
"of",
"Role",
"objects",
"related",
"by",
"a",
"many",
"-",
"to",
"-",
"many",
"relationship",
"to",
"the",
"current",
"object",
"by",
"way",
"of",
"the",
"role_permission",
"cross",
"-",
"reference",
"table",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L2132-L2156 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.removeRole | public function removeRole(ChildRole $role)
{
if ($this->getRoles()->contains($role)) { $rolePermission = new ChildRolePermission();
$rolePermission->setRole($role);
if ($role->isPermissionsLoaded()) {
//remove the back reference if available
$role->g... | php | public function removeRole(ChildRole $role)
{
if ($this->getRoles()->contains($role)) { $rolePermission = new ChildRolePermission();
$rolePermission->setRole($role);
if ($role->isPermissionsLoaded()) {
//remove the back reference if available
$role->g... | [
"public",
"function",
"removeRole",
"(",
"ChildRole",
"$",
"role",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"getRoles",
"(",
")",
"->",
"contains",
"(",
"$",
"role",
")",
")",
"{",
"$",
"rolePermission",
"=",
"new",
"ChildRolePermission",
"(",
")",
";",... | Remove role of this object
through the role_permission cross reference table.
@param ChildRole $role
@return ChildPermission The current object (for fluent API support) | [
"Remove",
"role",
"of",
"this",
"object",
"through",
"the",
"role_permission",
"cross",
"reference",
"table",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L2212-L2238 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.clear | public function clear()
{
if (null !== $this->aPermissionRelatedByParentId) {
$this->aPermissionRelatedByParentId->removePermissionRelatedById($this);
}
$this->id = null;
$this->name = null;
$this->create_date = null;
$this->description = null;
$th... | php | public function clear()
{
if (null !== $this->aPermissionRelatedByParentId) {
$this->aPermissionRelatedByParentId->removePermissionRelatedById($this);
}
$this->id = null;
$this->name = null;
$this->create_date = null;
$this->description = null;
$th... | [
"public",
"function",
"clear",
"(",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"aPermissionRelatedByParentId",
")",
"{",
"$",
"this",
"->",
"aPermissionRelatedByParentId",
"->",
"removePermissionRelatedById",
"(",
"$",
"this",
")",
";",
"}",
"$",
... | Clears the current object, sets all attributes to their default values and removes
outgoing references as well as back-references (from other objects to this one. Results probably in a database
change of those foreign objects when you call `save` there). | [
"Clears",
"the",
"current",
"object",
"sets",
"all",
"attributes",
"to",
"their",
"default",
"values",
"and",
"removes",
"outgoing",
"references",
"as",
"well",
"as",
"back",
"-",
"references",
"(",
"from",
"other",
"objects",
"to",
"this",
"one",
".",
"Resu... | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L2245-L2263 |
phpalchemy/cerberus | src/Alchemy/Component/Cerberus/Model/Base/Permission.php | Permission.clearAllReferences | public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collPermissionsRelatedById) {
foreach ($this->collPermissionsRelatedById as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collRolePermissi... | php | public function clearAllReferences($deep = false)
{
if ($deep) {
if ($this->collPermissionsRelatedById) {
foreach ($this->collPermissionsRelatedById as $o) {
$o->clearAllReferences($deep);
}
}
if ($this->collRolePermissi... | [
"public",
"function",
"clearAllReferences",
"(",
"$",
"deep",
"=",
"false",
")",
"{",
"if",
"(",
"$",
"deep",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collPermissionsRelatedById",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"collPermissionsRelatedById",
"... | Resets all references and back-references to other model objects or collections of model objects.
This method is used to reset all php object references (not the actual reference in the database).
Necessary for object serialisation.
@param boolean $deep Whether to also clear the references on all referrer object... | [
"Resets",
"all",
"references",
"and",
"back",
"-",
"references",
"to",
"other",
"model",
"objects",
"or",
"collections",
"of",
"model",
"objects",
"."
] | train | https://github.com/phpalchemy/cerberus/blob/3424a360c9bded71eb5b570bc114a7759cb23ec6/src/Alchemy/Component/Cerberus/Model/Base/Permission.php#L2273-L2297 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.sdkExecute | public function sdkExecute($request) {
$this->setupCharsets($request);
$params['app_id'] = $this->appId;
$params['method'] = $request->getApiMethodName();
$params['format'] = $this->format;
$params['sign_type'] = $this->signType;
$params['timestamp'] = date("Y-m-d H:i:s");
$params['alipay_sdk'] = $th... | php | public function sdkExecute($request) {
$this->setupCharsets($request);
$params['app_id'] = $this->appId;
$params['method'] = $request->getApiMethodName();
$params['format'] = $this->format;
$params['sign_type'] = $this->signType;
$params['timestamp'] = date("Y-m-d H:i:s");
$params['alipay_sdk'] = $th... | [
"public",
"function",
"sdkExecute",
"(",
"$",
"request",
")",
"{",
"$",
"this",
"->",
"setupCharsets",
"(",
"$",
"request",
")",
";",
"$",
"params",
"[",
"'app_id'",
"]",
"=",
"$",
"this",
"->",
"appId",
";",
"$",
"params",
"[",
"'method'",
"]",
"=",... | 生成用于调用收银台SDK的字符串
@param $request SDK接口的请求参数对象
@return string
@author guofa.tgf | [
"生成用于调用收银台SDK的字符串"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L283-L314 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.pageExecute | public function pageExecute($request,$httpmethod = "POST") {
$this->setupCharsets($request);
if (strcasecmp($this->fileCharset, $this->postCharset)) {
// writeLog("本地文件字符集编码与表单提交编码不一致,请务必设置成一样,属性名分别为postCharset!");
throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两... | php | public function pageExecute($request,$httpmethod = "POST") {
$this->setupCharsets($request);
if (strcasecmp($this->fileCharset, $this->postCharset)) {
// writeLog("本地文件字符集编码与表单提交编码不一致,请务必设置成一样,属性名分别为postCharset!");
throw new Exception("文件编码:[" . $this->fileCharset . "] 与表单提交编码:[" . $this->postCharset . "]两... | [
"public",
"function",
"pageExecute",
"(",
"$",
"request",
",",
"$",
"httpmethod",
"=",
"\"POST\"",
")",
"{",
"$",
"this",
"->",
"setupCharsets",
"(",
"$",
"request",
")",
";",
"if",
"(",
"strcasecmp",
"(",
"$",
"this",
"->",
"fileCharset",
",",
"$",
"t... | /*
页面提交执行方法
@param:跳转类接口的request; $httpmethod 提交方式。两个值可选:post、get
@return:构建好的、签名后的最终跳转URL(GET)或String形式的form(POST)
auther:笙默 | [
"/",
"*",
"页面提交执行方法"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L322-L406 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.buildRequestForm | protected function buildRequestForm($para_temp) {
$sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='".$this->gatewayUrl."?charset=".trim($this->postCharset)."' method='POST'>";
while (list ($key, $val) = each ($para_temp)) {
if (false === $this->checkEmpty($val)) {
//$val = $this->characet($va... | php | protected function buildRequestForm($para_temp) {
$sHtml = "<form id='alipaysubmit' name='alipaysubmit' action='".$this->gatewayUrl."?charset=".trim($this->postCharset)."' method='POST'>";
while (list ($key, $val) = each ($para_temp)) {
if (false === $this->checkEmpty($val)) {
//$val = $this->characet($va... | [
"protected",
"function",
"buildRequestForm",
"(",
"$",
"para_temp",
")",
"{",
"$",
"sHtml",
"=",
"\"<form id='alipaysubmit' name='alipaysubmit' action='\"",
".",
"$",
"this",
"->",
"gatewayUrl",
".",
"\"?charset=\"",
".",
"trim",
"(",
"$",
"this",
"->",
"postCharset... | 建立请求,以表单HTML形式构造(默认)
@param $para_temp 请求参数数组
@return 提交表单HTML文本 | [
"建立请求,以表单HTML形式构造(默认)"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L415-L433 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.characet | function characet($data, $targetCharset) {
if (!empty($data)) {
$fileType = $this->fileCharset;
if (strcasecmp($fileType, $targetCharset) != 0) {
$data = mb_convert_encoding($data, $targetCharset, $fileType);
// $data = iconv($fileType, $targetCharset.'//IGNORE', $data);
}
}
return $data;... | php | function characet($data, $targetCharset) {
if (!empty($data)) {
$fileType = $this->fileCharset;
if (strcasecmp($fileType, $targetCharset) != 0) {
$data = mb_convert_encoding($data, $targetCharset, $fileType);
// $data = iconv($fileType, $targetCharset.'//IGNORE', $data);
}
}
return $data;... | [
"function",
"characet",
"(",
"$",
"data",
",",
"$",
"targetCharset",
")",
"{",
"if",
"(",
"!",
"empty",
"(",
"$",
"data",
")",
")",
"{",
"$",
"fileType",
"=",
"$",
"this",
"->",
"fileCharset",
";",
"if",
"(",
"strcasecmp",
"(",
"$",
"fileType",
","... | 转换字符集编码
@param $data
@param $targetCharset
@return string | [
"转换字符集编码"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L591-L603 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.rsaCheckV1 | public function rsaCheckV1($params, $rsaPublicKeyFilePath,$signType='RSA') {
$sign = $params['sign'];
$params['sign_type'] = null;
$params['sign'] = null;
return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath,$signType);
} | php | public function rsaCheckV1($params, $rsaPublicKeyFilePath,$signType='RSA') {
$sign = $params['sign'];
$params['sign_type'] = null;
$params['sign'] = null;
return $this->verify($this->getSignContent($params), $sign, $rsaPublicKeyFilePath,$signType);
} | [
"public",
"function",
"rsaCheckV1",
"(",
"$",
"params",
",",
"$",
"rsaPublicKeyFilePath",
",",
"$",
"signType",
"=",
"'RSA'",
")",
"{",
"$",
"sign",
"=",
"$",
"params",
"[",
"'sign'",
"]",
";",
"$",
"params",
"[",
"'sign_type'",
"]",
"=",
"null",
";",
... | rsaCheckV1 & rsaCheckV2
验证签名
在使用本方法前,必须初始化AopClient且传入公钥参数。
公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 | [
"rsaCheckV1",
"&",
"rsaCheckV2",
"验证签名",
"在使用本方法前,必须初始化AopClient且传入公钥参数。",
"公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L652-L657 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.checkSignAndDecrypt | public function checkSignAndDecrypt($params, $rsaPublicKeyPem, $rsaPrivateKeyPem, $isCheckSign, $isDecrypt, $signType='RSA') {
$charset = $params['charset'];
$bizContent = $params['biz_content'];
if ($isCheckSign) {
if (!$this->rsaCheckV2($params, $rsaPublicKeyPem, $signType)) {
echo "<br/>checkSign failur... | php | public function checkSignAndDecrypt($params, $rsaPublicKeyPem, $rsaPrivateKeyPem, $isCheckSign, $isDecrypt, $signType='RSA') {
$charset = $params['charset'];
$bizContent = $params['biz_content'];
if ($isCheckSign) {
if (!$this->rsaCheckV2($params, $rsaPublicKeyPem, $signType)) {
echo "<br/>checkSign failur... | [
"public",
"function",
"checkSignAndDecrypt",
"(",
"$",
"params",
",",
"$",
"rsaPublicKeyPem",
",",
"$",
"rsaPrivateKeyPem",
",",
"$",
"isCheckSign",
",",
"$",
"isDecrypt",
",",
"$",
"signType",
"=",
"'RSA'",
")",
"{",
"$",
"charset",
"=",
"$",
"params",
"[... | 在使用本方法前,必须初始化AopClient且传入公私钥参数。
公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 | [
"在使用本方法前,必须初始化AopClient且传入公私钥参数。",
"公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L701-L715 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.encryptAndSign | public function encryptAndSign($bizContent, $rsaPublicKeyPem, $rsaPrivateKeyPem, $charset, $isEncrypt, $isSign, $signType='RSA') {
// 加密,并签名
if ($isEncrypt && $isSign) {
$encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset);
$sign = $this->sign($encrypted, $signType);
$response = "<?xml v... | php | public function encryptAndSign($bizContent, $rsaPublicKeyPem, $rsaPrivateKeyPem, $charset, $isEncrypt, $isSign, $signType='RSA') {
// 加密,并签名
if ($isEncrypt && $isSign) {
$encrypted = $this->rsaEncrypt($bizContent, $rsaPublicKeyPem, $charset);
$sign = $this->sign($encrypted, $signType);
$response = "<?xml v... | [
"public",
"function",
"encryptAndSign",
"(",
"$",
"bizContent",
",",
"$",
"rsaPublicKeyPem",
",",
"$",
"rsaPrivateKeyPem",
",",
"$",
"charset",
",",
"$",
"isEncrypt",
",",
"$",
"isSign",
",",
"$",
"signType",
"=",
"'RSA'",
")",
"{",
"// 加密,并签名",
"if",
"(",... | 在使用本方法前,必须初始化AopClient且传入公私钥参数。
公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 | [
"在使用本方法前,必须初始化AopClient且传入公私钥参数。",
"公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L721-L744 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.rsaEncrypt | public function rsaEncrypt($data, $rsaPublicKeyPem, $charset) {
if($this->checkEmpty($this->alipayPublicKey)){
//读取字符串
$pubKey= $this->alipayrsaPublicKey;
$res = "-----BEGIN PUBLIC KEY-----\n" .
wordwrap($pubKey, 64, "\n", true) .
"\n-----END PUBLIC KEY-----";
}else {
//读取公钥文件
$pubKey = file_... | php | public function rsaEncrypt($data, $rsaPublicKeyPem, $charset) {
if($this->checkEmpty($this->alipayPublicKey)){
//读取字符串
$pubKey= $this->alipayrsaPublicKey;
$res = "-----BEGIN PUBLIC KEY-----\n" .
wordwrap($pubKey, 64, "\n", true) .
"\n-----END PUBLIC KEY-----";
}else {
//读取公钥文件
$pubKey = file_... | [
"public",
"function",
"rsaEncrypt",
"(",
"$",
"data",
",",
"$",
"rsaPublicKeyPem",
",",
"$",
"charset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"checkEmpty",
"(",
"$",
"this",
"->",
"alipayPublicKey",
")",
")",
"{",
"//读取字符串",
"$",
"pubKey",
"=",
"$",
... | 在使用本方法前,必须初始化AopClient且传入公私钥参数。
公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 | [
"在使用本方法前,必须初始化AopClient且传入公私钥参数。",
"公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L750-L777 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.rsaDecrypt | public function rsaDecrypt($data, $rsaPrivateKeyPem, $charset) {
if($this->checkEmpty($this->rsaPrivateKeyFilePath)){
//读字符串
$priKey=$this->rsaPrivateKey;
$res = "-----BEGIN RSA PRIVATE KEY-----\n" .
wordwrap($priKey, 64, "\n", true) .
"\n-----END RSA PRIVATE KEY-----";
}else {
$priKey = file... | php | public function rsaDecrypt($data, $rsaPrivateKeyPem, $charset) {
if($this->checkEmpty($this->rsaPrivateKeyFilePath)){
//读字符串
$priKey=$this->rsaPrivateKey;
$res = "-----BEGIN RSA PRIVATE KEY-----\n" .
wordwrap($priKey, 64, "\n", true) .
"\n-----END RSA PRIVATE KEY-----";
}else {
$priKey = file... | [
"public",
"function",
"rsaDecrypt",
"(",
"$",
"data",
",",
"$",
"rsaPrivateKeyPem",
",",
"$",
"charset",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"checkEmpty",
"(",
"$",
"this",
"->",
"rsaPrivateKeyFilePath",
")",
")",
"{",
"//读字符串",
"$",
"priKey",
"=",
... | 在使用本方法前,必须初始化AopClient且传入公私钥参数。
公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。 | [
"在使用本方法前,必须初始化AopClient且传入公私钥参数。",
"公钥是否是读取字符串还是读取文件,是根据初始化传入的值判断的。"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L783-L807 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.checkResponseSign | public function checkResponseSign($request, $signData, $resp, $respObject) {
if (!$this->checkEmpty($this->alipayPublicKey) || !$this->checkEmpty($this->alipayrsaPublicKey)) {
if ($signData == null || $this->checkEmpty($signData->sign) || $this->checkEmpty($signData->signSourceData)) {
throw new Exception(... | php | public function checkResponseSign($request, $signData, $resp, $respObject) {
if (!$this->checkEmpty($this->alipayPublicKey) || !$this->checkEmpty($this->alipayrsaPublicKey)) {
if ($signData == null || $this->checkEmpty($signData->sign) || $this->checkEmpty($signData->signSourceData)) {
throw new Exception(... | [
"public",
"function",
"checkResponseSign",
"(",
"$",
"request",
",",
"$",
"signData",
",",
"$",
"resp",
",",
"$",
"respObject",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"checkEmpty",
"(",
"$",
"this",
"->",
"alipayPublicKey",
")",
"||",
"!",
"$",
... | 验签
@param $request
@param $signData
@param $resp
@param $respObject
@throws Exception | [
"验签"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L1022-L1064 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.encryptJSONSignSource | private function encryptJSONSignSource($request, $responseContent) {
$parsetItem = $this->parserEncryptJSONSignSource($request, $responseContent);
$bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
$bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) ... | php | private function encryptJSONSignSource($request, $responseContent) {
$parsetItem = $this->parserEncryptJSONSignSource($request, $responseContent);
$bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
$bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) ... | [
"private",
"function",
"encryptJSONSignSource",
"(",
"$",
"request",
",",
"$",
"responseContent",
")",
"{",
"$",
"parsetItem",
"=",
"$",
"this",
"->",
"parserEncryptJSONSignSource",
"(",
"$",
"request",
",",
"$",
"responseContent",
")",
";",
"$",
"bodyIndexConte... | 获取加密内容 | [
"获取加密内容"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L1076-L1086 |
huasituo/hstcms | src/Libraries/Alipay/AopClient.php | AopClient.encryptXMLSignSource | private function encryptXMLSignSource($request, $responseContent) {
$parsetItem = $this->parserEncryptXMLSignSource($request, $responseContent);
$bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
$bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + ... | php | private function encryptXMLSignSource($request, $responseContent) {
$parsetItem = $this->parserEncryptXMLSignSource($request, $responseContent);
$bodyIndexContent = substr($responseContent, 0, $parsetItem->startIndex);
$bodyEndContent = substr($responseContent, $parsetItem->endIndex, strlen($responseContent) + ... | [
"private",
"function",
"encryptXMLSignSource",
"(",
"$",
"request",
",",
"$",
"responseContent",
")",
"{",
"$",
"parsetItem",
"=",
"$",
"this",
"->",
"parserEncryptXMLSignSource",
"(",
"$",
"request",
",",
"$",
"responseContent",
")",
";",
"$",
"bodyIndexContent... | 获取加密内容 | [
"获取加密内容"
] | train | https://github.com/huasituo/hstcms/blob/12819979289e58ce38e3e92540aeeb16e205e525/src/Libraries/Alipay/AopClient.php#L1141-L1151 |
FrenchFrogs/framework | src/Table/Column/Custom.php | Custom.setCustom | public function setCustom($custom)
{
if (!is_callable($custom)) {
throw new \InvalidArgumentException('"' . $custom . '" is not callable');
}
$this->custom = $custom;
return $this;
} | php | public function setCustom($custom)
{
if (!is_callable($custom)) {
throw new \InvalidArgumentException('"' . $custom . '" is not callable');
}
$this->custom = $custom;
return $this;
} | [
"public",
"function",
"setCustom",
"(",
"$",
"custom",
")",
"{",
"if",
"(",
"!",
"is_callable",
"(",
"$",
"custom",
")",
")",
"{",
"throw",
"new",
"\\",
"InvalidArgumentException",
"(",
"'\"'",
".",
"$",
"custom",
".",
"'\" is not callable'",
")",
";",
"... | SETTER for $custom
@param $custom
@return $this | [
"SETTER",
"for",
"$custom"
] | train | https://github.com/FrenchFrogs/framework/blob/a4838c698a5600437e87dac6d35ba8ebe32c4395/src/Table/Column/Custom.php#L37-L45 |
czim/laravel-pxlcms | src/Sluggable/SluggableTranslatedTrait.php | SluggableTranslatedTrait.findBySlug | public static function findBySlug($slug, $locale = null)
{
/** @var \Dimsav\Translatable\Translatable $model */
$model = (new static);
/** @var SluggableTrait $translationModel */
$translationModel = $model->getTranslationModelName();
$parentKey = $model->getRelationK... | php | public static function findBySlug($slug, $locale = null)
{
/** @var \Dimsav\Translatable\Translatable $model */
$model = (new static);
/** @var SluggableTrait $translationModel */
$translationModel = $model->getTranslationModelName();
$parentKey = $model->getRelationK... | [
"public",
"static",
"function",
"findBySlug",
"(",
"$",
"slug",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"/** @var \\Dimsav\\Translatable\\Translatable $model */",
"$",
"model",
"=",
"(",
"new",
"static",
")",
";",
"/** @var SluggableTrait $translationModel */",
"$"... | Find by slug on translated attribute
@param string $slug
@param string $locale optional, if omitted returns for any locale
@return $this|null | [
"Find",
"by",
"slug",
"on",
"translated",
"attribute"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Sluggable/SluggableTranslatedTrait.php#L20-L34 |
czim/laravel-pxlcms | src/Sluggable/SluggableTranslatedTrait.php | SluggableTranslatedTrait.scopeWhereSlug | public function scopeWhereSlug($query, $slug, $locale = null)
{
return $query->whereHas('translations', function ($query) use ($slug, $locale) {
return $query->whereSlug($slug, $locale, true);
});
} | php | public function scopeWhereSlug($query, $slug, $locale = null)
{
return $query->whereHas('translations', function ($query) use ($slug, $locale) {
return $query->whereSlug($slug, $locale, true);
});
} | [
"public",
"function",
"scopeWhereSlug",
"(",
"$",
"query",
",",
"$",
"slug",
",",
"$",
"locale",
"=",
"null",
")",
"{",
"return",
"$",
"query",
"->",
"whereHas",
"(",
"'translations'",
",",
"function",
"(",
"$",
"query",
")",
"use",
"(",
"$",
"slug",
... | Scopes query for slug on translated attribute
@param \Illuminate\Database\Eloquent\Builder $query
@param string $slug
@param string $locale
@return $this|null | [
"Scopes",
"query",
"for",
"slug",
"on",
"translated",
"attribute"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Sluggable/SluggableTranslatedTrait.php#L44-L49 |
czim/laravel-pxlcms | src/Sluggable/SluggableTranslatedTrait.php | SluggableTranslatedTrait.sluggify | public function sluggify($force = false)
{
/** @var \Dimsav\Translatable\Translatable $this */
/** @var \Cviebrock\EloquentSluggable\SluggableInterface $translation */
$translation = $this->getTranslation();
if ( ! empty($translation)) {
$translation->sluggify($force);
... | php | public function sluggify($force = false)
{
/** @var \Dimsav\Translatable\Translatable $this */
/** @var \Cviebrock\EloquentSluggable\SluggableInterface $translation */
$translation = $this->getTranslation();
if ( ! empty($translation)) {
$translation->sluggify($force);
... | [
"public",
"function",
"sluggify",
"(",
"$",
"force",
"=",
"false",
")",
"{",
"/** @var \\Dimsav\\Translatable\\Translatable $this */",
"/** @var \\Cviebrock\\EloquentSluggable\\SluggableInterface $translation */",
"$",
"translation",
"=",
"$",
"this",
"->",
"getTranslation",
"(... | Sluggifies the translation model (for default/active locale)
@param bool $force
@return $this | [
"Sluggifies",
"the",
"translation",
"model",
"(",
"for",
"default",
"/",
"active",
"locale",
")"
] | train | https://github.com/czim/laravel-pxlcms/blob/910297d2a3f2db86dde51b0e10fe5aad45f1aa1a/src/Sluggable/SluggableTranslatedTrait.php#L74-L86 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php | HttpRequest.encodePostBody | private function encodePostBody($body) {
if ($body === null) {
return '';
}
if (! is_array($body)) {
return urlencode(strval($body));
}
$result = array ();
foreach ( $body as $k => $v ) {
$result [ ] = urlencode($k) . ... | php | private function encodePostBody($body) {
if ($body === null) {
return '';
}
if (! is_array($body)) {
return urlencode(strval($body));
}
$result = array ();
foreach ( $body as $k => $v ) {
$result [ ] = urlencode($k) . ... | [
"private",
"function",
"encodePostBody",
"(",
"$",
"body",
")",
"{",
"if",
"(",
"$",
"body",
"===",
"null",
")",
"{",
"return",
"''",
";",
"}",
"if",
"(",
"!",
"is_array",
"(",
"$",
"body",
")",
")",
"{",
"return",
"urlencode",
"(",
"strval",
"(",
... | 以标准uri风格编码一个array<K,V>
@param array<K,V> $body
@return string | [
"以标准uri风格编码一个array<K",
"V",
">"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php#L119-L134 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php | HttpRequest.parseResponse | private function parseResponse($content) {
list ( $headerStr, $body ) = explode("\r\n\r\n", $content, 2);
$header = array ();
$headerPart = explode("\r\n", $headerStr);
list ( $httpProtocol, $statusCode, $statStr ) = explode(' ', array_shift($headerPar... | php | private function parseResponse($content) {
list ( $headerStr, $body ) = explode("\r\n\r\n", $content, 2);
$header = array ();
$headerPart = explode("\r\n", $headerStr);
list ( $httpProtocol, $statusCode, $statStr ) = explode(' ', array_shift($headerPar... | [
"private",
"function",
"parseResponse",
"(",
"$",
"content",
")",
"{",
"list",
"(",
"$",
"headerStr",
",",
"$",
"body",
")",
"=",
"explode",
"(",
"\"\\r\\n\\r\\n\"",
",",
"$",
"content",
",",
"2",
")",
";",
"$",
"header",
"=",
"array",
"(",
")",
";",... | 解析curl的response,并折分其中的header与body部份.
@param string $content
@return array | [
"解析curl的response",
"并折分其中的header与body部份",
"."
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php#L140-L164 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php | HttpRequest.request | function request($path = '', $method = "GET", $payload = "", $reqHeaders = null, $curlOpts = null) {
if ($path === null) {
throw new HttpException('path must be string');
}
// 决定访问位置
$url = $this->resolve($path);
$curlOptsFinal = $this -> curren... | php | function request($path = '', $method = "GET", $payload = "", $reqHeaders = null, $curlOpts = null) {
if ($path === null) {
throw new HttpException('path must be string');
}
// 决定访问位置
$url = $this->resolve($path);
$curlOptsFinal = $this -> curren... | [
"function",
"request",
"(",
"$",
"path",
"=",
"''",
",",
"$",
"method",
"=",
"\"GET\"",
",",
"$",
"payload",
"=",
"\"\"",
",",
"$",
"reqHeaders",
"=",
"null",
",",
"$",
"curlOpts",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"path",
"===",
"null",
")"... | 发起http请求, 并返回响应内容
@param [string] $path
url的拼接部份,将拼接到urlBase部份
@param [string] $method
使用的http请求方法, 目前只支持GET和POST
@param [mixed] $payload
请求时的附加的数据.
@param [array] $reqHeaders
请求时附加的header信息
@param [array] $curlOpts
每次请求时, 对curl的配置信息.
@throws HttpException 请求异常时, 抛出异常
@return array http response信息 , 具有如下结构 array(
http... | [
"发起http请求",
"并返回响应内容"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php#L187-L255 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php | HttpRequest.get | function get($path, $query = null, $headers = null, $curlOpts = null) {
$payload = $this -> encodePostBody($query);
if ($payload !== "") {
if (strpos($path, '?')) {
$url = $path . "&" . $payload;
} else {
$url = $path . "?" . $payload;
... | php | function get($path, $query = null, $headers = null, $curlOpts = null) {
$payload = $this -> encodePostBody($query);
if ($payload !== "") {
if (strpos($path, '?')) {
$url = $path . "&" . $payload;
} else {
$url = $path . "?" . $payload;
... | [
"function",
"get",
"(",
"$",
"path",
",",
"$",
"query",
"=",
"null",
",",
"$",
"headers",
"=",
"null",
",",
"$",
"curlOpts",
"=",
"null",
")",
"{",
"$",
"payload",
"=",
"$",
"this",
"->",
"encodePostBody",
"(",
"$",
"query",
")",
";",
"if",
"(",
... | 快速发起get请求
@param string $path
请求资源路径
@param array $query
请求参数
@param array $headers
附带header
@param array $curlOpts
附加curlOpts
@return array http response信息 , 具有如下结构 array(
httpProtocol:'',
status:'',
statusMsg:'',
header:array(),
content:""
) | [
"快速发起get请求"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php#L276-L290 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php | HttpRequest.post | function post($path = null, $postBody = null, $headers = null, $curlOpts = null) {
$payload = $this -> encodePostBody($postBody);
$this -> log -> debug("\n\n ====== Dump the payload before Http POST send! ====== \n\n$payload\n\n====== End Dump! ======\n");
return $this -> request($path, self::HT... | php | function post($path = null, $postBody = null, $headers = null, $curlOpts = null) {
$payload = $this -> encodePostBody($postBody);
$this -> log -> debug("\n\n ====== Dump the payload before Http POST send! ====== \n\n$payload\n\n====== End Dump! ======\n");
return $this -> request($path, self::HT... | [
"function",
"post",
"(",
"$",
"path",
"=",
"null",
",",
"$",
"postBody",
"=",
"null",
",",
"$",
"headers",
"=",
"null",
",",
"$",
"curlOpts",
"=",
"null",
")",
"{",
"$",
"payload",
"=",
"$",
"this",
"->",
"encodePostBody",
"(",
"$",
"postBody",
")"... | 快速发起post请求
@param string $path
请求资源路径
@param array $postBody
请求参数
@param array $headers
附带header
@param array $curlOpts
附加curlOpts
@return array http response信息 , 具有如下结构 array(
httpProtocol:'',
status:'',
statusMsg:'',
header:array(),
content:""
) | [
"快速发起post请求"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php#L311-L315 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php | HttpRequest.resolve | public function resolve($path){
// 如果不指定完整的url, 则认为是访问$urlBase内资源
if ($this -> isUrlFormat($path)) {
$url = $path;
}
// 忽略重复的路径分隔符
else if (strpos($path, '/') === 0) {
$url = $this -> urlBase . substr($path, 1);
} else {
$url = $this ->... | php | public function resolve($path){
// 如果不指定完整的url, 则认为是访问$urlBase内资源
if ($this -> isUrlFormat($path)) {
$url = $path;
}
// 忽略重复的路径分隔符
else if (strpos($path, '/') === 0) {
$url = $this -> urlBase . substr($path, 1);
} else {
$url = $this ->... | [
"public",
"function",
"resolve",
"(",
"$",
"path",
")",
"{",
"// 如果不指定完整的url, 则认为是访问$urlBase内资源",
"if",
"(",
"$",
"this",
"->",
"isUrlFormat",
"(",
"$",
"path",
")",
")",
"{",
"$",
"url",
"=",
"$",
"path",
";",
"}",
"// 忽略重复的路径分隔符",
"else",
"if",
"(",
... | 根据传入内容,决定具体请求地址;
@param string $path
@return Ambigous <string, unknown> | [
"根据传入内容",
"决定具体请求地址",
";"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php#L322-L335 |
dengyongbin/loopeer-lib | src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php | HttpRequest.getResourceAddress | public function getResourceAddress($url){
$url = $this->resolve($url);
$p = strpos($url,'?');
$p = $p === false ? strpos($url,'#') : $p;
return $p === false ? $url : substr($url, 0, $p);
} | php | public function getResourceAddress($url){
$url = $this->resolve($url);
$p = strpos($url,'?');
$p = $p === false ? strpos($url,'#') : $p;
return $p === false ? $url : substr($url, 0, $p);
} | [
"public",
"function",
"getResourceAddress",
"(",
"$",
"url",
")",
"{",
"$",
"url",
"=",
"$",
"this",
"->",
"resolve",
"(",
"$",
"url",
")",
";",
"$",
"p",
"=",
"strpos",
"(",
"$",
"url",
",",
"'?'",
")",
";",
"$",
"p",
"=",
"$",
"p",
"===",
"... | 取得url中表示资源位置的部份,即去掉query_string及其后的部份
@param string $url
@return string | [
"取得url中表示资源位置的部份",
"即去掉query_string及其后的部份"
] | train | https://github.com/dengyongbin/loopeer-lib/blob/4609338f6a48666ca96ee380509a5b5cb066808f/src/Services/Baidu-Push-Server-SDK-Php-3.0.1/lib/HttpRequest.php#L343-L350 |
vincentchalamon/VinceCmsSonataAdminBundle | Admin/Entity/ArticleAdmin.php | ArticleAdmin.setUser | public function setUser(SecurityContext $context)
{
$this->user = $context->getToken() ? $context->getToken()->getUser() : null;
} | php | public function setUser(SecurityContext $context)
{
$this->user = $context->getToken() ? $context->getToken()->getUser() : null;
} | [
"public",
"function",
"setUser",
"(",
"SecurityContext",
"$",
"context",
")",
"{",
"$",
"this",
"->",
"user",
"=",
"$",
"context",
"->",
"getToken",
"(",
")",
"?",
"$",
"context",
"->",
"getToken",
"(",
")",
"->",
"getUser",
"(",
")",
":",
"null",
";... | Set user
@author Vincent Chalamon <vincentchalamon@gmail.com>
@param SecurityContext $context | [
"Set",
"user"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Admin/Entity/ArticleAdmin.php#L112-L115 |
vincentchalamon/VinceCmsSonataAdminBundle | Admin/Entity/ArticleAdmin.php | ArticleAdmin.getBatchActions | public function getBatchActions()
{
return array_merge(parent::getBatchActions(), array(
'publish' => array(
'label' => $this->trans('action.publish', array(), 'SonataAdminBundle'),
'ask_confirmation' => true,
),
... | php | public function getBatchActions()
{
return array_merge(parent::getBatchActions(), array(
'publish' => array(
'label' => $this->trans('action.publish', array(), 'SonataAdminBundle'),
'ask_confirmation' => true,
),
... | [
"public",
"function",
"getBatchActions",
"(",
")",
"{",
"return",
"array_merge",
"(",
"parent",
"::",
"getBatchActions",
"(",
")",
",",
"array",
"(",
"'publish'",
"=>",
"array",
"(",
"'label'",
"=>",
"$",
"this",
"->",
"trans",
"(",
"'action.publish'",
",",
... | {@inheritdoc} | [
"{"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Admin/Entity/ArticleAdmin.php#L172-L185 |
vincentchalamon/VinceCmsSonataAdminBundle | Admin/Entity/ArticleAdmin.php | ArticleAdmin.createQuery | public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
$query->leftJoin($query->getRootAlias().'.template', 'template')->addSelect('template')
->leftJoin('template.areas', 'area')->addSelect('area')
->leftJoin($query->getRootAlias().'.met... | php | public function createQuery($context = 'list')
{
$query = parent::createQuery($context);
$query->leftJoin($query->getRootAlias().'.template', 'template')->addSelect('template')
->leftJoin('template.areas', 'area')->addSelect('area')
->leftJoin($query->getRootAlias().'.met... | [
"public",
"function",
"createQuery",
"(",
"$",
"context",
"=",
"'list'",
")",
"{",
"$",
"query",
"=",
"parent",
"::",
"createQuery",
"(",
"$",
"context",
")",
";",
"$",
"query",
"->",
"leftJoin",
"(",
"$",
"query",
"->",
"getRootAlias",
"(",
")",
".",
... | Need to override createQuery method because or list order & joins
{@inheritdoc} | [
"Need",
"to",
"override",
"createQuery",
"method",
"because",
"or",
"list",
"order",
"&",
"joins"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Admin/Entity/ArticleAdmin.php#L192-L201 |
vincentchalamon/VinceCmsSonataAdminBundle | Admin/Entity/ArticleAdmin.php | ArticleAdmin.getNewInstance | public function getNewInstance()
{
/** @var Article $article */
$article = parent::getNewInstance();
$builder = $this->repository->createQueryBuilder('m');
$metas = $builder->where(
$builder->expr()->in('m.name', array('language', 'robots', 'og:type', 'twitter:card', 't... | php | public function getNewInstance()
{
/** @var Article $article */
$article = parent::getNewInstance();
$builder = $this->repository->createQueryBuilder('m');
$metas = $builder->where(
$builder->expr()->in('m.name', array('language', 'robots', 'og:type', 'twitter:card', 't... | [
"public",
"function",
"getNewInstance",
"(",
")",
"{",
"/** @var Article $article */",
"$",
"article",
"=",
"parent",
"::",
"getNewInstance",
"(",
")",
";",
"$",
"builder",
"=",
"$",
"this",
"->",
"repository",
"->",
"createQueryBuilder",
"(",
"'m'",
")",
";",... | {@inheritdoc} | [
"{"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Admin/Entity/ArticleAdmin.php#L214-L260 |
vincentchalamon/VinceCmsSonataAdminBundle | Admin/Entity/ArticleAdmin.php | ArticleAdmin.configureFormFields | protected function configureFormFields(FormMapper $mapper)
{
$mapper
->with('article.group.general', array('class' => 'col-md-6'))
->add('title', null, array(
'label' => 'article.field.title',
)
)
->add('... | php | protected function configureFormFields(FormMapper $mapper)
{
$mapper
->with('article.group.general', array('class' => 'col-md-6'))
->add('title', null, array(
'label' => 'article.field.title',
)
)
->add('... | [
"protected",
"function",
"configureFormFields",
"(",
"FormMapper",
"$",
"mapper",
")",
"{",
"$",
"mapper",
"->",
"with",
"(",
"'article.group.general'",
",",
"array",
"(",
"'class'",
"=>",
"'col-md-6'",
")",
")",
"->",
"add",
"(",
"'title'",
",",
"null",
","... | {@inheritdoc} | [
"{"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Admin/Entity/ArticleAdmin.php#L279-L337 |
vincentchalamon/VinceCmsSonataAdminBundle | Admin/Entity/ArticleAdmin.php | ArticleAdmin.prePersist | public function prePersist($object)
{
/** @var Article $object */
// Remove empty contents or from other templates
foreach ($object->getContents() as $content) {
/** @var Content $content */
if ($content->getArea()->getTemplate()->getId() != $object->getTemplate()->ge... | php | public function prePersist($object)
{
/** @var Article $object */
// Remove empty contents or from other templates
foreach ($object->getContents() as $content) {
/** @var Content $content */
if ($content->getArea()->getTemplate()->getId() != $object->getTemplate()->ge... | [
"public",
"function",
"prePersist",
"(",
"$",
"object",
")",
"{",
"/** @var Article $object */",
"// Remove empty contents or from other templates",
"foreach",
"(",
"$",
"object",
"->",
"getContents",
"(",
")",
"as",
"$",
"content",
")",
"{",
"/** @var Content $content ... | {@inheritdoc} | [
"{"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Admin/Entity/ArticleAdmin.php#L342-L363 |
vincentchalamon/VinceCmsSonataAdminBundle | Admin/Entity/ArticleAdmin.php | ArticleAdmin.postPersist | public function postPersist($object)
{
// Need to clear router cache
$files = Finder::create()->files()->name('/app[A-z]+Url(?:Generator|Matcher)\.php/')->in($this->cacheDir);
foreach ($files as $file) {
/** @var \SplFileInfo $file */
unlink($file->__toString());
... | php | public function postPersist($object)
{
// Need to clear router cache
$files = Finder::create()->files()->name('/app[A-z]+Url(?:Generator|Matcher)\.php/')->in($this->cacheDir);
foreach ($files as $file) {
/** @var \SplFileInfo $file */
unlink($file->__toString());
... | [
"public",
"function",
"postPersist",
"(",
"$",
"object",
")",
"{",
"// Need to clear router cache",
"$",
"files",
"=",
"Finder",
"::",
"create",
"(",
")",
"->",
"files",
"(",
")",
"->",
"name",
"(",
"'/app[A-z]+Url(?:Generator|Matcher)\\.php/'",
")",
"->",
"in",... | {@inheritdoc} | [
"{"
] | train | https://github.com/vincentchalamon/VinceCmsSonataAdminBundle/blob/edc768061734a92ba116488dd7b61ad40af21ceb/Admin/Entity/ArticleAdmin.php#L394-L402 |
chippyash/Math-Type-Calculator | src/Chippyash/Math/Type/Traits/CheckIntTypes.php | CheckIntTypes.checkIntTypes | protected function checkIntTypes(NumericTypeInterface $a, NumericTypeInterface $b)
{
$a1 = ($a instanceof IntType ? $a : $a->asIntType());
$b1 = ($a instanceof IntType ? $b : $b->asIntType());
return [$a1, $b1];
} | php | protected function checkIntTypes(NumericTypeInterface $a, NumericTypeInterface $b)
{
$a1 = ($a instanceof IntType ? $a : $a->asIntType());
$b1 = ($a instanceof IntType ? $b : $b->asIntType());
return [$a1, $b1];
} | [
"protected",
"function",
"checkIntTypes",
"(",
"NumericTypeInterface",
"$",
"a",
",",
"NumericTypeInterface",
"$",
"b",
")",
"{",
"$",
"a1",
"=",
"(",
"$",
"a",
"instanceof",
"IntType",
"?",
"$",
"a",
":",
"$",
"a",
"->",
"asIntType",
"(",
")",
")",
";... | Check for integer type, converting if necessary
@param NumericTypeInterface $a
@param NumericTypeInterface $b
@return array [IntType, IntType] | [
"Check",
"for",
"integer",
"type",
"converting",
"if",
"necessary"
] | train | https://github.com/chippyash/Math-Type-Calculator/blob/2a2fae0ab4d052772d3dd45745efd5a91f88b9e3/src/Chippyash/Math/Type/Traits/CheckIntTypes.php#L28-L34 |
drunomics/service-utils | src/Core/Config/ConfigFactoryTrait.php | ConfigFactoryTrait.getConfigFactory | public function getConfigFactory() {
if (empty($this->configFactory)) {
$this->configFactory = \Drupal::service('config.factory');
}
return $this->configFactory;
} | php | public function getConfigFactory() {
if (empty($this->configFactory)) {
$this->configFactory = \Drupal::service('config.factory');
}
return $this->configFactory;
} | [
"public",
"function",
"getConfigFactory",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"configFactory",
")",
")",
"{",
"$",
"this",
"->",
"configFactory",
"=",
"\\",
"Drupal",
"::",
"service",
"(",
"'config.factory'",
")",
";",
"}",
"return... | Gets the config factory.
@return \Drupal\Core\Config\ConfigFactoryInterface
The config factory. | [
"Gets",
"the",
"config",
"factory",
"."
] | train | https://github.com/drunomics/service-utils/blob/56761750043132365ef4ae5d9e0cf4263459328f/src/Core/Config/ConfigFactoryTrait.php#L38-L43 |
nkt/flame | src/QueryBuilder/Part/WherePart.php | WherePart.where | public function where($stmt)
{
if ($stmt instanceof Expression) {
$this->where = $stmt;
} elseif ($stmt instanceof \Closure) {
$this->where = new Expression($this->getGrammar());
call_user_func($stmt, $this->where);
} elseif (is_array($stmt)) {
... | php | public function where($stmt)
{
if ($stmt instanceof Expression) {
$this->where = $stmt;
} elseif ($stmt instanceof \Closure) {
$this->where = new Expression($this->getGrammar());
call_user_func($stmt, $this->where);
} elseif (is_array($stmt)) {
... | [
"public",
"function",
"where",
"(",
"$",
"stmt",
")",
"{",
"if",
"(",
"$",
"stmt",
"instanceof",
"Expression",
")",
"{",
"$",
"this",
"->",
"where",
"=",
"$",
"stmt",
";",
"}",
"elseif",
"(",
"$",
"stmt",
"instanceof",
"\\",
"Closure",
")",
"{",
"$... | @param Expression|callable|array $stmt
@return static
@throws \InvalidArgumentException | [
"@param",
"Expression|callable|array",
"$stmt"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/QueryBuilder/Part/WherePart.php#L24-L38 |
nkt/flame | src/Connection.php | Connection.prepare | public function prepare($sql, $driverOptions = [])
{
$this->placeholders = $this->types = [];
$sql = preg_replace_callback(static::PLACEHOLDER_REGEX, function ($matches) {
$name = $matches[2];
if (!isset($this->types[$name])) {
$this->types[$name] = static::$t... | php | public function prepare($sql, $driverOptions = [])
{
$this->placeholders = $this->types = [];
$sql = preg_replace_callback(static::PLACEHOLDER_REGEX, function ($matches) {
$name = $matches[2];
if (!isset($this->types[$name])) {
$this->types[$name] = static::$t... | [
"public",
"function",
"prepare",
"(",
"$",
"sql",
",",
"$",
"driverOptions",
"=",
"[",
"]",
")",
"{",
"$",
"this",
"->",
"placeholders",
"=",
"$",
"this",
"->",
"types",
"=",
"[",
"]",
";",
"$",
"sql",
"=",
"preg_replace_callback",
"(",
"static",
"::... | @param string $sql
@param array $driverOptions
@return Statement | [
"@param",
"string",
"$sql",
"@param",
"array",
"$driverOptions"
] | train | https://github.com/nkt/flame/blob/16f9f172db5a8a618b628429e0986eacb089d217/src/Connection.php#L73-L87 |
shawnsandy/ui-pages | src/GitLoginMiddleware.php | GitLoginMiddleware.handle | public function handle($request, Closure $next)
{
/**
* Grab the pagekit session array[github_name, github_email]
* match to the pagekit.github_username and pagekit.github_email
* redirect to login on fail
*/
$session = session(config('pagekit.session_key'));
... | php | public function handle($request, Closure $next)
{
/**
* Grab the pagekit session array[github_name, github_email]
* match to the pagekit.github_username and pagekit.github_email
* redirect to login on fail
*/
$session = session(config('pagekit.session_key'));
... | [
"public",
"function",
"handle",
"(",
"$",
"request",
",",
"Closure",
"$",
"next",
")",
"{",
"/**\n * Grab the pagekit session array[github_name, github_email]\n * match to the pagekit.github_username and pagekit.github_email\n * redirect to login on fail\n */"... | Handle function
@param array $request request array
@param Closure $next colsure
@return mixed | [
"Handle",
"function"
] | train | https://github.com/shawnsandy/ui-pages/blob/11584c12fa3e2b9a5c513f4ec9e2eaf78c206ca8/src/GitLoginMiddleware.php#L47-L65 |
comelyio/comely | src/Comely/IO/Cache/Cacheable/CacheItem.php | CacheItem.ttl | public function ttl(int $seconds = null): int
{
if (is_int($seconds) && $seconds >= 0) {
$this->ttl = $seconds;
}
return $this->ttl;
} | php | public function ttl(int $seconds = null): int
{
if (is_int($seconds) && $seconds >= 0) {
$this->ttl = $seconds;
}
return $this->ttl;
} | [
"public",
"function",
"ttl",
"(",
"int",
"$",
"seconds",
"=",
"null",
")",
":",
"int",
"{",
"if",
"(",
"is_int",
"(",
"$",
"seconds",
")",
"&&",
"$",
"seconds",
">=",
"0",
")",
"{",
"$",
"this",
"->",
"ttl",
"=",
"$",
"seconds",
";",
"}",
"retu... | Set/get TTL for this value
@param int|null $seconds
@return int | [
"Set",
"/",
"get",
"TTL",
"for",
"this",
"value"
] | train | https://github.com/comelyio/comely/blob/561ea7aef36fea347a1a79d3ee5597d4057ddf82/src/Comely/IO/Cache/Cacheable/CacheItem.php#L70-L77 |
acasademont/wurfl | WURFL/CustomDeviceRepository.php | WURFL_CustomDeviceRepository.init | private function init()
{
$genericDevice = $this->getDevice(WURFL_Constants::GENERIC);
if (!is_null($genericDevice)) {
$this->_capabilitiesName = array_keys($genericDevice->getCapabilities());
$this->_groupIDCapabilitiesMap = $genericDevice->getGroupIdCapabilitiesNameMap();
... | php | private function init()
{
$genericDevice = $this->getDevice(WURFL_Constants::GENERIC);
if (!is_null($genericDevice)) {
$this->_capabilitiesName = array_keys($genericDevice->getCapabilities());
$this->_groupIDCapabilitiesMap = $genericDevice->getGroupIdCapabilitiesNameMap();
... | [
"private",
"function",
"init",
"(",
")",
"{",
"$",
"genericDevice",
"=",
"$",
"this",
"->",
"getDevice",
"(",
"WURFL_Constants",
"::",
"GENERIC",
")",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"genericDevice",
")",
")",
"{",
"$",
"this",
"->",
"_capabi... | Initializes this device repository by loading the base generic device capabilities names and group ID map | [
"Initializes",
"this",
"device",
"repository",
"by",
"loading",
"the",
"base",
"generic",
"device",
"capabilities",
"names",
"and",
"group",
"ID",
"map"
] | train | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/CustomDeviceRepository.php#L70-L77 |
acasademont/wurfl | WURFL/CustomDeviceRepository.php | WURFL_CustomDeviceRepository.getDevice | public function getDevice($deviceId)
{
if (!isset($this->_deviceCache[$deviceId])) {
$device = $this->persistenceStorage->load($deviceId);
if (!$device) {
throw new Exception("There is no device with ID [$deviceId] in the loaded WURFL Data");
}
... | php | public function getDevice($deviceId)
{
if (!isset($this->_deviceCache[$deviceId])) {
$device = $this->persistenceStorage->load($deviceId);
if (!$device) {
throw new Exception("There is no device with ID [$deviceId] in the loaded WURFL Data");
}
... | [
"public",
"function",
"getDevice",
"(",
"$",
"deviceId",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"_deviceCache",
"[",
"$",
"deviceId",
"]",
")",
")",
"{",
"$",
"device",
"=",
"$",
"this",
"->",
"persistenceStorage",
"->",
"load",
"... | Returns a device for the given device ID
@param string $deviceId
@return WURFL_CustomDevice
@throws WURFL_Exception if $deviceID is not defined in wurfl devices repository | [
"Returns",
"a",
"device",
"for",
"the",
"given",
"device",
"ID"
] | train | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/CustomDeviceRepository.php#L105-L115 |
acasademont/wurfl | WURFL/CustomDeviceRepository.php | WURFL_CustomDeviceRepository.getAllDevicesID | public function getAllDevicesID()
{
$devicesId = array();
foreach ($this->deviceClassificationNames as $className) {
$currentMap = $this->persistenceStorage->load($className);
if (!is_array($currentMap)) {
$currentMap = array();
}
$devi... | php | public function getAllDevicesID()
{
$devicesId = array();
foreach ($this->deviceClassificationNames as $className) {
$currentMap = $this->persistenceStorage->load($className);
if (!is_array($currentMap)) {
$currentMap = array();
}
$devi... | [
"public",
"function",
"getAllDevicesID",
"(",
")",
"{",
"$",
"devicesId",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"deviceClassificationNames",
"as",
"$",
"className",
")",
"{",
"$",
"currentMap",
"=",
"$",
"this",
"->",
"persistence... | Returns an array of all the device ids
@return array | [
"Returns",
"an",
"array",
"of",
"all",
"the",
"device",
"ids"
] | train | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/CustomDeviceRepository.php#L136-L147 |
acasademont/wurfl | WURFL/CustomDeviceRepository.php | WURFL_CustomDeviceRepository.getAllCapabilitiesForDevice | public function getAllCapabilitiesForDevice($deviceID)
{
$devices = array_reverse($this->getDeviceHierarchy($deviceID));
$capabilities = array();
foreach ($devices as $device) {
if (is_array($device->capabilities)) {
$capabilities = array_merge($capabilit... | php | public function getAllCapabilitiesForDevice($deviceID)
{
$devices = array_reverse($this->getDeviceHierarchy($deviceID));
$capabilities = array();
foreach ($devices as $device) {
if (is_array($device->capabilities)) {
$capabilities = array_merge($capabilit... | [
"public",
"function",
"getAllCapabilitiesForDevice",
"(",
"$",
"deviceID",
")",
"{",
"$",
"devices",
"=",
"array_reverse",
"(",
"$",
"this",
"->",
"getDeviceHierarchy",
"(",
"$",
"deviceID",
")",
")",
";",
"$",
"capabilities",
"=",
"array",
"(",
")",
";",
... | Returns an associative array of capabilityName => capabilityValue for the given $deviceID
@param string $deviceID
@return array associative array of capabilityName, capabilityValue | [
"Returns",
"an",
"associative",
"array",
"of",
"capabilityName",
"=",
">",
"capabilityValue",
"for",
"the",
"given",
"$deviceID"
] | train | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/CustomDeviceRepository.php#L195-L206 |
acasademont/wurfl | WURFL/CustomDeviceRepository.php | WURFL_CustomDeviceRepository.getCapabilitiesNameForGroup | public function getCapabilitiesNameForGroup($groupID)
{
if (!array_key_exists($groupID, $this->_groupIDCapabilitiesMap)) {
throw new WURFL_WURFLException("The Group ID " . $groupID . " supplied does not exist");
}
return $this->_groupIDCapabilitiesMap [$groupID];
} | php | public function getCapabilitiesNameForGroup($groupID)
{
if (!array_key_exists($groupID, $this->_groupIDCapabilitiesMap)) {
throw new WURFL_WURFLException("The Group ID " . $groupID . " supplied does not exist");
}
return $this->_groupIDCapabilitiesMap [$groupID];
} | [
"public",
"function",
"getCapabilitiesNameForGroup",
"(",
"$",
"groupID",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"groupID",
",",
"$",
"this",
"->",
"_groupIDCapabilitiesMap",
")",
")",
"{",
"throw",
"new",
"WURFL_WURFLException",
"(",
"\"The Gro... | Returns an array of all capability names defined in
the given group ID
@param string $groupID
@throws WURFL_WURFLException The given $groupID does not exist
@return array of capability names | [
"Returns",
"an",
"array",
"of",
"all",
"capability",
"names",
"defined",
"in",
"the",
"given",
"group",
"ID"
] | train | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/CustomDeviceRepository.php#L244-L250 |
acasademont/wurfl | WURFL/CustomDeviceRepository.php | WURFL_CustomDeviceRepository.getGroupIDForCapability | public function getGroupIDForCapability($capability)
{
if (!isset($capability) || !array_key_exists($capability, $this->_groupIDCapabilitiesMap)) {
throw new InvalidArgumentException("an invalid capability was specified.");
}
return $this->_groupIDCapabilitiesMap[$capability];
... | php | public function getGroupIDForCapability($capability)
{
if (!isset($capability) || !array_key_exists($capability, $this->_groupIDCapabilitiesMap)) {
throw new InvalidArgumentException("an invalid capability was specified.");
}
return $this->_groupIDCapabilitiesMap[$capability];
... | [
"public",
"function",
"getGroupIDForCapability",
"(",
"$",
"capability",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"capability",
")",
"||",
"!",
"array_key_exists",
"(",
"$",
"capability",
",",
"$",
"this",
"->",
"_groupIDCapabilitiesMap",
")",
")",
"{",
... | Returns the group id that contains the given $capability
@param string $capability
@throws InvalidArgumentException an invalid $capability was specified
@return string | [
"Returns",
"the",
"group",
"id",
"that",
"contains",
"the",
"given",
"$capability"
] | train | https://github.com/acasademont/wurfl/blob/0f4fb6e06b452ba95ad1d15e7d8226d0974b60c2/WURFL/CustomDeviceRepository.php#L259-L265 |
ubirak/symfony-json-rest-api | src/LinkRequestListener.php | LinkRequestListener.parseWeblink | private function parseWeblink($linkHeader)
{
$links = [];
while (preg_match('/^((?:[^"]|"[^"]*")*?),/', $linkHeader, $matches)) {
$linkHeader = trim(substr($linkHeader, strlen($matches[0])));
$links[] = Weblink::fromHeaderString($matches[1]);
}
if ($linkHea... | php | private function parseWeblink($linkHeader)
{
$links = [];
while (preg_match('/^((?:[^"]|"[^"]*")*?),/', $linkHeader, $matches)) {
$linkHeader = trim(substr($linkHeader, strlen($matches[0])));
$links[] = Weblink::fromHeaderString($matches[1]);
}
if ($linkHea... | [
"private",
"function",
"parseWeblink",
"(",
"$",
"linkHeader",
")",
"{",
"$",
"links",
"=",
"[",
"]",
";",
"while",
"(",
"preg_match",
"(",
"'/^((?:[^\"]|\"[^\"]*\")*?),/'",
",",
"$",
"linkHeader",
",",
"$",
"matches",
")",
")",
"{",
"$",
"linkHeader",
"="... | /*
Due to limitations, multiple same-name headers are sent as comma
separated values.
This breaks those headers into Link headers following the format
http://tools.ietf.org/html/rfc2068#section-19.6.2.4 | [
"/",
"*",
"Due",
"to",
"limitations",
"multiple",
"same",
"-",
"name",
"headers",
"are",
"sent",
"as",
"comma",
"separated",
"values",
"."
] | train | https://github.com/ubirak/symfony-json-rest-api/blob/f34b58feebf7908897bc47403bd8859d4e26a069/src/LinkRequestListener.php#L38-L52 |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.