repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 | partition stringclasses 1
value |
|---|---|---|---|---|---|---|---|---|---|---|---|
attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Source.php | Source.initPages | public function initPages($overrideExisting = true)
{
if (null !== $this->collPages && !$overrideExisting) {
return;
}
$collectionClassName = PageTableMap::getTableMap()->getCollectionClassName();
$this->collPages = new $collectionClassName;
$this->collPages->se... | php | public function initPages($overrideExisting = true)
{
if (null !== $this->collPages && !$overrideExisting) {
return;
}
$collectionClassName = PageTableMap::getTableMap()->getCollectionClassName();
$this->collPages = new $collectionClassName;
$this->collPages->se... | [
"public",
"function",
"initPages",
"(",
"$",
"overrideExisting",
"=",
"true",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"this",
"->",
"collPages",
"&&",
"!",
"$",
"overrideExisting",
")",
"{",
"return",
";",
"}",
"$",
"collectionClassName",
"=",
"PageTableM... | Initializes the collPages collection.
By default this just sets the collPages collection to an empty array (like clearcollPages());
however, you may wish to override this method in your stub class to provide setting appropriate
to your application -- for example, setting the initial array to the values stored in datab... | [
"Initializes",
"the",
"collPages",
"collection",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1952-L1962 | train |
attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Source.php | Source.getPages | public function getPages(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collPagesPartial && !$this->isNew();
if (null === $this->collPages || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collPages) {
// return e... | php | public function getPages(Criteria $criteria = null, ConnectionInterface $con = null)
{
$partial = $this->collPagesPartial && !$this->isNew();
if (null === $this->collPages || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collPages) {
// return e... | [
"public",
"function",
"getPages",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collPagesPartial",
"&&",
"!",
"$",
"this",
"->",
"isNew",
"(",
")",
... | Gets an array of ChildPage 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 $criteria, the... | [
"Gets",
"an",
"array",
"of",
"ChildPage",
"objects",
"which",
"contain",
"a",
"foreign",
"key",
"that",
"references",
"this",
"object",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L1978-L2020 | train |
attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Source.php | Source.countPages | public function countPages(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collPagesPartial && !$this->isNew();
if (null === $this->collPages || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collPages) {
... | php | public function countPages(Criteria $criteria = null, $distinct = false, ConnectionInterface $con = null)
{
$partial = $this->collPagesPartial && !$this->isNew();
if (null === $this->collPages || null !== $criteria || $partial) {
if ($this->isNew() && null === $this->collPages) {
... | [
"public",
"function",
"countPages",
"(",
"Criteria",
"$",
"criteria",
"=",
"null",
",",
"$",
"distinct",
"=",
"false",
",",
"ConnectionInterface",
"$",
"con",
"=",
"null",
")",
"{",
"$",
"partial",
"=",
"$",
"this",
"->",
"collPagesPartial",
"&&",
"!",
"... | Returns the number of related Page objects.
@param Criteria $criteria
@param boolean $distinct
@param ConnectionInterface $con
@return int Count of related Page objects.
@throws PropelException | [
"Returns",
"the",
"number",
"of",
"related",
"Page",
"objects",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L2064-L2087 | train |
attogram/shared-media-orm | src/Attogram/SharedMedia/Orm/Base/Source.php | Source.addPage | public function addPage(ChildPage $l)
{
if ($this->collPages === null) {
$this->initPages();
$this->collPagesPartial = true;
}
if (!$this->collPages->contains($l)) {
$this->doAddPage($l);
if ($this->pagesScheduledForDeletion and $this->pagesS... | php | public function addPage(ChildPage $l)
{
if ($this->collPages === null) {
$this->initPages();
$this->collPagesPartial = true;
}
if (!$this->collPages->contains($l)) {
$this->doAddPage($l);
if ($this->pagesScheduledForDeletion and $this->pagesS... | [
"public",
"function",
"addPage",
"(",
"ChildPage",
"$",
"l",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"collPages",
"===",
"null",
")",
"{",
"$",
"this",
"->",
"initPages",
"(",
")",
";",
"$",
"this",
"->",
"collPagesPartial",
"=",
"true",
";",
"}",
... | Method called to associate a ChildPage object to this object
through the ChildPage foreign key attribute.
@param ChildPage $l ChildPage
@return $this|\Attogram\SharedMedia\Orm\Source The current object (for fluent API support) | [
"Method",
"called",
"to",
"associate",
"a",
"ChildPage",
"object",
"to",
"this",
"object",
"through",
"the",
"ChildPage",
"foreign",
"key",
"attribute",
"."
] | 81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8 | https://github.com/attogram/shared-media-orm/blob/81b5ef7d749b1e50f51e95747ce24cf8ce6f21d8/src/Attogram/SharedMedia/Orm/Base/Source.php#L2096-L2112 | train |
translationexchange/tml-php-clientsdk | library/Tr8n/Application.php | Application.submitMissingKeys | public function submitMissingKeys() {
if ($this->missing_keys_by_sources == null)
return;
$params = array();
$source_keys = array();
foreach($this->missing_keys_by_sources as $source => $keys) {
array_push($source_keys, $source);
$keys_data = array()... | php | public function submitMissingKeys() {
if ($this->missing_keys_by_sources == null)
return;
$params = array();
$source_keys = array();
foreach($this->missing_keys_by_sources as $source => $keys) {
array_push($source_keys, $source);
$keys_data = array()... | [
"public",
"function",
"submitMissingKeys",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"missing_keys_by_sources",
"==",
"null",
")",
"return",
";",
"$",
"params",
"=",
"array",
"(",
")",
";",
"$",
"source_keys",
"=",
"array",
"(",
")",
";",
"foreach",
... | Submits missing keys to the service | [
"Submits",
"missing",
"keys",
"to",
"the",
"service"
] | fe51473824e62cfd883c6aa0c6a3783a16ce8425 | https://github.com/translationexchange/tml-php-clientsdk/blob/fe51473824e62cfd883c6aa0c6a3783a16ce8425/library/Tr8n/Application.php#L393-L427 | train |
phpffcms/ffcms-core | src/Migrations/Migration.php | Migration.up | public function up()
{
$record = new MigrationRecord();
if ($this->connection !== null) {
$record->setConnection($this->connection);
}
$record->migration = $this->name;
$record->save();
} | php | public function up()
{
$record = new MigrationRecord();
if ($this->connection !== null) {
$record->setConnection($this->connection);
}
$record->migration = $this->name;
$record->save();
} | [
"public",
"function",
"up",
"(",
")",
"{",
"$",
"record",
"=",
"new",
"MigrationRecord",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"connection",
"!==",
"null",
")",
"{",
"$",
"record",
"->",
"setConnection",
"(",
"$",
"this",
"->",
"connection",
"... | Insert data into migration table | [
"Insert",
"data",
"into",
"migration",
"table"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Migrations/Migration.php#L35-L43 | train |
phpffcms/ffcms-core | src/Migrations/Migration.php | Migration.down | public function down()
{
$record = new MigrationRecord();
if ($this->connection !== null) {
$record->setConnection($this->connection);
}
$record->where('migration', $this->name)->delete();
} | php | public function down()
{
$record = new MigrationRecord();
if ($this->connection !== null) {
$record->setConnection($this->connection);
}
$record->where('migration', $this->name)->delete();
} | [
"public",
"function",
"down",
"(",
")",
"{",
"$",
"record",
"=",
"new",
"MigrationRecord",
"(",
")",
";",
"if",
"(",
"$",
"this",
"->",
"connection",
"!==",
"null",
")",
"{",
"$",
"record",
"->",
"setConnection",
"(",
"$",
"this",
"->",
"connection",
... | Remove data from migration table | [
"Remove",
"data",
"from",
"migration",
"table"
] | 44a309553ef9f115ccfcfd71f2ac6e381c612082 | https://github.com/phpffcms/ffcms-core/blob/44a309553ef9f115ccfcfd71f2ac6e381c612082/src/Migrations/Migration.php#L48-L55 | train |
Gravitas-GM/PluginBase | src/Gravitas/PluginBase/PluginBase.php | PluginBase.run | public function run() {
$this->execute();
if ($handler = $this->getFormHandler(@$_REQUEST['_form_name']))
call_user_func($handler, $_REQUEST);
} | php | public function run() {
$this->execute();
if ($handler = $this->getFormHandler(@$_REQUEST['_form_name']))
call_user_func($handler, $_REQUEST);
} | [
"public",
"function",
"run",
"(",
")",
"{",
"$",
"this",
"->",
"execute",
"(",
")",
";",
"if",
"(",
"$",
"handler",
"=",
"$",
"this",
"->",
"getFormHandler",
"(",
"@",
"$",
"_REQUEST",
"[",
"'_form_name'",
"]",
")",
")",
"call_user_func",
"(",
"$",
... | The entry point for a plugin. This should be called immediately in your bootstrap file. | [
"The",
"entry",
"point",
"for",
"a",
"plugin",
".",
"This",
"should",
"be",
"called",
"immediately",
"in",
"your",
"bootstrap",
"file",
"."
] | a7ca0cf6b286a547a5c7de919cd4423520ed9f06 | https://github.com/Gravitas-GM/PluginBase/blob/a7ca0cf6b286a547a5c7de919cd4423520ed9f06/src/Gravitas/PluginBase/PluginBase.php#L41-L46 | train |
Gravitas-GM/PluginBase | src/Gravitas/PluginBase/PluginBase.php | PluginBase.addResources | public function addResources() {
if ($this->resourceChain === null)
$this->resourceChain = new ResourceChain($this);
return $this->resourceChain;
} | php | public function addResources() {
if ($this->resourceChain === null)
$this->resourceChain = new ResourceChain($this);
return $this->resourceChain;
} | [
"public",
"function",
"addResources",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"resourceChain",
"===",
"null",
")",
"$",
"this",
"->",
"resourceChain",
"=",
"new",
"ResourceChain",
"(",
"$",
"this",
")",
";",
"return",
"$",
"this",
"->",
"resourceCha... | Returns a ResourceChain object that can be used to add stylesheets and scripts.
Functionally, this is the same as calling `add*Script` and `add*Stylesheet` methods, except that it
automatically registers all previously registered resources (added via the ResourceChain) as dependencies.
@return ResourceChain | [
"Returns",
"a",
"ResourceChain",
"object",
"that",
"can",
"be",
"used",
"to",
"add",
"stylesheets",
"and",
"scripts",
"."
] | a7ca0cf6b286a547a5c7de919cd4423520ed9f06 | https://github.com/Gravitas-GM/PluginBase/blob/a7ca0cf6b286a547a5c7de919cd4423520ed9f06/src/Gravitas/PluginBase/PluginBase.php#L165-L170 | train |
johnkrovitch/Sam | Filter/Copy/CopyFilter.php | CopyFilter.run | public function run(array $sources, array $destinations)
{
$fileSystem = new Filesystem();
// must have the same sources and destinations number
if (count($sources) !== count($destinations) && count($destinations) !== 1) {
throw new Exception('Sources and destinations co... | php | public function run(array $sources, array $destinations)
{
$fileSystem = new Filesystem();
// must have the same sources and destinations number
if (count($sources) !== count($destinations) && count($destinations) !== 1) {
throw new Exception('Sources and destinations co... | [
"public",
"function",
"run",
"(",
"array",
"$",
"sources",
",",
"array",
"$",
"destinations",
")",
"{",
"$",
"fileSystem",
"=",
"new",
"Filesystem",
"(",
")",
";",
"// must have the same sources and destinations number",
"if",
"(",
"count",
"(",
"$",
"sources",
... | Copy the sources files to the destinations.
@param SplFileInfo[] $sources
@param string[] $destinations
@return SplFileInfo[]
@throws Exception | [
"Copy",
"the",
"sources",
"files",
"to",
"the",
"destinations",
"."
] | fbd3770c11eecc0a6d8070f439f149062316f606 | https://github.com/johnkrovitch/Sam/blob/fbd3770c11eecc0a6d8070f439f149062316f606/Filter/Copy/CopyFilter.php#L22-L62 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.install | public function install($module, $version, $options = null)
{
$module = strtolower($module);
$options = is_null($options) ? array() : $options;
$modules = $this->findModules();
$current = array();
foreach($modules as $name){
$modVersion = $this->getM... | php | public function install($module, $version, $options = null)
{
$module = strtolower($module);
$options = is_null($options) ? array() : $options;
$modules = $this->findModules();
$current = array();
foreach($modules as $name){
$modVersion = $this->getM... | [
"public",
"function",
"install",
"(",
"$",
"module",
",",
"$",
"version",
",",
"$",
"options",
"=",
"null",
")",
"{",
"$",
"module",
"=",
"strtolower",
"(",
"$",
"module",
")",
";",
"$",
"options",
"=",
"is_null",
"(",
"$",
"options",
")",
"?",
"ar... | Install module dependencies
@return void | [
"Install",
"module",
"dependencies"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L60-L116 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.resolveDependencies | public function resolveDependencies($module){
$version = $this->getModuleVersion($module);
if(null === $version){
throw new \Exception(sprintf(
"Unable to resolve dependencies for module '%s'. Module definitions are missing or incomplete.",
... | php | public function resolveDependencies($module){
$version = $this->getModuleVersion($module);
if(null === $version){
throw new \Exception(sprintf(
"Unable to resolve dependencies for module '%s'. Module definitions are missing or incomplete.",
... | [
"public",
"function",
"resolveDependencies",
"(",
"$",
"module",
")",
"{",
"$",
"version",
"=",
"$",
"this",
"->",
"getModuleVersion",
"(",
"$",
"module",
")",
";",
"if",
"(",
"null",
"===",
"$",
"version",
")",
"{",
"throw",
"new",
"\\",
"Exception",
... | Resolve module dependencies, recursively
This method returns an array with dependent module names
as keys and versions as values. There may also be a
dependency back to module itself with greater version
number.
Example of dependency tree:
- A 1.0
- C 1.0
- A 1.1
- D 2.0
- E 1.0
- B 1.0
- B 1.1
Resolved dependencies... | [
"Resolve",
"module",
"dependencies",
"recursively"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L216-L237 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.resolveDepsRecursive | protected function resolveDepsRecursive($module, $version, \ArrayObject $resolved){
$module = strtolower($module);
// replace if exists with lower version number
if($resolved->offsetExists($module)){
$new = new SoftwareVersion($version);
// remembe... | php | protected function resolveDepsRecursive($module, $version, \ArrayObject $resolved){
$module = strtolower($module);
// replace if exists with lower version number
if($resolved->offsetExists($module)){
$new = new SoftwareVersion($version);
// remembe... | [
"protected",
"function",
"resolveDepsRecursive",
"(",
"$",
"module",
",",
"$",
"version",
",",
"\\",
"ArrayObject",
"$",
"resolved",
")",
"{",
"$",
"module",
"=",
"strtolower",
"(",
"$",
"module",
")",
";",
"// replace if exists with lower version number",
"if",
... | Resolve dependencies recursively. The level and order in module dependency
hierarchy defines the module's priority.
@param string $module
@param string $version
@param \ArrayObject $resolved | [
"Resolve",
"dependencies",
"recursively",
".",
"The",
"level",
"and",
"order",
"in",
"module",
"dependency",
"hierarchy",
"defines",
"the",
"module",
"s",
"priority",
"."
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L247-L284 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.findModules | public function findModules()
{
$dirs = $this->getOption('module_dirs');
$modules = array();
foreach($dirs as $dir){
$iterator = new DirectoryIterator($dir);
foreach ($iterator as $file) {
if (($file->isDir() && substr($file->getBasename()... | php | public function findModules()
{
$dirs = $this->getOption('module_dirs');
$modules = array();
foreach($dirs as $dir){
$iterator = new DirectoryIterator($dir);
foreach ($iterator as $file) {
if (($file->isDir() && substr($file->getBasename()... | [
"public",
"function",
"findModules",
"(",
")",
"{",
"$",
"dirs",
"=",
"$",
"this",
"->",
"getOption",
"(",
"'module_dirs'",
")",
";",
"$",
"modules",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"dirs",
"as",
"$",
"dir",
")",
"{",
"$",
"iterat... | Find all modules installed in module directories
@return array | [
"Find",
"all",
"modules",
"installed",
"in",
"module",
"directories"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L304-L322 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.whichModule | public function whichModule($object){
$reflection = new \ReflectionClass($object);
$ns = explode('\\', $reflection->getNamespaceName());
if (class_exists($ns[0] . '\Module')) {
$reflection = new \ReflectionClass($ns[0] . '\Module');
return strtolower(basename(dir... | php | public function whichModule($object){
$reflection = new \ReflectionClass($object);
$ns = explode('\\', $reflection->getNamespaceName());
if (class_exists($ns[0] . '\Module')) {
$reflection = new \ReflectionClass($ns[0] . '\Module');
return strtolower(basename(dir... | [
"public",
"function",
"whichModule",
"(",
"$",
"object",
")",
"{",
"$",
"reflection",
"=",
"new",
"\\",
"ReflectionClass",
"(",
"$",
"object",
")",
";",
"$",
"ns",
"=",
"explode",
"(",
"'\\\\'",
",",
"$",
"reflection",
"->",
"getNamespaceName",
"(",
")",... | Detect the name of the module based on class
@param object $object Setup instance
@return string|null Module name | [
"Detect",
"the",
"name",
"of",
"the",
"module",
"based",
"on",
"class"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L353-L378 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.getModuleVersion | public function getModuleVersion($module)
{
$config = $this->getModuleDefinition($module);
if (isset($config['version'])) {
return $config['version'];
} else {
return SoftwareVersion::DEFAULT_UNRESOLVED_VERSION;
}
} | php | public function getModuleVersion($module)
{
$config = $this->getModuleDefinition($module);
if (isset($config['version'])) {
return $config['version'];
} else {
return SoftwareVersion::DEFAULT_UNRESOLVED_VERSION;
}
} | [
"public",
"function",
"getModuleVersion",
"(",
"$",
"module",
")",
"{",
"$",
"config",
"=",
"$",
"this",
"->",
"getModuleDefinition",
"(",
"$",
"module",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"config",
"[",
"'version'",
"]",
")",
")",
"{",
"return",
... | Get current version for module
@param string pathule
@return string|null | [
"Get",
"current",
"version",
"for",
"module"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L386-L395 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.getModuleDefinition | public function getModuleDefinition($module)
{
$module = strtolower($module);
if (!array_key_exists($module, $this->definitions)) {
$path = $this->locateModule($module);
$config = array();
if($path){
$definition = $path . DIRECTO... | php | public function getModuleDefinition($module)
{
$module = strtolower($module);
if (!array_key_exists($module, $this->definitions)) {
$path = $this->locateModule($module);
$config = array();
if($path){
$definition = $path . DIRECTO... | [
"public",
"function",
"getModuleDefinition",
"(",
"$",
"module",
")",
"{",
"$",
"module",
"=",
"strtolower",
"(",
"$",
"module",
")",
";",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"module",
",",
"$",
"this",
"->",
"definitions",
")",
")",
"{",
"$"... | Get module definition as an array
@param string $module
@return array | [
"Get",
"module",
"definition",
"as",
"an",
"array"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L403-L430 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.getModuleDeps | public function getModuleDeps($module)
{
$module = strtolower($module);
if (!isset($this->deps[$module])) {
$map = array();
$deps = array();
$modules = $this->findModules();
foreach ($modules as $name) {
$config ... | php | public function getModuleDeps($module)
{
$module = strtolower($module);
if (!isset($this->deps[$module])) {
$map = array();
$deps = array();
$modules = $this->findModules();
foreach ($modules as $name) {
$config ... | [
"public",
"function",
"getModuleDeps",
"(",
"$",
"module",
")",
"{",
"$",
"module",
"=",
"strtolower",
"(",
"$",
"module",
")",
";",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"deps",
"[",
"$",
"module",
"]",
")",
")",
"{",
"$",
"map",
"=",... | Retrieve list of module dependencies
@param string $module
@return array | [
"Retrieve",
"list",
"of",
"module",
"dependencies"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L438-L470 | train |
valu-digital/valusetup | src/ValuSetup/Setup/SetupUtils.php | SetupUtils.setConfig | public function setConfig($config)
{
if(is_string($config) && file_exists($config)){
$options = \Zend\Config\Factory::fromFile($config);
$this->setOptions($options);
}
elseif(!is_array($config) && !($config instanceof \Traversable)){
throw new \Inval... | php | public function setConfig($config)
{
if(is_string($config) && file_exists($config)){
$options = \Zend\Config\Factory::fromFile($config);
$this->setOptions($options);
}
elseif(!is_array($config) && !($config instanceof \Traversable)){
throw new \Inval... | [
"public",
"function",
"setConfig",
"(",
"$",
"config",
")",
"{",
"if",
"(",
"is_string",
"(",
"$",
"config",
")",
"&&",
"file_exists",
"(",
"$",
"config",
")",
")",
"{",
"$",
"options",
"=",
"\\",
"Zend",
"\\",
"Config",
"\\",
"Factory",
"::",
"fromF... | Set service options
@param array|Traversable|string $config
@return Service | [
"Set",
"service",
"options"
] | db1a0bfe1262d555eb11cd0d99625b9ee43d6744 | https://github.com/valu-digital/valusetup/blob/db1a0bfe1262d555eb11cd0d99625b9ee43d6744/src/ValuSetup/Setup/SetupUtils.php#L520-L532 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.getInstance | public static function getInstance(Config $config = null) {
if(is_null(self::$instance)) {
if(is_null($config)) {
throw new ApplicationException('No configuration object provided. Cannot instantiate application.');
}
self::$instance = new Application($config);
}
return self::$instance;
} | php | public static function getInstance(Config $config = null) {
if(is_null(self::$instance)) {
if(is_null($config)) {
throw new ApplicationException('No configuration object provided. Cannot instantiate application.');
}
self::$instance = new Application($config);
}
return self::$instance;
} | [
"public",
"static",
"function",
"getInstance",
"(",
"Config",
"$",
"config",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"self",
"::",
"$",
"instance",
")",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"config",
")",
")",
"{",
"throw",
"new",
"A... | Get Application instance.
@param Config $config
@return Application
@throws ApplicationException | [
"Get",
"Application",
"instance",
"."
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L232-L243 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.registerPlugins | public function registerPlugins() {
if($this->plugins) {
foreach($this->plugins as $plugin) {
$this->eventDispatcher->removeSubscriber($plugin);
}
}
$this->plugins = array();
// initialize plugins (if configured)
if($this->config->plugins) {
foreach(array_keys($this->config->plugins) a... | php | public function registerPlugins() {
if($this->plugins) {
foreach($this->plugins as $plugin) {
$this->eventDispatcher->removeSubscriber($plugin);
}
}
$this->plugins = array();
// initialize plugins (if configured)
if($this->config->plugins) {
foreach(array_keys($this->config->plugins) a... | [
"public",
"function",
"registerPlugins",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"plugins",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"plugins",
"as",
"$",
"plugin",
")",
"{",
"$",
"this",
"->",
"eventDispatcher",
"->",
"removeSubscriber",
"(",
... | Unregister all previously registered plugins.
read plugin configuration from Config
and register all configured plugins
@return Application
@throws ApplicationException | [
"Unregister",
"all",
"previously",
"registered",
"plugins",
"."
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L266-L288 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.getDb | public function getDb() {
if(empty($this->db)) {
if(empty($this->config->db)) {
try {
return $this->getVxPDO();
}
catch(ApplicationException $e) {
return null;
}
}
$config = $this->config->db;
$this->db = DatabaseInterfaceFactory::create(
isset($config->typ... | php | public function getDb() {
if(empty($this->db)) {
if(empty($this->config->db)) {
try {
return $this->getVxPDO();
}
catch(ApplicationException $e) {
return null;
}
}
$config = $this->config->db;
$this->db = DatabaseInterfaceFactory::create(
isset($config->typ... | [
"public",
"function",
"getDb",
"(",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"db",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"config",
"->",
"db",
")",
")",
"{",
"try",
"{",
"return",
"$",
"this",
"->",
"getVxPDO",... | get default vxPDO instance
this method exists for backwards compatibility
if no 'db' configuration is found, it tries to return a
configured default vxpdo datasource
@return \vxPHP\Database\DatabaseInterface
@throws \Exception | [
"get",
"default",
"vxPDO",
"instance"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L300-L331 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.getVxPDO | public function getVxPDO($name = 'default') {
if(!array_key_exists($name, $this->vxPDOInstances)) {
if(empty($this->config->vxpdo) || !array_key_exists($name, $this->config->vxpdo)) {
throw new ApplicationException(sprintf("vxPDO configuration for '%s' not found.", $name));
}
$dsConfig = $this->c... | php | public function getVxPDO($name = 'default') {
if(!array_key_exists($name, $this->vxPDOInstances)) {
if(empty($this->config->vxpdo) || !array_key_exists($name, $this->config->vxpdo)) {
throw new ApplicationException(sprintf("vxPDO configuration for '%s' not found.", $name));
}
$dsConfig = $this->c... | [
"public",
"function",
"getVxPDO",
"(",
"$",
"name",
"=",
"'default'",
")",
"{",
"if",
"(",
"!",
"array_key_exists",
"(",
"$",
"name",
",",
"$",
"this",
"->",
"vxPDOInstances",
")",
")",
"{",
"if",
"(",
"empty",
"(",
"$",
"this",
"->",
"config",
"->",... | get a configured vxPDO instance identified by its datasource
name
@param string $name
@throws ApplicationException
@return \vxPHP\Database\DatabaseInterface | [
"get",
"a",
"configured",
"vxPDO",
"instance",
"identified",
"by",
"its",
"datasource",
"name"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L342-L368 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.getService | public function getService($serviceId) {
$args = func_get_args();
$service = $this->initializeService($serviceId, array_splice($args, 1));
$this->services[] = $service;
return $service;
} | php | public function getService($serviceId) {
$args = func_get_args();
$service = $this->initializeService($serviceId, array_splice($args, 1));
$this->services[] = $service;
return $service;
} | [
"public",
"function",
"getService",
"(",
"$",
"serviceId",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"$",
"service",
"=",
"$",
"this",
"->",
"initializeService",
"(",
"$",
"serviceId",
",",
"array_splice",
"(",
"$",
"args",
",",
"1",
... | return a service instance
service instances are lazily initialized upon first request
any extra argument is passed on to the constructor method of the service
@param string $serviceId
@return ServiceInterface :ServiceInterface
@throws ApplicationException | [
"return",
"a",
"service",
"instance",
"service",
"instances",
"are",
"lazily",
"initialized",
"upon",
"first",
"request"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L391-L399 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.hasService | public function hasService($serviceId) {
return !empty($this->config->services) && array_key_exists($serviceId, $this->config->services);
} | php | public function hasService($serviceId) {
return !empty($this->config->services) && array_key_exists($serviceId, $this->config->services);
} | [
"public",
"function",
"hasService",
"(",
"$",
"serviceId",
")",
"{",
"return",
"!",
"empty",
"(",
"$",
"this",
"->",
"config",
"->",
"services",
")",
"&&",
"array_key_exists",
"(",
"$",
"serviceId",
",",
"$",
"this",
"->",
"config",
"->",
"services",
")"... | checks whether a service identified by service id is configured
no further checks whether service can be invoked are conducted
@param $serviceId
@return bool | [
"checks",
"whether",
"a",
"service",
"identified",
"by",
"service",
"id",
"is",
"configured",
"no",
"further",
"checks",
"whether",
"service",
"can",
"be",
"invoked",
"are",
"conducted"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L408-L412 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.runsLocally | public function runsLocally() {
if(is_null($this->isLocal)) {
$remote =
isset($_SERVER['HTTP_CLIENT_IP']) ||
isset($_SERVER['HTTP_X_FORWARDED_FOR']) ||
!(
in_array(
@$_SERVER['REMOTE_ADDR'],
[
'127.0.0.1',
'fe80::1',
'::1'
]
) ||
PHP_S... | php | public function runsLocally() {
if(is_null($this->isLocal)) {
$remote =
isset($_SERVER['HTTP_CLIENT_IP']) ||
isset($_SERVER['HTTP_X_FORWARDED_FOR']) ||
!(
in_array(
@$_SERVER['REMOTE_ADDR'],
[
'127.0.0.1',
'fe80::1',
'::1'
]
) ||
PHP_S... | [
"public",
"function",
"runsLocally",
"(",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"isLocal",
")",
")",
"{",
"$",
"remote",
"=",
"isset",
"(",
"$",
"_SERVER",
"[",
"'HTTP_CLIENT_IP'",
"]",
")",
"||",
"isset",
"(",
"$",
"_SERVER",
"[",
... | returns true when the application
was called from the command line or in a localhost environment
@return boolean | [
"returns",
"true",
"when",
"the",
"application",
"was",
"called",
"from",
"the",
"command",
"line",
"or",
"in",
"a",
"localhost",
"environment"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L442-L469 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.getSourcePath | public function getSourcePath() {
// lazy init
if(is_null($this->sourcePath)) {
$this->sourcePath =
$this->rootPath .
'src' . DIRECTORY_SEPARATOR;
}
return $this->sourcePath;
} | php | public function getSourcePath() {
// lazy init
if(is_null($this->sourcePath)) {
$this->sourcePath =
$this->rootPath .
'src' . DIRECTORY_SEPARATOR;
}
return $this->sourcePath;
} | [
"public",
"function",
"getSourcePath",
"(",
")",
"{",
"// lazy init",
"if",
"(",
"is_null",
"(",
"$",
"this",
"->",
"sourcePath",
")",
")",
"{",
"$",
"this",
"->",
"sourcePath",
"=",
"$",
"this",
"->",
"rootPath",
".",
"'src'",
".",
"DIRECTORY_SEPARATOR",
... | get absolute path to application source
@return string | [
"get",
"absolute",
"path",
"to",
"application",
"source"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L476-L490 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.setAbsoluteAssetsPath | public function setAbsoluteAssetsPath($path) {
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
if(!is_null($this->rootPath) && 0 !== strpos($path, $this->rootPath)) {
throw new ApplicationException(sprintf("'%s' not within application path '%s'.", $path, $this->rootPath), ApplicationException:... | php | public function setAbsoluteAssetsPath($path) {
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
if(!is_null($this->rootPath) && 0 !== strpos($path, $this->rootPath)) {
throw new ApplicationException(sprintf("'%s' not within application path '%s'.", $path, $this->rootPath), ApplicationException:... | [
"public",
"function",
"setAbsoluteAssetsPath",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"DIRECTORY_SEPARATOR",
")",
".",
"DIRECTORY_SEPARATOR",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"rootPath",
")",
... | set absolute assets path
the relative assets path is updated
@param string $path
@return Application
@throws ApplicationException | [
"set",
"absolute",
"assets",
"path",
"the",
"relative",
"assets",
"path",
"is",
"updated"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L500-L512 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.setRootPath | public function setRootPath($path) {
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
if(!is_null($this->absoluteAssetsPath) && 0 !== strpos($this->absoluteAssetsPath, $path)) {
throw new ApplicationException("'$path' not a parent of assets path '{$this->absoluteAssetsPath}'", ApplicationExcept... | php | public function setRootPath($path) {
$path = rtrim($path, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR;
if(!is_null($this->absoluteAssetsPath) && 0 !== strpos($this->absoluteAssetsPath, $path)) {
throw new ApplicationException("'$path' not a parent of assets path '{$this->absoluteAssetsPath}'", ApplicationExcept... | [
"public",
"function",
"setRootPath",
"(",
"$",
"path",
")",
"{",
"$",
"path",
"=",
"rtrim",
"(",
"$",
"path",
",",
"DIRECTORY_SEPARATOR",
")",
".",
"DIRECTORY_SEPARATOR",
";",
"if",
"(",
"!",
"is_null",
"(",
"$",
"this",
"->",
"absoluteAssetsPath",
")",
... | set root path of application
if an assetspath is set, the relative assets path is updated
@param string $path
@return Application
@throws ApplicationException | [
"set",
"root",
"path",
"of",
"application",
"if",
"an",
"assetspath",
"is",
"set",
"the",
"relative",
"assets",
"path",
"is",
"updated"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L578-L591 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.getAvailableLocales | public function getAvailableLocales() {
foreach($this->locales as $id => $l) {
if(!$l) {
$this->locales[$id] = new Locale($id);
}
}
return $this->locales;
} | php | public function getAvailableLocales() {
foreach($this->locales as $id => $l) {
if(!$l) {
$this->locales[$id] = new Locale($id);
}
}
return $this->locales;
} | [
"public",
"function",
"getAvailableLocales",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"locales",
"as",
"$",
"id",
"=>",
"$",
"l",
")",
"{",
"if",
"(",
"!",
"$",
"l",
")",
"{",
"$",
"this",
"->",
"locales",
"[",
"$",
"id",
"]",
"=",
"ne... | returns an array with available Locale instances
because of lazy instantiation, missing instances are created now
@return array | [
"returns",
"an",
"array",
"with",
"available",
"Locale",
"instances",
"because",
"of",
"lazy",
"instantiation",
"missing",
"instances",
"are",
"created",
"now"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L689-L698 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.initializeService | private function initializeService($serviceId, array $constructorArguments) {
if(!isset($this->config->services[$serviceId])) {
throw new ApplicationException(sprintf("Service '%s' not configured.", $serviceId));
}
$configData = $this->config->services[$serviceId];
// get class name
$class = $configD... | php | private function initializeService($serviceId, array $constructorArguments) {
if(!isset($this->config->services[$serviceId])) {
throw new ApplicationException(sprintf("Service '%s' not configured.", $serviceId));
}
$configData = $this->config->services[$serviceId];
// get class name
$class = $configD... | [
"private",
"function",
"initializeService",
"(",
"$",
"serviceId",
",",
"array",
"$",
"constructorArguments",
")",
"{",
"if",
"(",
"!",
"isset",
"(",
"$",
"this",
"->",
"config",
"->",
"services",
"[",
"$",
"serviceId",
"]",
")",
")",
"{",
"throw",
"new"... | create and initialize a service instance
@param string $serviceId
@param array $constructorArguments
@throws ApplicationException
@return ServiceInterface | [
"create",
"and",
"initialize",
"a",
"service",
"instance"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L802-L835 | train |
Vectrex/vxPHP | src/Application/Application.php | Application.initializePlugin | private function initializePlugin($pluginId) {
$configData = $this->config->plugins[$pluginId];
// load class file
$class = str_replace('/', '\\', $configData['class']);
$file = $this->rootPath . 'src/' . $configData['classPath'] . $class . '.php';
if(!file_exists($file)) {
throw new ApplicationExce... | php | private function initializePlugin($pluginId) {
$configData = $this->config->plugins[$pluginId];
// load class file
$class = str_replace('/', '\\', $configData['class']);
$file = $this->rootPath . 'src/' . $configData['classPath'] . $class . '.php';
if(!file_exists($file)) {
throw new ApplicationExce... | [
"private",
"function",
"initializePlugin",
"(",
"$",
"pluginId",
")",
"{",
"$",
"configData",
"=",
"$",
"this",
"->",
"config",
"->",
"plugins",
"[",
"$",
"pluginId",
"]",
";",
"// load class file",
"$",
"class",
"=",
"str_replace",
"(",
"'/'",
",",
"'\\\\... | create, initialize and register a plugin instance
@param string $pluginId
@throws ApplicationException
@return SubscriberInterface | [
"create",
"initialize",
"and",
"register",
"a",
"plugin",
"instance"
] | 295c21b00e7ef6085efcdf5b64fabb28d499b5a6 | https://github.com/Vectrex/vxPHP/blob/295c21b00e7ef6085efcdf5b64fabb28d499b5a6/src/Application/Application.php#L844-L887 | train |
dmj/PicaRecord | src/HAB/Pica/Record/TitleRecord.php | TitleRecord.setFields | public function setFields (array $fields)
{
$this->_fields = array();
$this->_records = array();
$prevLevel = null;
foreach ($fields as $field) {
$level = $field->getLevel();
if ($level === 0) {
$this->append($field);
} else {
... | php | public function setFields (array $fields)
{
$this->_fields = array();
$this->_records = array();
$prevLevel = null;
foreach ($fields as $field) {
$level = $field->getLevel();
if ($level === 0) {
$this->append($field);
} else {
... | [
"public",
"function",
"setFields",
"(",
"array",
"$",
"fields",
")",
"{",
"$",
"this",
"->",
"_fields",
"=",
"array",
"(",
")",
";",
"$",
"this",
"->",
"_records",
"=",
"array",
"(",
")",
";",
"$",
"prevLevel",
"=",
"null",
";",
"foreach",
"(",
"$"... | Set the record's fields.
@todo Relocate to \HAB\Pica\Record\Record::factory(), maybe
@param array $fields Field
@return void | [
"Set",
"the",
"record",
"s",
"fields",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/TitleRecord.php#L63-L99 | train |
dmj/PicaRecord | src/HAB/Pica/Record/TitleRecord.php | TitleRecord.getLocalRecordByILN | public function getLocalRecordByILN ($iln)
{
foreach ($this->getLocalRecords() as $localRecord) {
if ($localRecord->getILN() == $iln) {
return $localRecord;
}
}
return null;
} | php | public function getLocalRecordByILN ($iln)
{
foreach ($this->getLocalRecords() as $localRecord) {
if ($localRecord->getILN() == $iln) {
return $localRecord;
}
}
return null;
} | [
"public",
"function",
"getLocalRecordByILN",
"(",
"$",
"iln",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getLocalRecords",
"(",
")",
"as",
"$",
"localRecord",
")",
"{",
"if",
"(",
"$",
"localRecord",
"->",
"getILN",
"(",
")",
"==",
"$",
"iln",
")",
... | Return a local record identified by its ILN.
@param integer $iln Intenal library number
@return LocalRecord|null | [
"Return",
"a",
"local",
"record",
"identified",
"by",
"its",
"ILN",
"."
] | bd5577b9a4333aa6156398b94cc870a9377061b8 | https://github.com/dmj/PicaRecord/blob/bd5577b9a4333aa6156398b94cc870a9377061b8/src/HAB/Pica/Record/TitleRecord.php#L143-L151 | train |
lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/PostRepository.php | PostRepository.getAllPublishablePosts | public function getAllPublishablePosts()
{
$collection = $this->getAll()->sortByDesc('updated_at');
$filtered = $collection->filter(function ($item) {
if ($item->enabled == 1) return true;
});
$filtered = $filtered->filter(function ($item) {
$todaysDate = Da... | php | public function getAllPublishablePosts()
{
$collection = $this->getAll()->sortByDesc('updated_at');
$filtered = $collection->filter(function ($item) {
if ($item->enabled == 1) return true;
});
$filtered = $filtered->filter(function ($item) {
$todaysDate = Da... | [
"public",
"function",
"getAllPublishablePosts",
"(",
")",
"{",
"$",
"collection",
"=",
"$",
"this",
"->",
"getAll",
"(",
")",
"->",
"sortByDesc",
"(",
"'updated_at'",
")",
";",
"$",
"filtered",
"=",
"$",
"collection",
"->",
"filter",
"(",
"function",
"(",
... | Get all the posts
ENABLED, PUBLISH_ON <= TODAY, DESC
@return collection | [
"Get",
"all",
"the",
"posts"
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/PostRepository.php#L74-L91 | train |
lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/PostRepository.php | PostRepository.getCategoryTitleById | public function getCategoryTitleById($categoryId)
{
$category = DB::table('categories')
->where('id', '=', $categoryId)
->first()
;
return $category->title;
} | php | public function getCategoryTitleById($categoryId)
{
$category = DB::table('categories')
->where('id', '=', $categoryId)
->first()
;
return $category->title;
} | [
"public",
"function",
"getCategoryTitleById",
"(",
"$",
"categoryId",
")",
"{",
"$",
"category",
"=",
"DB",
"::",
"table",
"(",
"'categories'",
")",
"->",
"where",
"(",
"'id'",
",",
"'='",
",",
"$",
"categoryId",
")",
"->",
"first",
"(",
")",
";",
"ret... | Find the category title by the category's id
I have this little function here because I do not want to inject the category's repository.
The purpose of having the category's title is to build a URL to all posts with that category.
@param int $categoryId The category's ID
@return string | [
"Find",
"the",
"category",
"title",
"by",
"the",
"category",
"s",
"id"
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/PostRepository.php#L191-L199 | train |
lasallecms/lasallecms-l5-lasallecmsapi-pkg | src/Repositories/PostRepository.php | PostRepository.getTagTitlesByPostId | public function getTagTitlesByPostId($postId)
{
// Grab the tag ID's from the post_tag table
$post_tags = DB::table('post_tag')
->where('post_id', '=', $postId)
->get()
;
// if there are no tags associated with this post, then return emptiness
if (emp... | php | public function getTagTitlesByPostId($postId)
{
// Grab the tag ID's from the post_tag table
$post_tags = DB::table('post_tag')
->where('post_id', '=', $postId)
->get()
;
// if there are no tags associated with this post, then return emptiness
if (emp... | [
"public",
"function",
"getTagTitlesByPostId",
"(",
"$",
"postId",
")",
"{",
"// Grab the tag ID's from the post_tag table",
"$",
"post_tags",
"=",
"DB",
"::",
"table",
"(",
"'post_tag'",
")",
"->",
"where",
"(",
"'post_id'",
",",
"'='",
",",
"$",
"postId",
")",
... | Find the tag's titles for those tags that are associated with a post.
I have this little function here because I do not want to inject the tag's repository.
@param int $postId The post's ID
@return array | [
"Find",
"the",
"tag",
"s",
"titles",
"for",
"those",
"tags",
"that",
"are",
"associated",
"with",
"a",
"post",
"."
] | 05083be19645d52be86d8ba4f322773db348a11d | https://github.com/lasallecms/lasallecms-l5-lasallecmsapi-pkg/blob/05083be19645d52be86d8ba4f322773db348a11d/src/Repositories/PostRepository.php#L210-L241 | train |
Kris-Kuiper/sFire-Framework | src/HTTP/Response.php | Response.addHeader | public static function addHeader($type, $value, $code = null) {
if(false == is_string($type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
}
if(false == is_string($value) && false == is_numeric($value)) {
... | php | public static function addHeader($type, $value, $code = null) {
if(false == is_string($type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
}
if(false == is_string($value) && false == is_numeric($value)) {
... | [
"public",
"static",
"function",
"addHeader",
"(",
"$",
"type",
",",
"$",
"value",
",",
"$",
"code",
"=",
"null",
")",
"{",
"if",
"(",
"false",
"==",
"is_string",
"(",
"$",
"type",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argum... | Sets the response header by type and value
@param string $type
@param string $value | [
"Sets",
"the",
"response",
"header",
"by",
"type",
"and",
"value"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/HTTP/Response.php#L21-L40 | train |
Kris-Kuiper/sFire-Framework | src/HTTP/Response.php | Response.removeHeader | public static function removeHeader($type) {
if(false == is_string($type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
}
header_remove($type);
} | php | public static function removeHeader($type) {
if(false == is_string($type)) {
return trigger_error(sprintf('Argument 1 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($type)), E_USER_ERROR);
}
header_remove($type);
} | [
"public",
"static",
"function",
"removeHeader",
"(",
"$",
"type",
")",
"{",
"if",
"(",
"false",
"==",
"is_string",
"(",
"$",
"type",
")",
")",
"{",
"return",
"trigger_error",
"(",
"sprintf",
"(",
"'Argument 1 passed to %s() must be of the type string, \"%s\" given'"... | Remove response header by type
@param string $type | [
"Remove",
"response",
"header",
"by",
"type"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/HTTP/Response.php#L47-L54 | train |
Kris-Kuiper/sFire-Framework | src/HTTP/Response.php | Response.file | public static function file(File $file, $filename = null, $mime = null) {
if(null !== $filename && false === is_string($filename)) {
return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($filename)), E_USER_ERROR);
}
if(null !== $mime && fa... | php | public static function file(File $file, $filename = null, $mime = null) {
if(null !== $filename && false === is_string($filename)) {
return trigger_error(sprintf('Argument 2 passed to %s() must be of the type string, "%s" given', __METHOD__, gettype($filename)), E_USER_ERROR);
}
if(null !== $mime && fa... | [
"public",
"static",
"function",
"file",
"(",
"File",
"$",
"file",
",",
"$",
"filename",
"=",
"null",
",",
"$",
"mime",
"=",
"null",
")",
"{",
"if",
"(",
"null",
"!==",
"$",
"filename",
"&&",
"false",
"===",
"is_string",
"(",
"$",
"filename",
")",
"... | Give a file for the client to download
@param sFire\System\File $file
@param string $name
@param string $mime | [
"Give",
"a",
"file",
"for",
"the",
"client",
"to",
"download"
] | deefe1d9d2b40e7326381e8dcd4f01f9aa61885c | https://github.com/Kris-Kuiper/sFire-Framework/blob/deefe1d9d2b40e7326381e8dcd4f01f9aa61885c/src/HTTP/Response.php#L71-L114 | train |
prolic/HumusMvc | src/HumusMvc/View/Helper/Navigation.php | Navigation.setPluginManager | public function setPluginManager(Navigation\PluginManager $plugins)
{
if ($this->view) {
$plugins->setView($this->view);
}
$this->plugins = $plugins;
return $this;
} | php | public function setPluginManager(Navigation\PluginManager $plugins)
{
if ($this->view) {
$plugins->setView($this->view);
}
$this->plugins = $plugins;
return $this;
} | [
"public",
"function",
"setPluginManager",
"(",
"Navigation",
"\\",
"PluginManager",
"$",
"plugins",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"view",
")",
"{",
"$",
"plugins",
"->",
"setView",
"(",
"$",
"this",
"->",
"view",
")",
";",
"}",
"$",
"this",
... | Set manager for retrieving navigation helpers
@param Navigation\PluginManager $plugins
@return Navigation | [
"Set",
"manager",
"for",
"retrieving",
"navigation",
"helpers"
] | 09e8c6422d84b57745cc643047e10761be2a21a7 | https://github.com/prolic/HumusMvc/blob/09e8c6422d84b57745cc643047e10761be2a21a7/src/HumusMvc/View/Helper/Navigation.php#L50-L57 | train |
prolic/HumusMvc | src/HumusMvc/View/Helper/Navigation.php | Navigation.getPluginManager | public function getPluginManager()
{
if (null === $this->plugins) {
$this->setPluginManager(new Navigation\PluginManager());
}
return $this->plugins;
} | php | public function getPluginManager()
{
if (null === $this->plugins) {
$this->setPluginManager(new Navigation\PluginManager());
}
return $this->plugins;
} | [
"public",
"function",
"getPluginManager",
"(",
")",
"{",
"if",
"(",
"null",
"===",
"$",
"this",
"->",
"plugins",
")",
"{",
"$",
"this",
"->",
"setPluginManager",
"(",
"new",
"Navigation",
"\\",
"PluginManager",
"(",
")",
")",
";",
"}",
"return",
"$",
"... | Retrieve plugin loader for navigation helpers
Lazy-loads an instance of Navigation\HelperLoader if none currently
registered.
@return Navigation\PluginManager | [
"Retrieve",
"plugin",
"loader",
"for",
"navigation",
"helpers"
] | 09e8c6422d84b57745cc643047e10761be2a21a7 | https://github.com/prolic/HumusMvc/blob/09e8c6422d84b57745cc643047e10761be2a21a7/src/HumusMvc/View/Helper/Navigation.php#L67-L73 | train |
wasinger/adaptimage | src/ImageFileInfo.php | ImageFileInfo.createFromFile | static public function createFromFile($pathname)
{
if (!file_exists($pathname)) {
throw new ImageFileNotFoundException($pathname);
}
$ii = getimagesize($pathname);
$width = $ii[0];
$height = $ii[1];
$imagetype = $ii[2];
$last_modified = fi... | php | static public function createFromFile($pathname)
{
if (!file_exists($pathname)) {
throw new ImageFileNotFoundException($pathname);
}
$ii = getimagesize($pathname);
$width = $ii[0];
$height = $ii[1];
$imagetype = $ii[2];
$last_modified = fi... | [
"static",
"public",
"function",
"createFromFile",
"(",
"$",
"pathname",
")",
"{",
"if",
"(",
"!",
"file_exists",
"(",
"$",
"pathname",
")",
")",
"{",
"throw",
"new",
"ImageFileNotFoundException",
"(",
"$",
"pathname",
")",
";",
"}",
"$",
"ii",
"=",
"geti... | Create an ImageFileInfo from an image file
@param string $pathname The pathname of an image file.
@return ImageFileInfo
@throws ImageFileNotFoundException If the image does not exist | [
"Create",
"an",
"ImageFileInfo",
"from",
"an",
"image",
"file"
] | 7b529b25081b399451c8bbd56d0cef7daaa83ec4 | https://github.com/wasinger/adaptimage/blob/7b529b25081b399451c8bbd56d0cef7daaa83ec4/src/ImageFileInfo.php#L79-L96 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setSingleType | public function setSingleType($singleType)
{
$allowedTypes = [
self::SINGLE_TYPE_EXACT,
self::SINGLE_TYPE_GREATER,
self::SINGLE_TYPE_GREATER_OR_EQUAL,
self::SINGLE_TYPE_LESS,
self::SINGLE_TYPE_LESS_OR_EQUAL,
];
if (!is_string($sing... | php | public function setSingleType($singleType)
{
$allowedTypes = [
self::SINGLE_TYPE_EXACT,
self::SINGLE_TYPE_GREATER,
self::SINGLE_TYPE_GREATER_OR_EQUAL,
self::SINGLE_TYPE_LESS,
self::SINGLE_TYPE_LESS_OR_EQUAL,
];
if (!is_string($sing... | [
"public",
"function",
"setSingleType",
"(",
"$",
"singleType",
")",
"{",
"$",
"allowedTypes",
"=",
"[",
"self",
"::",
"SINGLE_TYPE_EXACT",
",",
"self",
"::",
"SINGLE_TYPE_GREATER",
",",
"self",
"::",
"SINGLE_TYPE_GREATER_OR_EQUAL",
",",
"self",
"::",
"SINGLE_TYPE_... | Sets type for the filter treated as single.
@param string $singleType AbstractRangeOrSingleFilter::SINGLE_TYPE_*
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"type",
"for",
"the",
"filter",
"treated",
"as",
"single",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L455-L474 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setFromValuePropertyName | public function setFromValuePropertyName($fromValuePropertyName)
{
if (!is_string($fromValuePropertyName) || empty($fromValuePropertyName)) {
throw new InvalidArgumentException('"From value property name" argument must be string and must not be empty.');
}
if (!property_exists($... | php | public function setFromValuePropertyName($fromValuePropertyName)
{
if (!is_string($fromValuePropertyName) || empty($fromValuePropertyName)) {
throw new InvalidArgumentException('"From value property name" argument must be string and must not be empty.');
}
if (!property_exists($... | [
"public",
"function",
"setFromValuePropertyName",
"(",
"$",
"fromValuePropertyName",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"fromValuePropertyName",
")",
"||",
"empty",
"(",
"$",
"fromValuePropertyName",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentExc... | Sets "from" value property name, which contains the "from" value.
@param string $fromValuePropertyName
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"from",
"value",
"property",
"name",
"which",
"contains",
"the",
"from",
"value",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L494-L507 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setToValuePropertyName | public function setToValuePropertyName($toValuePropertyName)
{
if (!is_string($toValuePropertyName) || empty($toValuePropertyName)) {
throw new InvalidArgumentException('"To value property name" argument must be string and must not be empty.');
}
if (!property_exists($this, $toV... | php | public function setToValuePropertyName($toValuePropertyName)
{
if (!is_string($toValuePropertyName) || empty($toValuePropertyName)) {
throw new InvalidArgumentException('"To value property name" argument must be string and must not be empty.');
}
if (!property_exists($this, $toV... | [
"public",
"function",
"setToValuePropertyName",
"(",
"$",
"toValuePropertyName",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"toValuePropertyName",
")",
"||",
"empty",
"(",
"$",
"toValuePropertyName",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",... | Sets "to" value property name, which contains the "to" value.
@param string $toValuePropertyName
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"to",
"value",
"property",
"name",
"which",
"contains",
"the",
"to",
"value",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L527-L540 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setFromPostfix | public function setFromPostfix($fromPostfix)
{
if (!is_string($fromPostfix) || empty($fromPostfix)) {
throw new InvalidArgumentException('"From postfix" argument must be string and must not be empty.');
}
$this->fromPostfix = $fromPostfix;
return $this;
} | php | public function setFromPostfix($fromPostfix)
{
if (!is_string($fromPostfix) || empty($fromPostfix)) {
throw new InvalidArgumentException('"From postfix" argument must be string and must not be empty.');
}
$this->fromPostfix = $fromPostfix;
return $this;
} | [
"public",
"function",
"setFromPostfix",
"(",
"$",
"fromPostfix",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"fromPostfix",
")",
"||",
"empty",
"(",
"$",
"fromPostfix",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'\"From postfix\" arg... | Sets "from" name postfix.
@param string $fromPostfix
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"from",
"name",
"postfix",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L560-L569 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setToPostfix | public function setToPostfix($toPostfix)
{
if (!is_string($toPostfix) || empty($toPostfix)) {
throw new InvalidArgumentException('"To postfix" argument must be string and must not be empty.');
}
$this->toPostfix = $toPostfix;
return $this;
} | php | public function setToPostfix($toPostfix)
{
if (!is_string($toPostfix) || empty($toPostfix)) {
throw new InvalidArgumentException('"To postfix" argument must be string and must not be empty.');
}
$this->toPostfix = $toPostfix;
return $this;
} | [
"public",
"function",
"setToPostfix",
"(",
"$",
"toPostfix",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"toPostfix",
")",
"||",
"empty",
"(",
"$",
"toPostfix",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentException",
"(",
"'\"To postfix\" argument must... | Sets "to" name postfix.
@param string $toPostfix
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"to",
"name",
"postfix",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L589-L598 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setRangedFromType | public function setRangedFromType($rangedFromType)
{
$allowedTypes = [self::RANGED_FROM_TYPE_GREATER, self::RANGED_FROM_TYPE_GREATER_OR_EQUAL];
if (!is_string($rangedFromType) || !in_array($rangedFromType, $allowedTypes, true)) {
throw new InvalidArgumentException(sprintf(
... | php | public function setRangedFromType($rangedFromType)
{
$allowedTypes = [self::RANGED_FROM_TYPE_GREATER, self::RANGED_FROM_TYPE_GREATER_OR_EQUAL];
if (!is_string($rangedFromType) || !in_array($rangedFromType, $allowedTypes, true)) {
throw new InvalidArgumentException(sprintf(
... | [
"public",
"function",
"setRangedFromType",
"(",
"$",
"rangedFromType",
")",
"{",
"$",
"allowedTypes",
"=",
"[",
"self",
"::",
"RANGED_FROM_TYPE_GREATER",
",",
"self",
"::",
"RANGED_FROM_TYPE_GREATER_OR_EQUAL",
"]",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"ra... | Sets "from" type for the filter treated as ranged.
@param string $rangedFromType AbstractRangeOrSingleFilter::RANGED_FROM_TYPE_*
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"from",
"type",
"for",
"the",
"filter",
"treated",
"as",
"ranged",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L628-L641 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setRangedToType | public function setRangedToType($rangedToType)
{
$allowedTypes = [self::RANGED_TO_TYPE_LESS, self::RANGED_TO_TYPE_LESS_OR_EQUAL];
if (!is_string($rangedToType) || !in_array($rangedToType, $allowedTypes)) {
throw new InvalidArgumentException(sprintf(
'Invalid "ranged to t... | php | public function setRangedToType($rangedToType)
{
$allowedTypes = [self::RANGED_TO_TYPE_LESS, self::RANGED_TO_TYPE_LESS_OR_EQUAL];
if (!is_string($rangedToType) || !in_array($rangedToType, $allowedTypes)) {
throw new InvalidArgumentException(sprintf(
'Invalid "ranged to t... | [
"public",
"function",
"setRangedToType",
"(",
"$",
"rangedToType",
")",
"{",
"$",
"allowedTypes",
"=",
"[",
"self",
"::",
"RANGED_TO_TYPE_LESS",
",",
"self",
"::",
"RANGED_TO_TYPE_LESS_OR_EQUAL",
"]",
";",
"if",
"(",
"!",
"is_string",
"(",
"$",
"rangedToType",
... | Sets "to" type for the filter treated as ranged.
@param string $rangedToType AbstractRangeOrSingleFilter::RANGED_TO_TYPE_*
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"to",
"type",
"for",
"the",
"filter",
"treated",
"as",
"ranged",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L661-L674 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setFormFieldTypeRangedFrom | public function setFormFieldTypeRangedFrom($formFieldTypeRangedFrom)
{
if (!is_string($formFieldTypeRangedFrom) || empty($formFieldTypeRangedFrom)) {
throw new InvalidArgumentException('"Form field type ranged from" argument must be string and must not be empty.');
}
$this->form... | php | public function setFormFieldTypeRangedFrom($formFieldTypeRangedFrom)
{
if (!is_string($formFieldTypeRangedFrom) || empty($formFieldTypeRangedFrom)) {
throw new InvalidArgumentException('"Form field type ranged from" argument must be string and must not be empty.');
}
$this->form... | [
"public",
"function",
"setFormFieldTypeRangedFrom",
"(",
"$",
"formFieldTypeRangedFrom",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"formFieldTypeRangedFrom",
")",
"||",
"empty",
"(",
"$",
"formFieldTypeRangedFrom",
")",
")",
"{",
"throw",
"new",
"InvalidArg... | Sets form field type for "from" field.
@param string $formFieldTypeRangedFrom
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"form",
"field",
"type",
"for",
"from",
"field",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L694-L703 | train |
dmitrya2e/filtration-bundle | Filter/Filter/AbstractRangeOrSingleFilter.php | AbstractRangeOrSingleFilter.setFormFieldTypeRangedTo | public function setFormFieldTypeRangedTo($formFieldTypeRangedTo)
{
if (!is_string($formFieldTypeRangedTo) || empty($formFieldTypeRangedTo)) {
throw new InvalidArgumentException('"Form field type ranged to" argument must be string and must not be empty.');
}
$this->formFieldTypeR... | php | public function setFormFieldTypeRangedTo($formFieldTypeRangedTo)
{
if (!is_string($formFieldTypeRangedTo) || empty($formFieldTypeRangedTo)) {
throw new InvalidArgumentException('"Form field type ranged to" argument must be string and must not be empty.');
}
$this->formFieldTypeR... | [
"public",
"function",
"setFormFieldTypeRangedTo",
"(",
"$",
"formFieldTypeRangedTo",
")",
"{",
"if",
"(",
"!",
"is_string",
"(",
"$",
"formFieldTypeRangedTo",
")",
"||",
"empty",
"(",
"$",
"formFieldTypeRangedTo",
")",
")",
"{",
"throw",
"new",
"InvalidArgumentExc... | Sets form field type for "to" field.
@param string $formFieldTypeRangedTo
@return static
@throws InvalidArgumentException On invalid argument | [
"Sets",
"form",
"field",
"type",
"for",
"to",
"field",
"."
] | fed5764af4e43871835744fb84957b2a76e9a215 | https://github.com/dmitrya2e/filtration-bundle/blob/fed5764af4e43871835744fb84957b2a76e9a215/Filter/Filter/AbstractRangeOrSingleFilter.php#L723-L732 | train |
t3v/t3v_core | Classes/Utility/IconUtility.php | IconUtility.iconIdentifier | public static function iconIdentifier(string $iconKey, string $separator = '_'): string {
$slugify = new Slugify(['separator' => $separator]);
$iconIdentifier = $slugify->slugify($iconKey);
return $iconIdentifier;
} | php | public static function iconIdentifier(string $iconKey, string $separator = '_'): string {
$slugify = new Slugify(['separator' => $separator]);
$iconIdentifier = $slugify->slugify($iconKey);
return $iconIdentifier;
} | [
"public",
"static",
"function",
"iconIdentifier",
"(",
"string",
"$",
"iconKey",
",",
"string",
"$",
"separator",
"=",
"'_'",
")",
":",
"string",
"{",
"$",
"slugify",
"=",
"new",
"Slugify",
"(",
"[",
"'separator'",
"=>",
"$",
"separator",
"]",
")",
";",
... | Gets an icon identifier from an icon key.
@param string $iconKey The icon key
@param string $separator The optional separator, defaults to `_`
@return string The icon identifier | [
"Gets",
"an",
"icon",
"identifier",
"from",
"an",
"icon",
"key",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/IconUtility.php#L19-L24 | train |
t3v/t3v_core | Classes/Utility/IconUtility.php | IconUtility.getIconIdentifier | public static function getIconIdentifier(string $iconKey, string $separator = '_'): string {
return self::iconIdentifier($iconKey, $separator);
} | php | public static function getIconIdentifier(string $iconKey, string $separator = '_'): string {
return self::iconIdentifier($iconKey, $separator);
} | [
"public",
"static",
"function",
"getIconIdentifier",
"(",
"string",
"$",
"iconKey",
",",
"string",
"$",
"separator",
"=",
"'_'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"iconIdentifier",
"(",
"$",
"iconKey",
",",
"$",
"separator",
")",
";",
"}"
] | Alias for the `iconIdentifier` function.
@param string $iconKey The icon key
@param string $separator The optional separator, defaults to `_`
@return string The icon identifier | [
"Alias",
"for",
"the",
"iconIdentifier",
"function",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/IconUtility.php#L33-L35 | train |
t3v/t3v_core | Classes/Utility/IconUtility.php | IconUtility.iconSignature | public static function iconSignature(string $extensionKey, string $iconIdentifier, string $separator = '-'): string {
$iconSignature = mb_strtolower("${extensionKey}${separator}${iconIdentifier}");
return $iconSignature;
} | php | public static function iconSignature(string $extensionKey, string $iconIdentifier, string $separator = '-'): string {
$iconSignature = mb_strtolower("${extensionKey}${separator}${iconIdentifier}");
return $iconSignature;
} | [
"public",
"static",
"function",
"iconSignature",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"iconIdentifier",
",",
"string",
"$",
"separator",
"=",
"'-'",
")",
":",
"string",
"{",
"$",
"iconSignature",
"=",
"mb_strtolower",
"(",
"\"${extensionKey}${... | Gets an icon signature from an extension key and icon identifier.
@param string $extensionKey The extension key
@param string $iconIdentifier The icon identifier
@param string $separator The optional separator, defaults to `-`
@return string The icon signature | [
"Gets",
"an",
"icon",
"signature",
"from",
"an",
"extension",
"key",
"and",
"icon",
"identifier",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/IconUtility.php#L45-L49 | train |
t3v/t3v_core | Classes/Utility/IconUtility.php | IconUtility.getIconSignature | public static function getIconSignature(string $extensionKey, string $iconIdentifier, string $separator = '-'): string {
return self::iconSignature($extensionKey, $iconIdentifier, $separator);
} | php | public static function getIconSignature(string $extensionKey, string $iconIdentifier, string $separator = '-'): string {
return self::iconSignature($extensionKey, $iconIdentifier, $separator);
} | [
"public",
"static",
"function",
"getIconSignature",
"(",
"string",
"$",
"extensionKey",
",",
"string",
"$",
"iconIdentifier",
",",
"string",
"$",
"separator",
"=",
"'-'",
")",
":",
"string",
"{",
"return",
"self",
"::",
"iconSignature",
"(",
"$",
"extensionKey... | Alias for the `iconSignature` function.
@param string $extensionKey The extension key
@param string $iconIdentifier The icon identifier
@param string $separator The optional separator, defaults to `-`
@return string The icon signature | [
"Alias",
"for",
"the",
"iconSignature",
"function",
"."
] | 8c04b7688cc2773f11fcc87fda3f7cd53d80a980 | https://github.com/t3v/t3v_core/blob/8c04b7688cc2773f11fcc87fda3f7cd53d80a980/Classes/Utility/IconUtility.php#L59-L61 | train |
DreadLabs/VantomasWebsite | src/SecretSanta/Donee/Resolver.php | Resolver.resolveFor | public function resolveFor(UserIdInterface $donorId)
{
$donor = $this->donorRepository->findOneById($donorId);
$donee = $this->getResolverHandlerChain()->resolve($donor);
$this->eventContext->dispatch(FoundDonee::fromPair($donor, $donee));
return $donee;
} | php | public function resolveFor(UserIdInterface $donorId)
{
$donor = $this->donorRepository->findOneById($donorId);
$donee = $this->getResolverHandlerChain()->resolve($donor);
$this->eventContext->dispatch(FoundDonee::fromPair($donor, $donee));
return $donee;
} | [
"public",
"function",
"resolveFor",
"(",
"UserIdInterface",
"$",
"donorId",
")",
"{",
"$",
"donor",
"=",
"$",
"this",
"->",
"donorRepository",
"->",
"findOneById",
"(",
"$",
"donorId",
")",
";",
"$",
"donee",
"=",
"$",
"this",
"->",
"getResolverHandlerChain"... | Resolves a donee for the incoming donor user id
@param UserIdInterface $donorId User id of the donor
@return DoneeInterface A donee | [
"Resolves",
"a",
"donee",
"for",
"the",
"incoming",
"donor",
"user",
"id"
] | 7f85f2b45bdf5ed9fa9d320c805c416bf99cd668 | https://github.com/DreadLabs/VantomasWebsite/blob/7f85f2b45bdf5ed9fa9d320c805c416bf99cd668/src/SecretSanta/Donee/Resolver.php#L77-L86 | train |
DreadLabs/VantomasWebsite | src/SecretSanta/Donee/Resolver.php | Resolver.getResolverHandlerChain | private function getResolverHandlerChain()
{
$randomResolver = $this->resolverFactory->create(Random::class);
$nonMutualResolver = $this->resolverFactory->create(NonMutual::class, $randomResolver);
return $this->resolverFactory->create(FromExistingPair::class, $nonMutualResolver);
} | php | private function getResolverHandlerChain()
{
$randomResolver = $this->resolverFactory->create(Random::class);
$nonMutualResolver = $this->resolverFactory->create(NonMutual::class, $randomResolver);
return $this->resolverFactory->create(FromExistingPair::class, $nonMutualResolver);
} | [
"private",
"function",
"getResolverHandlerChain",
"(",
")",
"{",
"$",
"randomResolver",
"=",
"$",
"this",
"->",
"resolverFactory",
"->",
"create",
"(",
"Random",
"::",
"class",
")",
";",
"$",
"nonMutualResolver",
"=",
"$",
"this",
"->",
"resolverFactory",
"->"... | Builds and returns the resolver handler chain
@return ResolverHandlerInterface | [
"Builds",
"and",
"returns",
"the",
"resolver",
"handler",
"chain"
] | 7f85f2b45bdf5ed9fa9d320c805c416bf99cd668 | https://github.com/DreadLabs/VantomasWebsite/blob/7f85f2b45bdf5ed9fa9d320c805c416bf99cd668/src/SecretSanta/Donee/Resolver.php#L93-L99 | train |
BapCat/Remodel | src/Registry.php | Registry.register | public function register(EntityDefinition $builder): void {
$this->defs[$builder->full_name] = $builder;
$this->unchecked[] = $builder;
$binding_name = str_replace('\\', '.', $builder->full_name);
$this->ioc->bind('bap.remodel.scopes.' . $binding_name, function() use($builder) {
return $builder->... | php | public function register(EntityDefinition $builder): void {
$this->defs[$builder->full_name] = $builder;
$this->unchecked[] = $builder;
$binding_name = str_replace('\\', '.', $builder->full_name);
$this->ioc->bind('bap.remodel.scopes.' . $binding_name, function() use($builder) {
return $builder->... | [
"public",
"function",
"register",
"(",
"EntityDefinition",
"$",
"builder",
")",
":",
"void",
"{",
"$",
"this",
"->",
"defs",
"[",
"$",
"builder",
"->",
"full_name",
"]",
"=",
"$",
"builder",
";",
"$",
"this",
"->",
"unchecked",
"[",
"]",
"=",
"$",
"b... | Register an Entity definition. Note this method DOES NOT generate the classes. They are generated when needed.
@param EntityDefinition $builder
@return void | [
"Register",
"an",
"Entity",
"definition",
".",
"Note",
"this",
"method",
"DOES",
"NOT",
"generate",
"the",
"classes",
".",
"They",
"are",
"generated",
"when",
"needed",
"."
] | 80fcdec8bca22b88c5af9a0a93622c796cf3e7b1 | https://github.com/BapCat/Remodel/blob/80fcdec8bca22b88c5af9a0a93622c796cf3e7b1/src/Registry.php#L66-L96 | train |
GrottoPress/wordpress-meta-box | src/lib/MetaBox.php | MetaBox.preSaveChecksPassed | protected function preSaveChecksPassed(int $post_id): bool
{
if ($post_id < 1) {
return false;
}
if (\defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return false;
}
if (!\current_user_can(
\get_post_type_object(\get_post_type($post_id))->... | php | protected function preSaveChecksPassed(int $post_id): bool
{
if ($post_id < 1) {
return false;
}
if (\defined('DOING_AUTOSAVE') && DOING_AUTOSAVE) {
return false;
}
if (!\current_user_can(
\get_post_type_object(\get_post_type($post_id))->... | [
"protected",
"function",
"preSaveChecksPassed",
"(",
"int",
"$",
"post_id",
")",
":",
"bool",
"{",
"if",
"(",
"$",
"post_id",
"<",
"1",
")",
"{",
"return",
"false",
";",
"}",
"if",
"(",
"\\",
"defined",
"(",
"'DOING_AUTOSAVE'",
")",
"&&",
"DOING_AUTOSAVE... | Checks to perform prior save | [
"Checks",
"to",
"perform",
"prior",
"save"
] | c8c498e29da5f91fbc08d357dac3afdb391fc820 | https://github.com/GrottoPress/wordpress-meta-box/blob/c8c498e29da5f91fbc08d357dac3afdb391fc820/src/lib/MetaBox.php#L184-L208 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.createTable | public function createTable(
$name,
array $columns = array(),
array $primaryKey = array(),
array $foreignKeys = array(),
array $indexes = array(),
array $checks = array()
) {
$table = new Table($name);
foreach ($columns as $column) {
if (!... | php | public function createTable(
$name,
array $columns = array(),
array $primaryKey = array(),
array $foreignKeys = array(),
array $indexes = array(),
array $checks = array()
) {
$table = new Table($name);
foreach ($columns as $column) {
if (!... | [
"public",
"function",
"createTable",
"(",
"$",
"name",
",",
"array",
"$",
"columns",
"=",
"array",
"(",
")",
",",
"array",
"$",
"primaryKey",
"=",
"array",
"(",
")",
",",
"array",
"$",
"foreignKeys",
"=",
"array",
"(",
")",
",",
"array",
"$",
"indexe... | Creates and adds a new table.
@param string $name The table name.
@param array $columns The table columns.
@param array $primaryKey The table primary key.
@param array $foreignKeys The table foreign keys.
@param array $indexes The table indexes.
@param array $checks The table checks.
@return... | [
"Creates",
"and",
"adds",
"a",
"new",
"table",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L61-L133 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.setTables | public function setTables(array $tables)
{
$this->tables = array();
foreach ($tables as $table) {
$this->addTable($table);
}
} | php | public function setTables(array $tables)
{
$this->tables = array();
foreach ($tables as $table) {
$this->addTable($table);
}
} | [
"public",
"function",
"setTables",
"(",
"array",
"$",
"tables",
")",
"{",
"$",
"this",
"->",
"tables",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"tables",
"as",
"$",
"table",
")",
"{",
"$",
"this",
"->",
"addTable",
"(",
"$",
"table",
")",
... | Sets the schema tables.
@param array $tables The schema tables. | [
"Sets",
"the",
"schema",
"tables",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L160-L167 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.getTable | public function getTable($name)
{
if (!$this->hasTable($name)) {
throw SchemaException::schemaTableDoesNotExist($this->getName(), $name);
}
return $this->tables[$name];
} | php | public function getTable($name)
{
if (!$this->hasTable($name)) {
throw SchemaException::schemaTableDoesNotExist($this->getName(), $name);
}
return $this->tables[$name];
} | [
"public",
"function",
"getTable",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasTable",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaTableDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",... | Gets a table.
@param string $name The table name.
@throws \Fridge\DBAL\Exception\SchemaException If the table does not exist.
@return \Fridge\DBAL\Schema\Table The table. | [
"Gets",
"a",
"table",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L190-L197 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.addTable | public function addTable(Table $table)
{
if ($this->hasTable($table->getName())) {
throw SchemaException::schemaTableAlreadyExists($this->getName(), $table->getName());
}
$this->tables[$table->getName()] = $table;
if ($table->getSchema() !== $this) {
$table-... | php | public function addTable(Table $table)
{
if ($this->hasTable($table->getName())) {
throw SchemaException::schemaTableAlreadyExists($this->getName(), $table->getName());
}
$this->tables[$table->getName()] = $table;
if ($table->getSchema() !== $this) {
$table-... | [
"public",
"function",
"addTable",
"(",
"Table",
"$",
"table",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasTable",
"(",
"$",
"table",
"->",
"getName",
"(",
")",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaTableAlreadyExists",
"(",
"$",
"this",... | Adds a table to the schema.
@param \Fridge\DBAL\Schema\Table $table The table to add.
@throws \Fridge\DBAL\Exception\SchemaException If the table already exists. | [
"Adds",
"a",
"table",
"to",
"the",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L206-L217 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.createSequence | public function createSequence($name, $initialValue = 1, $incrementSize = 1)
{
$sequence = new Sequence($name, $initialValue, $incrementSize);
$this->addSequence($sequence);
return $sequence;
} | php | public function createSequence($name, $initialValue = 1, $incrementSize = 1)
{
$sequence = new Sequence($name, $initialValue, $incrementSize);
$this->addSequence($sequence);
return $sequence;
} | [
"public",
"function",
"createSequence",
"(",
"$",
"name",
",",
"$",
"initialValue",
"=",
"1",
",",
"$",
"incrementSize",
"=",
"1",
")",
"{",
"$",
"sequence",
"=",
"new",
"Sequence",
"(",
"$",
"name",
",",
"$",
"initialValue",
",",
"$",
"incrementSize",
... | Creates and adds a new sequence.
@param string $name The sequence name.
@param integer $initialValue The sequence initial value.
@param integer $incrementSize The sequence increment size.
@return \Fridge\DBAL\Schema\Sequence The new sequence. | [
"Creates",
"and",
"adds",
"a",
"new",
"sequence",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L269-L275 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.setSequences | public function setSequences(array $sequences)
{
$this->sequences = array();
foreach ($sequences as $sequence) {
$this->addSequence($sequence);
}
} | php | public function setSequences(array $sequences)
{
$this->sequences = array();
foreach ($sequences as $sequence) {
$this->addSequence($sequence);
}
} | [
"public",
"function",
"setSequences",
"(",
"array",
"$",
"sequences",
")",
"{",
"$",
"this",
"->",
"sequences",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"sequences",
"as",
"$",
"sequence",
")",
"{",
"$",
"this",
"->",
"addSequence",
"(",
"$",
... | Sets the schema sequences.
@param array $sequences The schema sequences. | [
"Sets",
"the",
"schema",
"sequences",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L302-L309 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.getSequence | public function getSequence($name)
{
if (!$this->hasSequence($name)) {
throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $name);
}
return $this->sequences[$name];
} | php | public function getSequence($name)
{
if (!$this->hasSequence($name)) {
throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $name);
}
return $this->sequences[$name];
} | [
"public",
"function",
"getSequence",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasSequence",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaSequenceDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")... | Gets a sequence.
@param string $name The sequence name.
@return \Fridge\DBAL\Schema\Sequence The sequence.
@throws \Fridge\DBAL\Exception\SchemaException If the sequence does not exist. | [
"Gets",
"a",
"sequence",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L332-L339 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.addSequence | public function addSequence(Sequence $sequence)
{
if ($this->hasSequence($sequence->getName())) {
throw SchemaException::schemaSequenceAlreadyExists($this->getName(), $sequence->getName());
}
$this->sequences[$sequence->getName()] = $sequence;
} | php | public function addSequence(Sequence $sequence)
{
if ($this->hasSequence($sequence->getName())) {
throw SchemaException::schemaSequenceAlreadyExists($this->getName(), $sequence->getName());
}
$this->sequences[$sequence->getName()] = $sequence;
} | [
"public",
"function",
"addSequence",
"(",
"Sequence",
"$",
"sequence",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasSequence",
"(",
"$",
"sequence",
"->",
"getName",
"(",
")",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaSequenceAlreadyExists",
"("... | Adds a sequence to the schema.
@param Fridge\DBAL\Schema\Sequence $sequence The sequence to add.
@throws \Fridge\DBAL\Exception\SchemaException If the sequence already exists. | [
"Adds",
"a",
"sequence",
"to",
"the",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L348-L355 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.renameSequence | public function renameSequence($oldName, $newName)
{
if (!$this->hasSequence($oldName)) {
throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $oldName);
}
if ($this->hasSequence($newName)) {
throw SchemaException::schemaSequenceAlreadyExists($this->ge... | php | public function renameSequence($oldName, $newName)
{
if (!$this->hasSequence($oldName)) {
throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $oldName);
}
if ($this->hasSequence($newName)) {
throw SchemaException::schemaSequenceAlreadyExists($this->ge... | [
"public",
"function",
"renameSequence",
"(",
"$",
"oldName",
",",
"$",
"newName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasSequence",
"(",
"$",
"oldName",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaSequenceDoesNotExist",
"(",
"$",
"thi... | Renames a sequence.
@param string $oldName The old sequence name.
@param string $newName The new sequence name.
@throws \Fridge\DBAL\Exception\SchemaException If the old sequence does not exist or if the new sequence
already exists. | [
"Renames",
"a",
"sequence",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L366-L380 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.dropSequence | public function dropSequence($name)
{
if (!$this->hasSequence($name)) {
throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $name);
}
unset($this->sequences[$name]);
} | php | public function dropSequence($name)
{
if (!$this->hasSequence($name)) {
throw SchemaException::schemaSequenceDoesNotExist($this->getName(), $name);
}
unset($this->sequences[$name]);
} | [
"public",
"function",
"dropSequence",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasSequence",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaSequenceDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
"... | Drops a sequence.
@param string $name The sequence name.
@throws \Fridge\DBAL\Exception\SchemaException If the sequence does not exist. | [
"Drops",
"a",
"sequence",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L389-L396 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.createView | public function createView($name, $sql = null)
{
$view = new View($name, $sql);
$this->addView($view);
return $view;
} | php | public function createView($name, $sql = null)
{
$view = new View($name, $sql);
$this->addView($view);
return $view;
} | [
"public",
"function",
"createView",
"(",
"$",
"name",
",",
"$",
"sql",
"=",
"null",
")",
"{",
"$",
"view",
"=",
"new",
"View",
"(",
"$",
"name",
",",
"$",
"sql",
")",
";",
"$",
"this",
"->",
"addView",
"(",
"$",
"view",
")",
";",
"return",
"$",... | Creates and adds a new view.
@param string $name The view name.
@param string $sql The view sql.
@return \Fridge\DBAL\Schema\View The new view. | [
"Creates",
"and",
"adds",
"a",
"new",
"view",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L406-L412 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.setViews | public function setViews(array $views)
{
$this->views = array();
foreach ($views as $view) {
$this->addView($view);
}
} | php | public function setViews(array $views)
{
$this->views = array();
foreach ($views as $view) {
$this->addView($view);
}
} | [
"public",
"function",
"setViews",
"(",
"array",
"$",
"views",
")",
"{",
"$",
"this",
"->",
"views",
"=",
"array",
"(",
")",
";",
"foreach",
"(",
"$",
"views",
"as",
"$",
"view",
")",
"{",
"$",
"this",
"->",
"addView",
"(",
"$",
"view",
")",
";",
... | Sets the schema views.
@param array $views The schema views. | [
"Sets",
"the",
"schema",
"views",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L439-L446 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.getView | public function getView($name)
{
if (!$this->hasView($name)) {
throw SchemaException::schemaViewDoesNotExist($this->getName(), $name);
}
return $this->views[$name];
} | php | public function getView($name)
{
if (!$this->hasView($name)) {
throw SchemaException::schemaViewDoesNotExist($this->getName(), $name);
}
return $this->views[$name];
} | [
"public",
"function",
"getView",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasView",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaViewDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",
... | Gets a view.
@param string $name The view name.
@return \Fridge\DBAL\Schema\View The view.
@throws \Fridge\DBAL\Exception\SchemaException If the view does not exist. | [
"Gets",
"a",
"view",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L469-L476 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.addView | public function addView(View $view)
{
if ($this->hasView($view->getName())) {
throw SchemaException::schemaViewAlreadyExists($this->getName(), $view->getName());
}
$this->views[$view->getName()] = $view;
} | php | public function addView(View $view)
{
if ($this->hasView($view->getName())) {
throw SchemaException::schemaViewAlreadyExists($this->getName(), $view->getName());
}
$this->views[$view->getName()] = $view;
} | [
"public",
"function",
"addView",
"(",
"View",
"$",
"view",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"hasView",
"(",
"$",
"view",
"->",
"getName",
"(",
")",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaViewAlreadyExists",
"(",
"$",
"this",
"->... | Adds a view to the schema.
@param \Fridge\DBAL\Schema\View $view The view to add.
@throws \Fridge\DBAL\Exception\SchemaException If the view already exists. | [
"Adds",
"a",
"view",
"to",
"the",
"schema",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L485-L492 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.renameView | public function renameView($oldName, $newName)
{
if (!$this->hasView($oldName)) {
throw SchemaException::schemaViewDoesNotExist($this->getName(), $oldName);
}
if ($this->hasView($newName)) {
throw SchemaException::schemaViewAlreadyExists($this->getName(), $newName);
... | php | public function renameView($oldName, $newName)
{
if (!$this->hasView($oldName)) {
throw SchemaException::schemaViewDoesNotExist($this->getName(), $oldName);
}
if ($this->hasView($newName)) {
throw SchemaException::schemaViewAlreadyExists($this->getName(), $newName);
... | [
"public",
"function",
"renameView",
"(",
"$",
"oldName",
",",
"$",
"newName",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasView",
"(",
"$",
"oldName",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaViewDoesNotExist",
"(",
"$",
"this",
"->",
... | Renames a view.
@param string $oldName The old view name.
@param string $newName The new view name.
@throws \Fridge\DBAL\Exception\SchemaException If the old view does not exist or if the new view already exists. | [
"Renames",
"a",
"view",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L502-L516 | train |
fridge-project/dbal | src/Fridge/DBAL/Schema/Schema.php | Schema.dropView | public function dropView($name)
{
if (!$this->hasView($name)) {
throw SchemaException::schemaViewDoesNotExist($this->getName(), $name);
}
unset($this->views[$name]);
} | php | public function dropView($name)
{
if (!$this->hasView($name)) {
throw SchemaException::schemaViewDoesNotExist($this->getName(), $name);
}
unset($this->views[$name]);
} | [
"public",
"function",
"dropView",
"(",
"$",
"name",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"hasView",
"(",
"$",
"name",
")",
")",
"{",
"throw",
"SchemaException",
"::",
"schemaViewDoesNotExist",
"(",
"$",
"this",
"->",
"getName",
"(",
")",
",",
... | Drops a view.
@param string $name The view name.
@throws \Fridge\DBAL\Exception\SchemaException If the view does not exist. | [
"Drops",
"a",
"view",
"."
] | d0b8c3551922d696836487aa0eb1bd74014edcd4 | https://github.com/fridge-project/dbal/blob/d0b8c3551922d696836487aa0eb1bd74014edcd4/src/Fridge/DBAL/Schema/Schema.php#L525-L532 | train |
mossphp/moss-storage | Moss/Storage/Model/Definition/Field.php | Field.prepareAttributes | protected function prepareAttributes(array $attributes)
{
foreach ($attributes as $key => $value) {
if (is_numeric($key)) {
unset($attributes[$key]);
$attributes[$value] = true;
continue;
}
}
if (isset($attributes['null... | php | protected function prepareAttributes(array $attributes)
{
foreach ($attributes as $key => $value) {
if (is_numeric($key)) {
unset($attributes[$key]);
$attributes[$value] = true;
continue;
}
}
if (isset($attributes['null... | [
"protected",
"function",
"prepareAttributes",
"(",
"array",
"$",
"attributes",
")",
"{",
"foreach",
"(",
"$",
"attributes",
"as",
"$",
"key",
"=>",
"$",
"value",
")",
"{",
"if",
"(",
"is_numeric",
"(",
"$",
"key",
")",
")",
"{",
"unset",
"(",
"$",
"a... | Prepares attributes, changes them into key value pairs
@param array $attributes
@return array | [
"Prepares",
"attributes",
"changes",
"them",
"into",
"key",
"value",
"pairs"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Model/Definition/Field.php#L51-L67 | train |
mossphp/moss-storage | Moss/Storage/Model/Definition/Field.php | Field.table | public function table($table = null)
{
if ($table !== null) {
$this->table = $table;
}
return $this->table;
} | php | public function table($table = null)
{
if ($table !== null) {
$this->table = $table;
}
return $this->table;
} | [
"public",
"function",
"table",
"(",
"$",
"table",
"=",
"null",
")",
"{",
"if",
"(",
"$",
"table",
"!==",
"null",
")",
"{",
"$",
"this",
"->",
"table",
"=",
"$",
"table",
";",
"}",
"return",
"$",
"this",
"->",
"table",
";",
"}"
] | Returns table owning the field
@param null|string $table
@return string | [
"Returns",
"table",
"owning",
"the",
"field"
] | 0d123e7ae6bbfce1e2a18e73bf70997277b430c1 | https://github.com/mossphp/moss-storage/blob/0d123e7ae6bbfce1e2a18e73bf70997277b430c1/Moss/Storage/Model/Definition/Field.php#L76-L83 | train |
AmericanCouncils/WebServicesBundle | Negotiator.php | Negotiator.negotiateRequestFormat | public function negotiateRequestFormat(Request $req)
{
$header = $req->headers->get('Content-Type');
$exp = explode(';', $header);
$type = $exp[0];
return isset($this->inputFormatMap[$type]) ? $this->inputFormatMap[$type] : false;
} | php | public function negotiateRequestFormat(Request $req)
{
$header = $req->headers->get('Content-Type');
$exp = explode(';', $header);
$type = $exp[0];
return isset($this->inputFormatMap[$type]) ? $this->inputFormatMap[$type] : false;
} | [
"public",
"function",
"negotiateRequestFormat",
"(",
"Request",
"$",
"req",
")",
"{",
"$",
"header",
"=",
"$",
"req",
"->",
"headers",
"->",
"get",
"(",
"'Content-Type'",
")",
";",
"$",
"exp",
"=",
"explode",
"(",
"';'",
",",
"$",
"header",
")",
";",
... | Return the incoming format, derived from the Requests content-type header. Generally this is used for determing which
format to use during deserialization.
@param Request $req
@return string | [
"Return",
"the",
"incoming",
"format",
"derived",
"from",
"the",
"Requests",
"content",
"-",
"type",
"header",
".",
"Generally",
"this",
"is",
"used",
"for",
"determing",
"which",
"format",
"to",
"use",
"during",
"deserialization",
"."
] | 3f6270ecf31138ba2271a94a407c0d1a05542929 | https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Negotiator.php#L74-L82 | train |
AmericanCouncils/WebServicesBundle | Negotiator.php | Negotiator.negotiateResponseFormat | public function negotiateResponseFormat(Request $req)
{
return $this->getFormatNegotiator()->getBestFormat($req->headers->get('Accept'), $this->formatPriorities);
} | php | public function negotiateResponseFormat(Request $req)
{
return $this->getFormatNegotiator()->getBestFormat($req->headers->get('Accept'), $this->formatPriorities);
} | [
"public",
"function",
"negotiateResponseFormat",
"(",
"Request",
"$",
"req",
")",
"{",
"return",
"$",
"this",
"->",
"getFormatNegotiator",
"(",
")",
"->",
"getBestFormat",
"(",
"$",
"req",
"->",
"headers",
"->",
"get",
"(",
"'Accept'",
")",
",",
"$",
"this... | Return the response format type, derived from a Request's Accept header, and configured priorities.
@param Request $req
@return string | [
"Return",
"the",
"response",
"format",
"type",
"derived",
"from",
"a",
"Request",
"s",
"Accept",
"header",
"and",
"configured",
"priorities",
"."
] | 3f6270ecf31138ba2271a94a407c0d1a05542929 | https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Negotiator.php#L90-L93 | train |
AmericanCouncils/WebServicesBundle | Negotiator.php | Negotiator.negotiateResponseLanguage | public function negotiateResponseLanguage(Request $req)
{
return $this->getLanguageNegotiator()->getBest($req->headers->get('Accept-Language'), $this->langPriorities)->getValue();
} | php | public function negotiateResponseLanguage(Request $req)
{
return $this->getLanguageNegotiator()->getBest($req->headers->get('Accept-Language'), $this->langPriorities)->getValue();
} | [
"public",
"function",
"negotiateResponseLanguage",
"(",
"Request",
"$",
"req",
")",
"{",
"return",
"$",
"this",
"->",
"getLanguageNegotiator",
"(",
")",
"->",
"getBest",
"(",
"$",
"req",
"->",
"headers",
"->",
"get",
"(",
"'Accept-Language'",
")",
",",
"$",
... | Return preferred language, derived from Requests Accept-Language header, and configured priorities.
@param Request $req
@return string | [
"Return",
"preferred",
"language",
"derived",
"from",
"Requests",
"Accept",
"-",
"Language",
"header",
"and",
"configured",
"priorities",
"."
] | 3f6270ecf31138ba2271a94a407c0d1a05542929 | https://github.com/AmericanCouncils/WebServicesBundle/blob/3f6270ecf31138ba2271a94a407c0d1a05542929/Negotiator.php#L101-L104 | train |
LCPHP/php-wechat-sdk | src/Wechat.php | Wechat.http_get | public function http_get($url, $data_type='json') {
$cl = curl_init();
if(stripos($url, 'https://') !== FALSE) {
curl_setopt($cl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($cl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($cl, CURLOPT_SSLVERSION, 1);
... | php | public function http_get($url, $data_type='json') {
$cl = curl_init();
if(stripos($url, 'https://') !== FALSE) {
curl_setopt($cl, CURLOPT_SSL_VERIFYPEER, FALSE);
curl_setopt($cl, CURLOPT_SSL_VERIFYHOST, FALSE);
curl_setopt($cl, CURLOPT_SSLVERSION, 1);
... | [
"public",
"function",
"http_get",
"(",
"$",
"url",
",",
"$",
"data_type",
"=",
"'json'",
")",
"{",
"$",
"cl",
"=",
"curl_init",
"(",
")",
";",
"if",
"(",
"stripos",
"(",
"$",
"url",
",",
"'https://'",
")",
"!==",
"FALSE",
")",
"{",
"curl_setopt",
"... | http curl get
@param string $url
@param string $data_type
@return mixed|boolean | [
"http",
"curl",
"get"
] | 0dc164fc462d5fdae7d9c5c35f96c1b227e42db3 | https://github.com/LCPHP/php-wechat-sdk/blob/0dc164fc462d5fdae7d9c5c35f96c1b227e42db3/src/Wechat.php#L345-L366 | train |
Stinger-Soft/PlatformBundle | Controller/BaseController.php | BaseController.hasRole | protected function hasRole($role) {
if(!$this->container->has('security.authorization_checker')) {
throw new \LogicException('The SecurityBundle is not registered in your application.');
}
return false !== $this->get('security.authorization_checker')->isGranted($role);
} | php | protected function hasRole($role) {
if(!$this->container->has('security.authorization_checker')) {
throw new \LogicException('The SecurityBundle is not registered in your application.');
}
return false !== $this->get('security.authorization_checker')->isGranted($role);
} | [
"protected",
"function",
"hasRole",
"(",
"$",
"role",
")",
"{",
"if",
"(",
"!",
"$",
"this",
"->",
"container",
"->",
"has",
"(",
"'security.authorization_checker'",
")",
")",
"{",
"throw",
"new",
"\\",
"LogicException",
"(",
"'The SecurityBundle is not register... | Checks whether the current user has the specified role or not
@param string $role
@throws \LogicException
@return boolean | [
"Checks",
"whether",
"the",
"current",
"user",
"has",
"the",
"specified",
"role",
"or",
"not"
] | 922b9405e5ddc474f288b6be84af2de9a335ac28 | https://github.com/Stinger-Soft/PlatformBundle/blob/922b9405e5ddc474f288b6be84af2de9a335ac28/Controller/BaseController.php#L120-L125 | train |
Eden-PHP/Block | Field.php | Field.button | public function button($value, $name = null)
{
Argument::i()
->test(1, 'string')
->test(2, 'string', 'null')
->test(3, 'bool');
$field = Button::i()->setValue($value);
if(!is_null($name)) {
$field->setName($name);
}
return $field;
} | php | public function button($value, $name = null)
{
Argument::i()
->test(1, 'string')
->test(2, 'string', 'null')
->test(3, 'bool');
$field = Button::i()->setValue($value);
if(!is_null($name)) {
$field->setName($name);
}
return $field;
} | [
"public",
"function",
"button",
"(",
"$",
"value",
",",
"$",
"name",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
")",
"->",
"test",
"(",
"2",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
... | Returns a ui button field
@param string
@param string|null
@param bool
@return Eden\Block\Field\Button | [
"Returns",
"a",
"ui",
"button",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L51-L65 | train |
Eden-PHP/Block | Field.php | Field.checkbox | public function checkbox($name = null, $value = null, $items = array())
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'array', 'null')
->test(3, 'string', 'array');
$field = Checkbox::i()->setItems($items);
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($v... | php | public function checkbox($name = null, $value = null, $items = array())
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'array', 'null')
->test(3, 'string', 'array');
$field = Checkbox::i()->setItems($items);
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($v... | [
"public",
"function",
"checkbox",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
",",
"$",
"items",
"=",
"array",
"(",
")",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
... | Returns a checkbox field or fieldset
@param string|null
@param array
@param scalar|null
@return Eden\Block\Field\Checkbox | [
"Returns",
"a",
"checkbox",
"field",
"or",
"fieldset"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L75-L93 | train |
Eden-PHP/Block | Field.php | Field.password | public function password($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Password::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | php | public function password($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Password::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | [
"public",
"function",
"password",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",... | Returns a password field
@param string|null
@param scalar|null
@return Eden\Block\Field\Text | [
"Returns",
"a",
"password",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L102-L119 | train |
Eden-PHP/Block | Field.php | Field.radio | public function radio($name = null, $value = null, array $items = array())
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Radio::i($name)->setItems($items);
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value... | php | public function radio($name = null, $value = null, array $items = array())
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Radio::i($name)->setItems($items);
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value... | [
"public",
"function",
"radio",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
",",
"array",
"$",
"items",
"=",
"array",
"(",
")",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
... | Returns a radio fieldset
@param string|null
@param array
@param scalar|null
@return Eden\Block\Field\Radio | [
"Returns",
"a",
"radio",
"fieldset"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L129-L146 | train |
Eden-PHP/Block | Field.php | Field.select | public function select($name = null, $value = null, array $items = array())
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Select::i()->setItems($items);
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
... | php | public function select($name = null, $value = null, array $items = array())
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Select::i()->setItems($items);
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
... | [
"public",
"function",
"select",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
",",
"array",
"$",
"items",
"=",
"array",
"(",
")",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
... | Returns a select field
@param string|null
@param array
@param scalar|null
@return Eden\Block\Field\Select | [
"Returns",
"a",
"select",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L156-L173 | train |
Eden-PHP/Block | Field.php | Field.submit | public function submit($value, $name = null, $image = null)
{
Argument::i()
->test(1, 'string')
->test(2, 'string', 'null');
$field = Submit::i()->setValue($value);
if(!is_null($name)) {
$field->setName($name);
}
if($image) {
$field->setImage($image);
}
return $field;
} | php | public function submit($value, $name = null, $image = null)
{
Argument::i()
->test(1, 'string')
->test(2, 'string', 'null');
$field = Submit::i()->setValue($value);
if(!is_null($name)) {
$field->setName($name);
}
if($image) {
$field->setImage($image);
}
return $field;
} | [
"public",
"function",
"submit",
"(",
"$",
"value",
",",
"$",
"name",
"=",
"null",
",",
"$",
"image",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
")",
"->",
"test",
"(",
"2",
",",
"'string'",
... | Returns a submit field
@param string
@param scalar|null
@param string|null
@return Eden\Block\Field\Submit | [
"Returns",
"a",
"submit",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L183-L200 | train |
Eden-PHP/Block | Field.php | Field.mask | public function mask($pattern, $placeholder = null, $name = null, $value = null)
{
Argument::i()
->test(1, 'string')
->test(2, 'string', 'null')
->test(3, 'string', 'null')
->test(4, 'scalar', 'null');
$field = Mask::i()->setPattern($pattern);
if(!is_null($name)) {
$field->setName($name);
... | php | public function mask($pattern, $placeholder = null, $name = null, $value = null)
{
Argument::i()
->test(1, 'string')
->test(2, 'string', 'null')
->test(3, 'string', 'null')
->test(4, 'scalar', 'null');
$field = Mask::i()->setPattern($pattern);
if(!is_null($name)) {
$field->setName($name);
... | [
"public",
"function",
"mask",
"(",
"$",
"pattern",
",",
"$",
"placeholder",
"=",
"null",
",",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
")",
"->",... | Returns an input mask
@param string
@param string|null
@param string|null
@param scalar|null
@return Eden\Block\Field\Mask | [
"Returns",
"an",
"input",
"mask"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L211-L234 | train |
Eden-PHP/Block | Field.php | Field.text | public function text($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Text::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | php | public function text($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Text::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | [
"public",
"function",
"text",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",
"... | Returns a text field
@param string|null
@param scalar|null
@return Eden\Block\Field\Text | [
"Returns",
"a",
"text",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L243-L260 | train |
Eden-PHP/Block | Field.php | Field.textarea | public function textarea($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Textarea::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | php | public function textarea($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Textarea::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | [
"public",
"function",
"textarea",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",... | Returns a textarea field
@param string|null
@param scalar|null
@return Eden\Block\Field\Textarea | [
"Returns",
"a",
"textarea",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L269-L286 | train |
Eden-PHP/Block | Field.php | Field.color | public function color($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'string', 'null');
$field = Color::i($name);
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | php | public function color($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'string', 'null');
$field = Color::i($name);
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | [
"public",
"function",
"color",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'string'",
",",
... | Returns a color field
@param string|null
@param scalar|null
@return Eden\Block\Field\Color | [
"Returns",
"a",
"color",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L321-L338 | train |
Eden-PHP/Block | Field.php | Field.combobox | public function combobox($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Combobox::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | php | public function combobox($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Combobox::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | [
"public",
"function",
"combobox",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",... | Returns a combobox field
@param string|null
@param scalar|null
@return Eden\Block\Field\Combobox | [
"Returns",
"a",
"combobox",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L347-L364 | train |
Eden-PHP/Block | Field.php | Field.datetime | public function datetime($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Datetime::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | php | public function datetime($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Datetime::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | [
"public",
"function",
"datetime",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",... | Returns a datetime field
@param string|null
@param scalar|null
@return Eden\Block\Field\Datetime | [
"Returns",
"a",
"datetime",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L401-L418 | train |
Eden-PHP/Block | Field.php | Field.file | public function file($name = null, $multiple = false, array $accept = array())
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'bool');
$field = File::i();
if(!is_null($name)) {
$field->setName($name);
}
if($multiple) {
$field->setAttributes('multiple', 'multiple');
}
if(!... | php | public function file($name = null, $multiple = false, array $accept = array())
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'bool');
$field = File::i();
if(!is_null($name)) {
$field->setName($name);
}
if($multiple) {
$field->setAttributes('multiple', 'multiple');
}
if(!... | [
"public",
"function",
"file",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"multiple",
"=",
"false",
",",
"array",
"$",
"accept",
"=",
"array",
"(",
")",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'... | Returns a file field
@param string|null
@param bool
@param array
@return Eden\Block\Field\File | [
"Returns",
"a",
"file",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L428-L449 | train |
Eden-PHP/Block | Field.php | Field.image | public function image($name = null, $multiple = false)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'bool');
$accept = array('image/gif','image/jpg','image/jpeg','image/png');
return $this->file($name, $multiple, $accept);
} | php | public function image($name = null, $multiple = false)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'bool');
$accept = array('image/gif','image/jpg','image/jpeg','image/png');
return $this->file($name, $multiple, $accept);
} | [
"public",
"function",
"image",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"multiple",
"=",
"false",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'bool'",
")",
... | Returns an image upload field
@param string|null
@param bool
@return Eden\Block\Field\File | [
"Returns",
"an",
"image",
"upload",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L458-L467 | train |
Eden-PHP/Block | Field.php | Field.markdown | public function markdown($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Markdown::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | php | public function markdown($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Markdown::i();
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | [
"public",
"function",
"markdown",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",... | Returns a Markdown field
@param string|null
@param scalar|null
@return Eden\Block\Field\Markdown | [
"Returns",
"a",
"Markdown",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L476-L493 | train |
Eden-PHP/Block | Field.php | Field.slider | public function slider($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Text::i()->setType('range');
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | php | public function slider($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Text::i()->setType('range');
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) {
$field->setValue($value);
}
return $field;
} | [
"public",
"function",
"slider",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",
... | Returns a slider field
@param string|null
@param scalar|null
@return Eden\Block\Field\Text | [
"Returns",
"a",
"slider",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L502-L519 | train |
Eden-PHP/Block | Field.php | Field.time | public function time($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Datetime::i()
->setOptions('pickDate', false)
->setOptions('format', 'HH:mm PP');
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) ... | php | public function time($name = null, $value = null)
{
Argument::i()
->test(1, 'string', 'null')
->test(2, 'scalar', 'null');
$field = Datetime::i()
->setOptions('pickDate', false)
->setOptions('format', 'HH:mm PP');
if(!is_null($name)) {
$field->setName($name);
}
if(!is_null($value)) ... | [
"public",
"function",
"time",
"(",
"$",
"name",
"=",
"null",
",",
"$",
"value",
"=",
"null",
")",
"{",
"Argument",
"::",
"i",
"(",
")",
"->",
"test",
"(",
"1",
",",
"'string'",
",",
"'null'",
")",
"->",
"test",
"(",
"2",
",",
"'scalar'",
",",
"... | Returns a time field
@param string|null
@param scalar|null
@return Eden\Block\Field\Datetime | [
"Returns",
"a",
"time",
"field"
] | 681b9f01dd118612d0fced84d2f702167b52109b | https://github.com/Eden-PHP/Block/blob/681b9f01dd118612d0fced84d2f702167b52109b/Field.php#L554-L573 | train |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.