id int32 0 241k | repo stringlengths 6 63 | path stringlengths 5 140 | func_name stringlengths 3 151 | original_string stringlengths 84 13k | language stringclasses 1
value | code stringlengths 84 13k | code_tokens list | docstring stringlengths 3 47.2k | docstring_tokens list | sha stringlengths 40 40 | url stringlengths 91 247 |
|---|---|---|---|---|---|---|---|---|---|---|---|
231,600 | sjdaws/vocal | src/Sjdaws/Vocal/Vocal.php | Vocal.setRelationship | private function setRelationship(Vocal $record, $relationship, $class, $index)
{
// If we have an index we're dealing with a many relationship
if ($index !== null)
{
$collection = ($this->{$relationship}) ? $this->{$relationship} : new Collection;
$collection->put($in... | php | private function setRelationship(Vocal $record, $relationship, $class, $index)
{
// If we have an index we're dealing with a many relationship
if ($index !== null)
{
$collection = ($this->{$relationship}) ? $this->{$relationship} : new Collection;
$collection->put($in... | [
"private",
"function",
"setRelationship",
"(",
"Vocal",
"$",
"record",
",",
"$",
"relationship",
",",
"$",
"class",
",",
"$",
"index",
")",
"{",
"// If we have an index we're dealing with a many relationship",
"if",
"(",
"$",
"index",
"!==",
"null",
")",
"{",
"$... | Attach two records together via relationship
@param Vocal $record
@param string $relationship
@param string $class
@param integer|string|null $index
@return \Illuminate\Database\Eloquent\Model | [
"Attach",
"two",
"records",
"together",
"via",
"relationship"
] | ea9bc7b8bbf6c8140fe1aa285716a559f6f6cf7f | https://github.com/sjdaws/vocal/blob/ea9bc7b8bbf6c8140fe1aa285716a559f6f6cf7f/src/Sjdaws/Vocal/Vocal.php#L1045-L1066 |
231,601 | sjdaws/vocal | src/Sjdaws/Vocal/Vocal.php | Vocal.setRuleset | private function setRuleset(array $rules = [])
{
// Passed rules rule, but we will use model rules if nothing has been passed
$this->rules = $this->ruleset = $this->selectRules($rules);
// Expand out rules
foreach ($this->rules as $field => &$rule)
{
// Change pi... | php | private function setRuleset(array $rules = [])
{
// Passed rules rule, but we will use model rules if nothing has been passed
$this->rules = $this->ruleset = $this->selectRules($rules);
// Expand out rules
foreach ($this->rules as $field => &$rule)
{
// Change pi... | [
"private",
"function",
"setRuleset",
"(",
"array",
"$",
"rules",
"=",
"[",
"]",
")",
"{",
"// Passed rules rule, but we will use model rules if nothing has been passed",
"$",
"this",
"->",
"rules",
"=",
"$",
"this",
"->",
"ruleset",
"=",
"$",
"this",
"->",
"select... | Set relationship rules
@param array $rules
@return null | [
"Set",
"relationship",
"rules"
] | ea9bc7b8bbf6c8140fe1aa285716a559f6f6cf7f | https://github.com/sjdaws/vocal/blob/ea9bc7b8bbf6c8140fe1aa285716a559f6f6cf7f/src/Sjdaws/Vocal/Vocal.php#L1074-L1086 |
231,602 | sjdaws/vocal | src/Sjdaws/Vocal/Vocal.php | Vocal.timestamp | public function timestamp($value = null)
{
// Use now if no time was passed
if ( ! $value) $value = $this->freshTimestamp();
return $this->fromDateTime($value);
} | php | public function timestamp($value = null)
{
// Use now if no time was passed
if ( ! $value) $value = $this->freshTimestamp();
return $this->fromDateTime($value);
} | [
"public",
"function",
"timestamp",
"(",
"$",
"value",
"=",
"null",
")",
"{",
"// Use now if no time was passed",
"if",
"(",
"!",
"$",
"value",
")",
"$",
"value",
"=",
"$",
"this",
"->",
"freshTimestamp",
"(",
")",
";",
"return",
"$",
"this",
"->",
"fromD... | Generate a database compatible timestamp using now as default
@param mixed $value
@return string | [
"Generate",
"a",
"database",
"compatible",
"timestamp",
"using",
"now",
"as",
"default"
] | ea9bc7b8bbf6c8140fe1aa285716a559f6f6cf7f | https://github.com/sjdaws/vocal/blob/ea9bc7b8bbf6c8140fe1aa285716a559f6f6cf7f/src/Sjdaws/Vocal/Vocal.php#L1094-L1100 |
231,603 | sjdaws/vocal | src/Sjdaws/Vocal/Vocal.php | Vocal.usesSoftDeletes | private function usesSoftDeletes()
{
return (
(isset($this->forceDeleting) && ! $this->forceDeleting) ||
(isset($this->softDelete) && ! $this->softDelete)
);
} | php | private function usesSoftDeletes()
{
return (
(isset($this->forceDeleting) && ! $this->forceDeleting) ||
(isset($this->softDelete) && ! $this->softDelete)
);
} | [
"private",
"function",
"usesSoftDeletes",
"(",
")",
"{",
"return",
"(",
"(",
"isset",
"(",
"$",
"this",
"->",
"forceDeleting",
")",
"&&",
"!",
"$",
"this",
"->",
"forceDeleting",
")",
"||",
"(",
"isset",
"(",
"$",
"this",
"->",
"softDelete",
")",
"&&",... | Determine if a model is using soft deletes
@return bool | [
"Determine",
"if",
"a",
"model",
"is",
"using",
"soft",
"deletes"
] | ea9bc7b8bbf6c8140fe1aa285716a559f6f6cf7f | https://github.com/sjdaws/vocal/blob/ea9bc7b8bbf6c8140fe1aa285716a559f6f6cf7f/src/Sjdaws/Vocal/Vocal.php#L1107-L1113 |
231,604 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.init | public function init($path = null)
{
$path = is_null($path) ? $this->environment->path : $path;
// Check if clone already exists at this path. If so we can safely skip.
if (file_exists($path)) {
$wrapper = new GitWrapper();
$wrapper->setTimeout(3600);
tr... | php | public function init($path = null)
{
$path = is_null($path) ? $this->environment->path : $path;
// Check if clone already exists at this path. If so we can safely skip.
if (file_exists($path)) {
$wrapper = new GitWrapper();
$wrapper->setTimeout(3600);
tr... | [
"public",
"function",
"init",
"(",
"$",
"path",
"=",
"null",
")",
"{",
"$",
"path",
"=",
"is_null",
"(",
"$",
"path",
")",
"?",
"$",
"this",
"->",
"environment",
"->",
"path",
":",
"$",
"path",
";",
"// Check if clone already exists at this path. If so we ca... | Clones the source code for this project. | [
"Clones",
"the",
"source",
"code",
"for",
"this",
"project",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L54-L120 |
231,605 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.writeConfig | public function writeConfig()
{
// Create the app/environment folder
$fs = new FileSystem();
try {
$fs->mkdir($this->getDockerComposePath());
} catch (IOExceptionInterface $e) {
return false;
}
// Create the environments docker-compose file.
... | php | public function writeConfig()
{
// Create the app/environment folder
$fs = new FileSystem();
try {
$fs->mkdir($this->getDockerComposePath());
} catch (IOExceptionInterface $e) {
return false;
}
// Create the environments docker-compose file.
... | [
"public",
"function",
"writeConfig",
"(",
")",
"{",
"// Create the app/environment folder",
"$",
"fs",
"=",
"new",
"FileSystem",
"(",
")",
";",
"try",
"{",
"$",
"fs",
"->",
"mkdir",
"(",
"$",
"this",
"->",
"getDockerComposePath",
"(",
")",
")",
";",
"}",
... | Write the docker-compose.yml file.
@return bool | [
"Write",
"the",
"docker",
"-",
"compose",
".",
"yml",
"file",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L127-L148 |
231,606 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.deploy | public function deploy($version)
{
// Checkout the branch
$wrapper = new GitWrapper();
$wrapper->streamOutput();
$git = new GitWorkingCopy($wrapper, $this->getSourcePath());
$git->checkout($version);
$git->pull();
// Reload config so any changes get picked u... | php | public function deploy($version)
{
// Checkout the branch
$wrapper = new GitWrapper();
$wrapper->streamOutput();
$git = new GitWorkingCopy($wrapper, $this->getSourcePath());
$git->checkout($version);
$git->pull();
// Reload config so any changes get picked u... | [
"public",
"function",
"deploy",
"(",
"$",
"version",
")",
"{",
"// Checkout the branch",
"$",
"wrapper",
"=",
"new",
"GitWrapper",
"(",
")",
";",
"$",
"wrapper",
"->",
"streamOutput",
"(",
")",
";",
"$",
"git",
"=",
"new",
"GitWorkingCopy",
"(",
"$",
"wr... | Deploy a version to an environment.
@param $version
A git branch, tag, or sha. | [
"Deploy",
"a",
"version",
"to",
"an",
"environment",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L224-L256 |
231,607 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.getDockerComposePath | public function getDockerComposePath()
{
return getenv('HOME').'/.terra/environments/'.$this->app->name.'/'.$this->app->name.'-'.$this->environment->name;
} | php | public function getDockerComposePath()
{
return getenv('HOME').'/.terra/environments/'.$this->app->name.'/'.$this->app->name.'-'.$this->environment->name;
} | [
"public",
"function",
"getDockerComposePath",
"(",
")",
"{",
"return",
"getenv",
"(",
"'HOME'",
")",
".",
"'/.terra/environments/'",
".",
"$",
"this",
"->",
"app",
"->",
"name",
".",
"'/'",
".",
"$",
"this",
"->",
"app",
"->",
"name",
".",
"'-'",
".",
... | Get's the path to this environments docker-compose file.
This is just a temporary solution. We should probably just make a generic
"environment_config_folder" that decides where to put any generated config
for any environment using any provider.
@return string | [
"Get",
"s",
"the",
"path",
"to",
"this",
"environments",
"docker",
"-",
"compose",
"file",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L267-L270 |
231,608 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.enable | public function enable()
{
if ($this->writeConfig() === false) {
return false;
}
$process = new Process('docker-compose up -d', $this->getDockerComposePath());
$process->setTimeout(null);
$process->run(function ($type, $buffer) {
if (Process::ERR === ... | php | public function enable()
{
if ($this->writeConfig() === false) {
return false;
}
$process = new Process('docker-compose up -d', $this->getDockerComposePath());
$process->setTimeout(null);
$process->run(function ($type, $buffer) {
if (Process::ERR === ... | [
"public",
"function",
"enable",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"writeConfig",
"(",
")",
"===",
"false",
")",
"{",
"return",
"false",
";",
"}",
"$",
"process",
"=",
"new",
"Process",
"(",
"'docker-compose up -d'",
",",
"$",
"this",
"->",
... | Turns on an environment.
In this class, we use `docker-compose up`.
@return bool | [
"Turns",
"on",
"an",
"environment",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L440-L458 |
231,609 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.destroy | public function destroy()
{
// Run docker-compose kill
echo "\n";
echo "Running 'docker-compose kill' in ".$this->getDockerComposePath()."\n";
$process = new Process('docker-compose kill', $this->getDockerComposePath());
$process->setTimeout(null);
$process->run(func... | php | public function destroy()
{
// Run docker-compose kill
echo "\n";
echo "Running 'docker-compose kill' in ".$this->getDockerComposePath()."\n";
$process = new Process('docker-compose kill', $this->getDockerComposePath());
$process->setTimeout(null);
$process->run(func... | [
"public",
"function",
"destroy",
"(",
")",
"{",
"// Run docker-compose kill",
"echo",
"\"\\n\"",
";",
"echo",
"\"Running 'docker-compose kill' in \"",
".",
"$",
"this",
"->",
"getDockerComposePath",
"(",
")",
".",
"\"\\n\"",
";",
"$",
"process",
"=",
"new",
"Proce... | Destroy an environment.
@return bool|string | [
"Destroy",
"an",
"environment",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L492-L521 |
231,610 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.scale | public function scale($scale)
{
$cmd = "docker-compose scale app=$scale && docker-compose up -d --no-deps load";
$process = new Process($cmd, $this->getDockerComposePath());
$process->setTimeout(null);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) ... | php | public function scale($scale)
{
$cmd = "docker-compose scale app=$scale && docker-compose up -d --no-deps load";
$process = new Process($cmd, $this->getDockerComposePath());
$process->setTimeout(null);
$process->run(function ($type, $buffer) {
if (Process::ERR === $type) ... | [
"public",
"function",
"scale",
"(",
"$",
"scale",
")",
"{",
"$",
"cmd",
"=",
"\"docker-compose scale app=$scale && docker-compose up -d --no-deps load\"",
";",
"$",
"process",
"=",
"new",
"Process",
"(",
"$",
"cmd",
",",
"$",
"this",
"->",
"getDockerComposePath",
... | Basically a wrapper for docker-compose scale. | [
"Basically",
"a",
"wrapper",
"for",
"docker",
"-",
"compose",
"scale",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L526-L543 |
231,611 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.getPort | public function getPort()
{
$process = new Process('docker-compose port load 80', $this->getDockerComposePath());
$process->run();
if (!$process->isSuccessful()) {
return false;
} else {
$output_array = explode(':', trim($process->getOutput()));
re... | php | public function getPort()
{
$process = new Process('docker-compose port load 80', $this->getDockerComposePath());
$process->run();
if (!$process->isSuccessful()) {
return false;
} else {
$output_array = explode(':', trim($process->getOutput()));
re... | [
"public",
"function",
"getPort",
"(",
")",
"{",
"$",
"process",
"=",
"new",
"Process",
"(",
"'docker-compose port load 80'",
",",
"$",
"this",
"->",
"getDockerComposePath",
"(",
")",
")",
";",
"$",
"process",
"->",
"run",
"(",
")",
";",
"if",
"(",
"!",
... | Get's the exposed port of the load balancer container.
@return bool|mixed | [
"Get",
"s",
"the",
"exposed",
"port",
"of",
"the",
"load",
"balancer",
"container",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L550-L560 |
231,612 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.getScale | public function getScale()
{
// Get current scale of app service
$process = new Process('docker-compose ps -q app', $this->getDockerComposePath());
$process->run();
if (!$process->isSuccessful()) {
return false;
}
$container_list = trim($process->getOutpu... | php | public function getScale()
{
// Get current scale of app service
$process = new Process('docker-compose ps -q app', $this->getDockerComposePath());
$process->run();
if (!$process->isSuccessful()) {
return false;
}
$container_list = trim($process->getOutpu... | [
"public",
"function",
"getScale",
"(",
")",
"{",
"// Get current scale of app service",
"$",
"process",
"=",
"new",
"Process",
"(",
"'docker-compose ps -q app'",
",",
"$",
"this",
"->",
"getDockerComposePath",
"(",
")",
")",
";",
"$",
"process",
"->",
"run",
"("... | Get the current scale of the app container.
@return bool | [
"Get",
"the",
"current",
"scale",
"of",
"the",
"app",
"container",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L603-L616 |
231,613 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.writeDrushAlias | public function writeDrushAlias()
{
$drush_alias_file_path = "{$_SERVER['HOME']}/.drush/terra.{$this->app->name}.aliases.drushrc.php";
$drush_alias_file = array();
$drush_alias_file[] = '<?php';
foreach ($this->app->environments as $environment_name => $environment) {
$... | php | public function writeDrushAlias()
{
$drush_alias_file_path = "{$_SERVER['HOME']}/.drush/terra.{$this->app->name}.aliases.drushrc.php";
$drush_alias_file = array();
$drush_alias_file[] = '<?php';
foreach ($this->app->environments as $environment_name => $environment) {
$... | [
"public",
"function",
"writeDrushAlias",
"(",
")",
"{",
"$",
"drush_alias_file_path",
"=",
"\"{$_SERVER['HOME']}/.drush/terra.{$this->app->name}.aliases.drushrc.php\"",
";",
"$",
"drush_alias_file",
"=",
"array",
"(",
")",
";",
"$",
"drush_alias_file",
"[",
"]",
"=",
"'... | Writes a local drush alias file. | [
"Writes",
"a",
"local",
"drush",
"alias",
"file",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L621-L650 |
231,614 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.runDrushCommand | public function runDrushCommand($drush_command, $alias = NULL) {
if ($alias == NULL) {
$alias = $this->getDrushAlias();
}
$cmd = "drush {$alias} $drush_command";
$process = new Process($cmd);
$process->setTimeout(null);
$process->run();
return trim(... | php | public function runDrushCommand($drush_command, $alias = NULL) {
if ($alias == NULL) {
$alias = $this->getDrushAlias();
}
$cmd = "drush {$alias} $drush_command";
$process = new Process($cmd);
$process->setTimeout(null);
$process->run();
return trim(... | [
"public",
"function",
"runDrushCommand",
"(",
"$",
"drush_command",
",",
"$",
"alias",
"=",
"NULL",
")",
"{",
"if",
"(",
"$",
"alias",
"==",
"NULL",
")",
"{",
"$",
"alias",
"=",
"$",
"this",
"->",
"getDrushAlias",
"(",
")",
";",
"}",
"$",
"cmd",
"=... | Runs a drush command for a specified alias. | [
"Runs",
"a",
"drush",
"command",
"for",
"a",
"specified",
"alias",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L669-L681 |
231,615 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.getTerraYmlContent | public function getTerraYmlContent()
{
$dumper = new Dumper();
// A mix of comments and YAML output.
$content = "# The relative path to your exposed web files.\n";
$input = array('document_root' => $this->config['document_root']);
$content .= $dumper->dump($input, 10);
... | php | public function getTerraYmlContent()
{
$dumper = new Dumper();
// A mix of comments and YAML output.
$content = "# The relative path to your exposed web files.\n";
$input = array('document_root' => $this->config['document_root']);
$content .= $dumper->dump($input, 10);
... | [
"public",
"function",
"getTerraYmlContent",
"(",
")",
"{",
"$",
"dumper",
"=",
"new",
"Dumper",
"(",
")",
";",
"// A mix of comments and YAML output.",
"$",
"content",
"=",
"\"# The relative path to your exposed web files.\\n\"",
";",
"$",
"input",
"=",
"array",
"(",
... | Generates the `.terra.yml` file for this environment.
@return string | [
"Generates",
"the",
".",
"terra",
".",
"yml",
"file",
"for",
"this",
"environment",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L688-L698 |
231,616 | terra-ops/terra-cli | src/terra/Factory/EnvironmentFactory.php | EnvironmentFactory.writeTerraYml | public function writeTerraYml()
{
// Create the environment's terra.yml file.
$fs = new Filesystem();
try {
$fs->dumpFile($this->getSourcePath().'/.terra.yml', $this->getTerraYmlContent());
return true;
} catch (IOExceptionInterface $e) {
return fa... | php | public function writeTerraYml()
{
// Create the environment's terra.yml file.
$fs = new Filesystem();
try {
$fs->dumpFile($this->getSourcePath().'/.terra.yml', $this->getTerraYmlContent());
return true;
} catch (IOExceptionInterface $e) {
return fa... | [
"public",
"function",
"writeTerraYml",
"(",
")",
"{",
"// Create the environment's terra.yml file.",
"$",
"fs",
"=",
"new",
"Filesystem",
"(",
")",
";",
"try",
"{",
"$",
"fs",
"->",
"dumpFile",
"(",
"$",
"this",
"->",
"getSourcePath",
"(",
")",
".",
"'/.terr... | Write the `.terra.yml` file.
@return bool | [
"Write",
"the",
".",
"terra",
".",
"yml",
"file",
"."
] | b176cca562534c1d65efbcef6c128f669a2ebed8 | https://github.com/terra-ops/terra-cli/blob/b176cca562534c1d65efbcef6c128f669a2ebed8/src/terra/Factory/EnvironmentFactory.php#L705-L715 |
231,617 | EcomDev/cache-key | src/NormalizerChain.php | NormalizerChain.normalize | public function normalize($key)
{
foreach ($this->chain as $normalizer) {
$key = $normalizer->normalize($key);
}
return $key;
} | php | public function normalize($key)
{
foreach ($this->chain as $normalizer) {
$key = $normalizer->normalize($key);
}
return $key;
} | [
"public",
"function",
"normalize",
"(",
"$",
"key",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"chain",
"as",
"$",
"normalizer",
")",
"{",
"$",
"key",
"=",
"$",
"normalizer",
"->",
"normalize",
"(",
"$",
"key",
")",
";",
"}",
"return",
"$",
"key"... | Normalizes key by calling each item in chain
@param string $key
@return string | [
"Normalizes",
"key",
"by",
"calling",
"each",
"item",
"in",
"chain"
] | 5f90f5a013100ec57d7f3a842f48222ba8a4ccf9 | https://github.com/EcomDev/cache-key/blob/5f90f5a013100ec57d7f3a842f48222ba8a4ccf9/src/NormalizerChain.php#L38-L45 |
231,618 | kuzzleio/sdk-php | src/Security/Document.php | Document.update | public function update(array $content, array $options = [])
{
$data = [
'_id' => $this->id,
'body' => $content
];
$response = $this->security->getKuzzle()->query(
$this->security->buildQueryArgs($this->updateActionName),
$data,
$op... | php | public function update(array $content, array $options = [])
{
$data = [
'_id' => $this->id,
'body' => $content
];
$response = $this->security->getKuzzle()->query(
$this->security->buildQueryArgs($this->updateActionName),
$data,
$op... | [
"public",
"function",
"update",
"(",
"array",
"$",
"content",
",",
"array",
"$",
"options",
"=",
"[",
"]",
")",
"{",
"$",
"data",
"=",
"[",
"'_id'",
"=>",
"$",
"this",
"->",
"id",
",",
"'body'",
"=>",
"$",
"content",
"]",
";",
"$",
"response",
"=... | Performs a partial content update on this object.
@param array $content New profile content
@param array $options Optional parameters
@return Document | [
"Performs",
"a",
"partial",
"content",
"update",
"on",
"this",
"object",
"."
] | b1e76cafaa9c7cc08d619c838c6208489e94565b | https://github.com/kuzzleio/sdk-php/blob/b1e76cafaa9c7cc08d619c838c6208489e94565b/src/Security/Document.php#L103-L119 |
231,619 | praxisnetau/silverware | src/Extensions/Model/ImageDefaultsExtension.php | ImageDefaultsExtension.getDefaultImageResizeWidth | public function getDefaultImageResizeWidth()
{
if ($width = $this->owner->ImageDefaultResizeWidth) {
return $width;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageResizeWidth');
}
... | php | public function getDefaultImageResizeWidth()
{
if ($width = $this->owner->ImageDefaultResizeWidth) {
return $width;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageResizeWidth');
}
... | [
"public",
"function",
"getDefaultImageResizeWidth",
"(",
")",
"{",
"if",
"(",
"$",
"width",
"=",
"$",
"this",
"->",
"owner",
"->",
"ImageDefaultResizeWidth",
")",
"{",
"return",
"$",
"width",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"hasExt... | Answers the default image resize width.
@return integer | [
"Answers",
"the",
"default",
"image",
"resize",
"width",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Model/ImageDefaultsExtension.php#L122-L131 |
231,620 | praxisnetau/silverware | src/Extensions/Model/ImageDefaultsExtension.php | ImageDefaultsExtension.getDefaultImageResizeHeight | public function getDefaultImageResizeHeight()
{
if ($height = $this->owner->ImageDefaultResizeHeight) {
return $height;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageResizeHeight');
... | php | public function getDefaultImageResizeHeight()
{
if ($height = $this->owner->ImageDefaultResizeHeight) {
return $height;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageResizeHeight');
... | [
"public",
"function",
"getDefaultImageResizeHeight",
"(",
")",
"{",
"if",
"(",
"$",
"height",
"=",
"$",
"this",
"->",
"owner",
"->",
"ImageDefaultResizeHeight",
")",
"{",
"return",
"$",
"height",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"ha... | Answers the default image resize height.
@return integer | [
"Answers",
"the",
"default",
"image",
"resize",
"height",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Model/ImageDefaultsExtension.php#L138-L147 |
231,621 | praxisnetau/silverware | src/Extensions/Model/ImageDefaultsExtension.php | ImageDefaultsExtension.getDefaultImageResizeMethod | public function getDefaultImageResizeMethod()
{
if ($method = $this->owner->ImageDefaultResizeMethod) {
return $method;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageResizeMethod');
... | php | public function getDefaultImageResizeMethod()
{
if ($method = $this->owner->ImageDefaultResizeMethod) {
return $method;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageResizeMethod');
... | [
"public",
"function",
"getDefaultImageResizeMethod",
"(",
")",
"{",
"if",
"(",
"$",
"method",
"=",
"$",
"this",
"->",
"owner",
"->",
"ImageDefaultResizeMethod",
")",
"{",
"return",
"$",
"method",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"ha... | Answers the default image resize method.
@return string | [
"Answers",
"the",
"default",
"image",
"resize",
"method",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Model/ImageDefaultsExtension.php#L154-L163 |
231,622 | praxisnetau/silverware | src/Extensions/Model/ImageDefaultsExtension.php | ImageDefaultsExtension.getDefaultImageAlignment | public function getDefaultImageAlignment()
{
if ($alignment = $this->owner->ImageDefaultAlignment) {
return $alignment;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageAlignment');
}
... | php | public function getDefaultImageAlignment()
{
if ($alignment = $this->owner->ImageDefaultAlignment) {
return $alignment;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageAlignment');
}
... | [
"public",
"function",
"getDefaultImageAlignment",
"(",
")",
"{",
"if",
"(",
"$",
"alignment",
"=",
"$",
"this",
"->",
"owner",
"->",
"ImageDefaultAlignment",
")",
"{",
"return",
"$",
"alignment",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"ha... | Answers the default image alignment.
@return string | [
"Answers",
"the",
"default",
"image",
"alignment",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Model/ImageDefaultsExtension.php#L170-L179 |
231,623 | praxisnetau/silverware | src/Extensions/Model/ImageDefaultsExtension.php | ImageDefaultsExtension.getDefaultImageLinked | public function getDefaultImageLinked()
{
if ($method = $this->owner->ImageDefaultLinked) {
return (boolean) $method;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageLinked');
}
} | php | public function getDefaultImageLinked()
{
if ($method = $this->owner->ImageDefaultLinked) {
return (boolean) $method;
}
if ($this->owner->hasExtension(MetaDataExtension::class)) {
return $this->owner->getFieldFromParent('DefaultImageLinked');
}
} | [
"public",
"function",
"getDefaultImageLinked",
"(",
")",
"{",
"if",
"(",
"$",
"method",
"=",
"$",
"this",
"->",
"owner",
"->",
"ImageDefaultLinked",
")",
"{",
"return",
"(",
"boolean",
")",
"$",
"method",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"owner"... | Answers the default image linked setting.
@return string | [
"Answers",
"the",
"default",
"image",
"linked",
"setting",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Model/ImageDefaultsExtension.php#L186-L195 |
231,624 | i-am-tom/schemer | src/Formatter/Assoc.php | Assoc.only | public function only(array $keys) : Assoc
{
return $this->pipe(
function (array $values) use ($keys) : array {
foreach ($values as $key => $_) {
if (!in_array($key, $keys)) {
unset($values[$key]);
}
}... | php | public function only(array $keys) : Assoc
{
return $this->pipe(
function (array $values) use ($keys) : array {
foreach ($values as $key => $_) {
if (!in_array($key, $keys)) {
unset($values[$key]);
}
}... | [
"public",
"function",
"only",
"(",
"array",
"$",
"keys",
")",
":",
"Assoc",
"{",
"return",
"$",
"this",
"->",
"pipe",
"(",
"function",
"(",
"array",
"$",
"values",
")",
"use",
"(",
"$",
"keys",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"values",... | The array will only contain keys from a given list.
@param array $keys
@return Schemer\Formatter\Assoc | [
"The",
"array",
"will",
"only",
"contain",
"keys",
"from",
"a",
"given",
"list",
"."
] | aa4ff458eae636ca61ada07d05859e27d3b4584d | https://github.com/i-am-tom/schemer/blob/aa4ff458eae636ca61ada07d05859e27d3b4584d/src/Formatter/Assoc.php#L37-L50 |
231,625 | i-am-tom/schemer | src/Formatter/Assoc.php | Assoc.rename | public function rename(string $from, string $to) : Assoc
{
return $this->pipe(
function (array $values) use ($from, $to) : array {
if (isset($values[$from])) {
$values[$to] = $values[$from];
unset($values[$from]);
}
... | php | public function rename(string $from, string $to) : Assoc
{
return $this->pipe(
function (array $values) use ($from, $to) : array {
if (isset($values[$from])) {
$values[$to] = $values[$from];
unset($values[$from]);
}
... | [
"public",
"function",
"rename",
"(",
"string",
"$",
"from",
",",
"string",
"$",
"to",
")",
":",
"Assoc",
"{",
"return",
"$",
"this",
"->",
"pipe",
"(",
"function",
"(",
"array",
"$",
"values",
")",
"use",
"(",
"$",
"from",
",",
"$",
"to",
")",
":... | The array will have the given key renamed.
@param string $from
@param string $to
@return Schemer\Formatter\Assoc | [
"The",
"array",
"will",
"have",
"the",
"given",
"key",
"renamed",
"."
] | aa4ff458eae636ca61ada07d05859e27d3b4584d | https://github.com/i-am-tom/schemer/blob/aa4ff458eae636ca61ada07d05859e27d3b4584d/src/Formatter/Assoc.php#L58-L70 |
231,626 | i-am-tom/schemer | src/Formatter/Assoc.php | Assoc.renameMany | public function renameMany(array $map) : Assoc
{
$pairs = array_map(function ($a, $b) {
return [$a, $b];
}, array_keys($map), array_values($map));
return array_reduce($pairs, function ($that, $pair) {
list ($from, $to) = $pair;
return $that->rename($from... | php | public function renameMany(array $map) : Assoc
{
$pairs = array_map(function ($a, $b) {
return [$a, $b];
}, array_keys($map), array_values($map));
return array_reduce($pairs, function ($that, $pair) {
list ($from, $to) = $pair;
return $that->rename($from... | [
"public",
"function",
"renameMany",
"(",
"array",
"$",
"map",
")",
":",
"Assoc",
"{",
"$",
"pairs",
"=",
"array_map",
"(",
"function",
"(",
"$",
"a",
",",
"$",
"b",
")",
"{",
"return",
"[",
"$",
"a",
",",
"$",
"b",
"]",
";",
"}",
",",
"array_ke... | The array will have the given keys renamed.
@param array $map [from => to] mappings.
@return Schemer\Formatter\Assoc | [
"The",
"array",
"will",
"have",
"the",
"given",
"keys",
"renamed",
"."
] | aa4ff458eae636ca61ada07d05859e27d3b4584d | https://github.com/i-am-tom/schemer/blob/aa4ff458eae636ca61ada07d05859e27d3b4584d/src/Formatter/Assoc.php#L77-L88 |
231,627 | i-am-tom/schemer | src/Formatter/Assoc.php | Assoc.strip | public function strip(array $keys) : Assoc
{
return $this->pipe(
function (array $values) use ($keys) : array {
foreach ($keys as $key) {
if (isset($values[$key])) {
unset($values[$key]);
}
}
... | php | public function strip(array $keys) : Assoc
{
return $this->pipe(
function (array $values) use ($keys) : array {
foreach ($keys as $key) {
if (isset($values[$key])) {
unset($values[$key]);
}
}
... | [
"public",
"function",
"strip",
"(",
"array",
"$",
"keys",
")",
":",
"Assoc",
"{",
"return",
"$",
"this",
"->",
"pipe",
"(",
"function",
"(",
"array",
"$",
"values",
")",
"use",
"(",
"$",
"keys",
")",
":",
"array",
"{",
"foreach",
"(",
"$",
"keys",
... | The array will not contain keys from a given list.
@param array $keys
@return Schemer\Formatter\Assoc | [
"The",
"array",
"will",
"not",
"contain",
"keys",
"from",
"a",
"given",
"list",
"."
] | aa4ff458eae636ca61ada07d05859e27d3b4584d | https://github.com/i-am-tom/schemer/blob/aa4ff458eae636ca61ada07d05859e27d3b4584d/src/Formatter/Assoc.php#L95-L108 |
231,628 | digiaonline/paytrail-php | src/Object/Payment.php | Payment.addProduct | public function addProduct(Product $product)
{
if (count($this->products) > self::MAX_PRODUCT_COUNT) {
throw new TooManyProducts(
sprintf(
'Paytrail can only handle up to %d different products. Please group products using "amount".',
self::... | php | public function addProduct(Product $product)
{
if (count($this->products) > self::MAX_PRODUCT_COUNT) {
throw new TooManyProducts(
sprintf(
'Paytrail can only handle up to %d different products. Please group products using "amount".',
self::... | [
"public",
"function",
"addProduct",
"(",
"Product",
"$",
"product",
")",
"{",
"if",
"(",
"count",
"(",
"$",
"this",
"->",
"products",
")",
">",
"self",
"::",
"MAX_PRODUCT_COUNT",
")",
"{",
"throw",
"new",
"TooManyProducts",
"(",
"sprintf",
"(",
"'Paytrail ... | Add a product.
@param \Paytrail\Object\Product $product The product to add.
@throws \Paytrail\Exception\TooManyProducts | [
"Add",
"a",
"product",
"."
] | a49c5e6742c42907fe329ff9b070fe7b21add74a | https://github.com/digiaonline/paytrail-php/blob/a49c5e6742c42907fe329ff9b070fe7b21add74a/src/Object/Payment.php#L165-L176 |
231,629 | digiaonline/paytrail-php | src/Object/Payment.php | Payment.toArray | public function toArray()
{
$array = array();
$array['orderNumber'] = $this->orderNumber;
if (isset($this->referenceNumber)) {
$array['referenceNumber'] = $this->referenceNumber;
}
if (isset($this->description)) {
$array['description'] = $this->descri... | php | public function toArray()
{
$array = array();
$array['orderNumber'] = $this->orderNumber;
if (isset($this->referenceNumber)) {
$array['referenceNumber'] = $this->referenceNumber;
}
if (isset($this->description)) {
$array['description'] = $this->descri... | [
"public",
"function",
"toArray",
"(",
")",
"{",
"$",
"array",
"=",
"array",
"(",
")",
";",
"$",
"array",
"[",
"'orderNumber'",
"]",
"=",
"$",
"this",
"->",
"orderNumber",
";",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"referenceNumber",
")",
")",
... | Convert the payment object to an array.
@return array | [
"Convert",
"the",
"payment",
"object",
"to",
"an",
"array",
"."
] | a49c5e6742c42907fe329ff9b070fe7b21add74a | https://github.com/digiaonline/paytrail-php/blob/a49c5e6742c42907fe329ff9b070fe7b21add74a/src/Object/Payment.php#L183-L213 |
231,630 | digiaonline/paytrail-php | src/Object/Payment.php | Payment.setLocale | public function setLocale($locale)
{
if ( ! in_array($locale, self::$supportedLocales)) {
throw new LocaleNotSupported(sprintf('Locale "%s" is not supported.', $locale));
}
$this->locale = $locale;
} | php | public function setLocale($locale)
{
if ( ! in_array($locale, self::$supportedLocales)) {
throw new LocaleNotSupported(sprintf('Locale "%s" is not supported.', $locale));
}
$this->locale = $locale;
} | [
"public",
"function",
"setLocale",
"(",
"$",
"locale",
")",
"{",
"if",
"(",
"!",
"in_array",
"(",
"$",
"locale",
",",
"self",
"::",
"$",
"supportedLocales",
")",
")",
"{",
"throw",
"new",
"LocaleNotSupported",
"(",
"sprintf",
"(",
"'Locale \"%s\" is not supp... | Sets the locale.
@param string $locale The locale to set.
@throws @throws \Paytrail\Exception\LocaleNotSupported | [
"Sets",
"the",
"locale",
"."
] | a49c5e6742c42907fe329ff9b070fe7b21add74a | https://github.com/digiaonline/paytrail-php/blob/a49c5e6742c42907fe329ff9b070fe7b21add74a/src/Object/Payment.php#L277-L283 |
231,631 | stratifyphp/router | src/Router.php | Router.process | public function process(ServerRequestInterface $request, DelegateInterface $delegate) : ResponseInterface
{
$matcher = $this->routerContainer->getMatcher();
$route = $matcher->match($request);
if ($route === false) {
// Call the next middleware
return $delegate->pro... | php | public function process(ServerRequestInterface $request, DelegateInterface $delegate) : ResponseInterface
{
$matcher = $this->routerContainer->getMatcher();
$route = $matcher->match($request);
if ($route === false) {
// Call the next middleware
return $delegate->pro... | [
"public",
"function",
"process",
"(",
"ServerRequestInterface",
"$",
"request",
",",
"DelegateInterface",
"$",
"delegate",
")",
":",
"ResponseInterface",
"{",
"$",
"matcher",
"=",
"$",
"this",
"->",
"routerContainer",
"->",
"getMatcher",
"(",
")",
";",
"$",
"r... | Route the incoming request to its handler, or call the next middleware if no route was found. | [
"Route",
"the",
"incoming",
"request",
"to",
"its",
"handler",
"or",
"call",
"the",
"next",
"middleware",
"if",
"no",
"route",
"was",
"found",
"."
] | 5026d54c7f7a18c83e942f42e8da001e6e2f180f | https://github.com/stratifyphp/router/blob/5026d54c7f7a18c83e942f42e8da001e6e2f180f/src/Router.php#L55-L71 |
231,632 | praxisnetau/silverware | src/Extensions/Lists/ListSourceExtension.php | ListSourceExtension.getListItems | public function getListItems()
{
// Create List:
$items = ArrayList::create();
// Obtain Items from Source:
if ($source = $this->owner->getSource()) {
// Obtain Source List:
$list = $source->getListItems();
... | php | public function getListItems()
{
// Create List:
$items = ArrayList::create();
// Obtain Items from Source:
if ($source = $this->owner->getSource()) {
// Obtain Source List:
$list = $source->getListItems();
... | [
"public",
"function",
"getListItems",
"(",
")",
"{",
"// Create List:",
"$",
"items",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"// Obtain Items from Source:",
"if",
"(",
"$",
"source",
"=",
"$",
"this",
"->",
"owner",
"->",
"getSource",
"(",
")",
"... | Answers a list of items.
@return ArrayList | [
"Answers",
"a",
"list",
"of",
"items",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Lists/ListSourceExtension.php#L225-L310 |
231,633 | praxisnetau/silverware | src/Extensions/Lists/ListSourceExtension.php | ListSourceExtension.setSource | public function setSource($source)
{
if ($source instanceof ListSource) {
$this->source = $source;
}
if ($source instanceof SS_List) {
$this->source = ListWrapper::create($source);
}
return $this->owner;
} | php | public function setSource($source)
{
if ($source instanceof ListSource) {
$this->source = $source;
}
if ($source instanceof SS_List) {
$this->source = ListWrapper::create($source);
}
return $this->owner;
} | [
"public",
"function",
"setSource",
"(",
"$",
"source",
")",
"{",
"if",
"(",
"$",
"source",
"instanceof",
"ListSource",
")",
"{",
"$",
"this",
"->",
"source",
"=",
"$",
"source",
";",
"}",
"if",
"(",
"$",
"source",
"instanceof",
"SS_List",
")",
"{",
"... | Defines the list source for the extended object.
@param ListSource|SS_List $source
@return DataObject | [
"Defines",
"the",
"list",
"source",
"for",
"the",
"extended",
"object",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Lists/ListSourceExtension.php#L329-L340 |
231,634 | praxisnetau/silverware | src/Extensions/Lists/ListSourceExtension.php | ListSourceExtension.getSource | public function getSource()
{
if ($this->source) {
return $this->source;
}
if ($this->owner->ListSourceID) {
return $this->owner->ListSource();
}
} | php | public function getSource()
{
if ($this->source) {
return $this->source;
}
if ($this->owner->ListSourceID) {
return $this->owner->ListSource();
}
} | [
"public",
"function",
"getSource",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"source",
")",
"{",
"return",
"$",
"this",
"->",
"source",
";",
"}",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"ListSourceID",
")",
"{",
"return",
"$",
"this",
"->",... | Answers the list source from the extended object.
@return ListSource | [
"Answers",
"the",
"list",
"source",
"from",
"the",
"extended",
"object",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Lists/ListSourceExtension.php#L347-L356 |
231,635 | praxisnetau/silverware | src/Extensions/Lists/ListSourceExtension.php | ListSourceExtension.sort | protected function sort(SS_List $list)
{
switch ($this->owner->SortItemsBy) {
// Random Sort Order:
case self::SORT_RANDOM:
if ($list instanceof DataList) {
return $list->sort(DB::get_conn()->random());
... | php | protected function sort(SS_List $list)
{
switch ($this->owner->SortItemsBy) {
// Random Sort Order:
case self::SORT_RANDOM:
if ($list instanceof DataList) {
return $list->sort(DB::get_conn()->random());
... | [
"protected",
"function",
"sort",
"(",
"SS_List",
"$",
"list",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"owner",
"->",
"SortItemsBy",
")",
"{",
"// Random Sort Order:",
"case",
"self",
"::",
"SORT_RANDOM",
":",
"if",
"(",
"$",
"list",
"instanceof",
"Data... | Sorts the given list of items.
@param SS_List $list
@return SS_List | [
"Sorts",
"the",
"given",
"list",
"of",
"items",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Lists/ListSourceExtension.php#L412-L437 |
231,636 | praxisnetau/silverware | src/Grid/ColumnSpan.php | ColumnSpan.getSpanSummary | public function getSpanSummary()
{
$summary = [];
$span = $this->dbObject('Span');
foreach ($span->getViewports() as $viewport) {
if ($value = $span->getField($viewport)) {
$summary[] = sprintf('%s: %s', $viewport, $value);
... | php | public function getSpanSummary()
{
$summary = [];
$span = $this->dbObject('Span');
foreach ($span->getViewports() as $viewport) {
if ($value = $span->getField($viewport)) {
$summary[] = sprintf('%s: %s', $viewport, $value);
... | [
"public",
"function",
"getSpanSummary",
"(",
")",
"{",
"$",
"summary",
"=",
"[",
"]",
";",
"$",
"span",
"=",
"$",
"this",
"->",
"dbObject",
"(",
"'Span'",
")",
";",
"foreach",
"(",
"$",
"span",
"->",
"getViewports",
"(",
")",
"as",
"$",
"viewport",
... | Answers a summary of the defined column spans.
@return string | [
"Answers",
"a",
"summary",
"of",
"the",
"defined",
"column",
"spans",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Grid/ColumnSpan.php#L270-L285 |
231,637 | praxisnetau/silverware | src/Grid/ColumnSpan.php | ColumnSpan.isActive | public function isActive()
{
if (($page = Director::get_current_page()) && $page instanceof Page) {
$ids = $this->Pages()->column('ID');
if (!$this->isInherited()) {
return in_array($page->ID, $ids);
}
ret... | php | public function isActive()
{
if (($page = Director::get_current_page()) && $page instanceof Page) {
$ids = $this->Pages()->column('ID');
if (!$this->isInherited()) {
return in_array($page->ID, $ids);
}
ret... | [
"public",
"function",
"isActive",
"(",
")",
"{",
"if",
"(",
"(",
"$",
"page",
"=",
"Director",
"::",
"get_current_page",
"(",
")",
")",
"&&",
"$",
"page",
"instanceof",
"Page",
")",
"{",
"$",
"ids",
"=",
"$",
"this",
"->",
"Pages",
"(",
")",
"->",
... | Answers true if the column span is active for the current page.
@return boolean | [
"Answers",
"true",
"if",
"the",
"column",
"span",
"is",
"active",
"for",
"the",
"current",
"page",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Grid/ColumnSpan.php#L302-L317 |
231,638 | Josantonius/PHP-Hook | src/Hook.php | Hook.addAction | public static function addAction($tag, $func, $priority = 8, $args = 0)
{
$that = self::getInstance(self::$id);
$that->callbacks[$tag][$priority][] = [
'function' => $func,
'arguments' => $args,
];
return true;
} | php | public static function addAction($tag, $func, $priority = 8, $args = 0)
{
$that = self::getInstance(self::$id);
$that->callbacks[$tag][$priority][] = [
'function' => $func,
'arguments' => $args,
];
return true;
} | [
"public",
"static",
"function",
"addAction",
"(",
"$",
"tag",
",",
"$",
"func",
",",
"$",
"priority",
"=",
"8",
",",
"$",
"args",
"=",
"0",
")",
"{",
"$",
"that",
"=",
"self",
"::",
"getInstance",
"(",
"self",
"::",
"$",
"id",
")",
";",
"$",
"t... | Attach custom function to action hook.
@since 1.0.3
@param string $tag → action hook name
@param callable $func → function to attach to action hook
@param int $priority → order in which the action is executed
@param int $args → number of arguments accepted
@return bool | [
"Attach",
"custom",
"function",
"to",
"action",
"hook",
"."
] | 12552ef239ea73f3463f2e213f0bdee47568905e | https://github.com/Josantonius/PHP-Hook/blob/12552ef239ea73f3463f2e213f0bdee47568905e/src/Hook.php#L105-L115 |
231,639 | Josantonius/PHP-Hook | src/Hook.php | Hook.doAction | public static function doAction($tag, $args = [], $remove = true)
{
$that = self::getInstance(self::$id);
self::$current = $tag;
$that->actions['count']++;
if (! array_key_exists($tag, $that->actions)) {
$that->actions[$tag] = 0;
}
$that->actions[$tag]... | php | public static function doAction($tag, $args = [], $remove = true)
{
$that = self::getInstance(self::$id);
self::$current = $tag;
$that->actions['count']++;
if (! array_key_exists($tag, $that->actions)) {
$that->actions[$tag] = 0;
}
$that->actions[$tag]... | [
"public",
"static",
"function",
"doAction",
"(",
"$",
"tag",
",",
"$",
"args",
"=",
"[",
"]",
",",
"$",
"remove",
"=",
"true",
")",
"{",
"$",
"that",
"=",
"self",
"::",
"getInstance",
"(",
"self",
"::",
"$",
"id",
")",
";",
"self",
"::",
"$",
"... | Run all hooks attached to the hook.
By default it will look for getInstance method to use singleton
pattern and create a single instance of the class. If it does not
exist it will create a new object.
@see setSingletonName() for change the method name.
@since 1.0.3
@param string $tag → action hook name
@param mi... | [
"Run",
"all",
"hooks",
"attached",
"to",
"the",
"hook",
"."
] | 12552ef239ea73f3463f2e213f0bdee47568905e | https://github.com/Josantonius/PHP-Hook/blob/12552ef239ea73f3463f2e213f0bdee47568905e/src/Hook.php#L152-L177 |
231,640 | Josantonius/PHP-Hook | src/Hook.php | Hook.setSingletonName | public static function setSingletonName($method)
{
$that = self::getInstance(self::$id);
$that->singleton = $method;
} | php | public static function setSingletonName($method)
{
$that = self::getInstance(self::$id);
$that->singleton = $method;
} | [
"public",
"static",
"function",
"setSingletonName",
"(",
"$",
"method",
")",
"{",
"$",
"that",
"=",
"self",
"::",
"getInstance",
"(",
"self",
"::",
"$",
"id",
")",
";",
"$",
"that",
"->",
"singleton",
"=",
"$",
"method",
";",
"}"
] | Set method name for use singleton pattern.
@since 1.0.0
@param string $method → singleton method name | [
"Set",
"method",
"name",
"for",
"use",
"singleton",
"pattern",
"."
] | 12552ef239ea73f3463f2e213f0bdee47568905e | https://github.com/Josantonius/PHP-Hook/blob/12552ef239ea73f3463f2e213f0bdee47568905e/src/Hook.php#L186-L191 |
231,641 | Josantonius/PHP-Hook | src/Hook.php | Hook.isAction | public static function isAction($tag)
{
$that = self::getInstance(self::$id);
return isset($that->callbacks[$tag]);
} | php | public static function isAction($tag)
{
$that = self::getInstance(self::$id);
return isset($that->callbacks[$tag]);
} | [
"public",
"static",
"function",
"isAction",
"(",
"$",
"tag",
")",
"{",
"$",
"that",
"=",
"self",
"::",
"getInstance",
"(",
"self",
"::",
"$",
"id",
")",
";",
"return",
"isset",
"(",
"$",
"that",
"->",
"callbacks",
"[",
"$",
"tag",
"]",
")",
";",
... | Check if there is a certain action hook.
@since 1.0.7
@param string $tag → action hook name
@return bool | [
"Check",
"if",
"there",
"is",
"a",
"certain",
"action",
"hook",
"."
] | 12552ef239ea73f3463f2e213f0bdee47568905e | https://github.com/Josantonius/PHP-Hook/blob/12552ef239ea73f3463f2e213f0bdee47568905e/src/Hook.php#L214-L219 |
231,642 | Josantonius/PHP-Hook | src/Hook.php | Hook.runAction | private function runAction($action, $args)
{
$function = $action['function'];
$argsNumber = $action['arguments'];
$class = (isset($function[0])) ? $function[0] : false;
$method = (isset($function[1])) ? $function[1] : false;
$args = $this->getArguments($argsNumber, $args);
... | php | private function runAction($action, $args)
{
$function = $action['function'];
$argsNumber = $action['arguments'];
$class = (isset($function[0])) ? $function[0] : false;
$method = (isset($function[1])) ? $function[1] : false;
$args = $this->getArguments($argsNumber, $args);
... | [
"private",
"function",
"runAction",
"(",
"$",
"action",
",",
"$",
"args",
")",
"{",
"$",
"function",
"=",
"$",
"action",
"[",
"'function'",
"]",
";",
"$",
"argsNumber",
"=",
"$",
"action",
"[",
"'arguments'",
"]",
";",
"$",
"class",
"=",
"(",
"isset"... | Run action hook.
@since 1.0.3
@param string $action → action hook
@param int $args → arguments
@return callable|false → returns the calling function | [
"Run",
"action",
"hook",
"."
] | 12552ef239ea73f3463f2e213f0bdee47568905e | https://github.com/Josantonius/PHP-Hook/blob/12552ef239ea73f3463f2e213f0bdee47568905e/src/Hook.php#L231-L252 |
231,643 | Josantonius/PHP-Hook | src/Hook.php | Hook.getActions | private function getActions($tag, $remove)
{
if (isset($this->callbacks[$tag])) {
$actions = $this->callbacks[$tag];
if ($remove) {
unset($this->callbacks[$tag]);
}
}
return (isset($actions)) ? $actions : [];
} | php | private function getActions($tag, $remove)
{
if (isset($this->callbacks[$tag])) {
$actions = $this->callbacks[$tag];
if ($remove) {
unset($this->callbacks[$tag]);
}
}
return (isset($actions)) ? $actions : [];
} | [
"private",
"function",
"getActions",
"(",
"$",
"tag",
",",
"$",
"remove",
")",
"{",
"if",
"(",
"isset",
"(",
"$",
"this",
"->",
"callbacks",
"[",
"$",
"tag",
"]",
")",
")",
"{",
"$",
"actions",
"=",
"$",
"this",
"->",
"callbacks",
"[",
"$",
"tag"... | Get actions for hook
@since 1.0.3
@param string $tag → action hook name
@param bool $remove → delete hook after executing actions
@return object|false → returns the calling function | [
"Get",
"actions",
"for",
"hook"
] | 12552ef239ea73f3463f2e213f0bdee47568905e | https://github.com/Josantonius/PHP-Hook/blob/12552ef239ea73f3463f2e213f0bdee47568905e/src/Hook.php#L264-L274 |
231,644 | Josantonius/PHP-Hook | src/Hook.php | Hook.getArguments | private function getArguments($argsNumber, $arguments)
{
if ($argsNumber == 1 && is_string($arguments)) {
return [$arguments];
} elseif ($argsNumber === count($arguments)) {
return $arguments;
}
for ($i = 0; $i < $argsNumber; $i++) {
if (array_key... | php | private function getArguments($argsNumber, $arguments)
{
if ($argsNumber == 1 && is_string($arguments)) {
return [$arguments];
} elseif ($argsNumber === count($arguments)) {
return $arguments;
}
for ($i = 0; $i < $argsNumber; $i++) {
if (array_key... | [
"private",
"function",
"getArguments",
"(",
"$",
"argsNumber",
",",
"$",
"arguments",
")",
"{",
"if",
"(",
"$",
"argsNumber",
"==",
"1",
"&&",
"is_string",
"(",
"$",
"arguments",
")",
")",
"{",
"return",
"[",
"$",
"arguments",
"]",
";",
"}",
"elseif",
... | Get arguments for action.
@since 1.0.3
@param int $argsNumber → arguments number
@param mixed $arguments → arguments
@return array → arguments | [
"Get",
"arguments",
"for",
"action",
"."
] | 12552ef239ea73f3463f2e213f0bdee47568905e | https://github.com/Josantonius/PHP-Hook/blob/12552ef239ea73f3463f2e213f0bdee47568905e/src/Hook.php#L286-L304 |
231,645 | praxisnetau/silverware | src/Grid/Section.php | Section.renderContainer | public function renderContainer($layout = null, $title = null)
{
return sprintf(
"<div class=\"%s\">\n%s</div>\n",
$this->getContainerClass(),
$this->renderChildren($layout, $title)
);
} | php | public function renderContainer($layout = null, $title = null)
{
return sprintf(
"<div class=\"%s\">\n%s</div>\n",
$this->getContainerClass(),
$this->renderChildren($layout, $title)
);
} | [
"public",
"function",
"renderContainer",
"(",
"$",
"layout",
"=",
"null",
",",
"$",
"title",
"=",
"null",
")",
"{",
"return",
"sprintf",
"(",
"\"<div class=\\\"%s\\\">\\n%s</div>\\n\"",
",",
"$",
"this",
"->",
"getContainerClass",
"(",
")",
",",
"$",
"this",
... | Renders the container for the HTML template.
@param string $layout Page layout passed from template.
@param string $title Page title passed from template.
@return string | [
"Renders",
"the",
"container",
"for",
"the",
"HTML",
"template",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Grid/Section.php#L268-L275 |
231,646 | praxisnetau/silverware | src/Grid/Section.php | Section.getPositionOptions | public function getPositionOptions()
{
return [
self::POSITION_FIXED_TOP => _t(__CLASS__ . '.FIXEDTOP', 'Fixed Top'),
self::POSITION_FIXED_BOTTOM => _t(__CLASS__ . '.FIXEDBOTTOM', 'Fixed Bottom'),
self::POSITION_STICKY_TOP => _t(__CLASS__ . '.STICKYTOP', 'Sticky Top'... | php | public function getPositionOptions()
{
return [
self::POSITION_FIXED_TOP => _t(__CLASS__ . '.FIXEDTOP', 'Fixed Top'),
self::POSITION_FIXED_BOTTOM => _t(__CLASS__ . '.FIXEDBOTTOM', 'Fixed Bottom'),
self::POSITION_STICKY_TOP => _t(__CLASS__ . '.STICKYTOP', 'Sticky Top'... | [
"public",
"function",
"getPositionOptions",
"(",
")",
"{",
"return",
"[",
"self",
"::",
"POSITION_FIXED_TOP",
"=>",
"_t",
"(",
"__CLASS__",
".",
"'.FIXEDTOP'",
",",
"'Fixed Top'",
")",
",",
"self",
"::",
"POSITION_FIXED_BOTTOM",
"=>",
"_t",
"(",
"__CLASS__",
"... | Answers an array of options for the position field.
@return array | [
"Answers",
"an",
"array",
"of",
"options",
"for",
"the",
"position",
"field",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Grid/Section.php#L282-L289 |
231,647 | i-am-tom/schemer | src/Validator/Boolean.php | Boolean.true | public function true(string $error = 'not true') : Boolean
{
return $this->pipe(
self::predicate(
function (bool $bool) : bool {
return !!$bool;
},
$error
)
);
} | php | public function true(string $error = 'not true') : Boolean
{
return $this->pipe(
self::predicate(
function (bool $bool) : bool {
return !!$bool;
},
$error
)
);
} | [
"public",
"function",
"true",
"(",
"string",
"$",
"error",
"=",
"'not true'",
")",
":",
"Boolean",
"{",
"return",
"$",
"this",
"->",
"pipe",
"(",
"self",
"::",
"predicate",
"(",
"function",
"(",
"bool",
"$",
"bool",
")",
":",
"bool",
"{",
"return",
"... | The value must be true.
@param string $error
@return Schemer\Validator\Boolean | [
"The",
"value",
"must",
"be",
"true",
"."
] | aa4ff458eae636ca61ada07d05859e27d3b4584d | https://github.com/i-am-tom/schemer/blob/aa4ff458eae636ca61ada07d05859e27d3b4584d/src/Validator/Boolean.php#L26-L36 |
231,648 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.find | public function find($id)
{
$response = $this->ontraport->get(
$this->getSingularNamespace(), $this->toArray(compact('id'))
);
return $this->ontraport->item($this, $response);
} | php | public function find($id)
{
$response = $this->ontraport->get(
$this->getSingularNamespace(), $this->toArray(compact('id'))
);
return $this->ontraport->item($this, $response);
} | [
"public",
"function",
"find",
"(",
"$",
"id",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"ontraport",
"->",
"get",
"(",
"$",
"this",
"->",
"getSingularNamespace",
"(",
")",
",",
"$",
"this",
"->",
"toArray",
"(",
"compact",
"(",
"'id'",
")",
... | Find an Ontraport resource.
@param int $id
@return \Wsio\Ontraport\Fluent | [
"Find",
"an",
"Ontraport",
"resource",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L96-L103 |
231,649 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.get | public function get(array $parameters = array())
{
$response = $this->ontraport->get(
$this->getNamespace(), $this->toArray($parameters)
);
return $this->ontraport->collection($this, $response);
} | php | public function get(array $parameters = array())
{
$response = $this->ontraport->get(
$this->getNamespace(), $this->toArray($parameters)
);
return $this->ontraport->collection($this, $response);
} | [
"public",
"function",
"get",
"(",
"array",
"$",
"parameters",
"=",
"array",
"(",
")",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"ontraport",
"->",
"get",
"(",
"$",
"this",
"->",
"getNamespace",
"(",
")",
",",
"$",
"this",
"->",
"toArray",
... | Retrieve a collection of Ontraport resources.
@param array $parameters
@return array | [
"Retrieve",
"a",
"collection",
"of",
"Ontraport",
"resources",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L123-L130 |
231,650 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.create | public function create(array $data)
{
$response = $this->ontraport->post(
$this->getNamespace(), $this->toArray($data)
);
return $this->ontraport->item($this, $response);
} | php | public function create(array $data)
{
$response = $this->ontraport->post(
$this->getNamespace(), $this->toArray($data)
);
return $this->ontraport->item($this, $response);
} | [
"public",
"function",
"create",
"(",
"array",
"$",
"data",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"ontraport",
"->",
"post",
"(",
"$",
"this",
"->",
"getNamespace",
"(",
")",
",",
"$",
"this",
"->",
"toArray",
"(",
"$",
"data",
")",
")"... | Create a new Ontraport resource.
@param array $data
@return \Wsio\Ontraport\Fluent | [
"Create",
"a",
"new",
"Ontraport",
"resource",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L138-L145 |
231,651 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.update | public function update($data, $override = null)
{
if (func_num_args() == 2) {
$override['id'] = $data;
$data = $override;
}
$response = $this->ontraport->put(
$this->getNamespace(), $this->toArray($data)
);
return $this->ontraport->item($... | php | public function update($data, $override = null)
{
if (func_num_args() == 2) {
$override['id'] = $data;
$data = $override;
}
$response = $this->ontraport->put(
$this->getNamespace(), $this->toArray($data)
);
return $this->ontraport->item($... | [
"public",
"function",
"update",
"(",
"$",
"data",
",",
"$",
"override",
"=",
"null",
")",
"{",
"if",
"(",
"func_num_args",
"(",
")",
"==",
"2",
")",
"{",
"$",
"override",
"[",
"'id'",
"]",
"=",
"$",
"data",
";",
"$",
"data",
"=",
"$",
"override",... | Update an Ontraport resource.
@param mixed $data
@param array|null $override
@return \Wsio\Ontraport\Fluent | [
"Update",
"an",
"Ontraport",
"resource",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L154-L166 |
231,652 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.delete | public function delete($id = null)
{
if (is_null($id) || is_array($id)) {
return $this->deleteMany($id);
}
$response = $this->ontraport->delete(
$this->getSingularNamespace(), $this->toArray(compact('id'))
);
return $this->ontraport->item($this, $res... | php | public function delete($id = null)
{
if (is_null($id) || is_array($id)) {
return $this->deleteMany($id);
}
$response = $this->ontraport->delete(
$this->getSingularNamespace(), $this->toArray(compact('id'))
);
return $this->ontraport->item($this, $res... | [
"public",
"function",
"delete",
"(",
"$",
"id",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"id",
")",
"||",
"is_array",
"(",
"$",
"id",
")",
")",
"{",
"return",
"$",
"this",
"->",
"deleteMany",
"(",
"$",
"id",
")",
";",
"}",
"$",
... | Delete one or more Ontraport resources.
@param mixed $id
@return \Wsio\Ontraport\Fluent | [
"Delete",
"one",
"or",
"more",
"Ontraport",
"resources",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L174-L185 |
231,653 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.deleteMany | public function deleteMany($ids = null)
{
if (is_null($ids)) {
$parameters = [
'performAll' => true
];
} else {
$parameters = [
'ids' => implode(',', (array) $ids),
];
}
$response = $this->ontraport->del... | php | public function deleteMany($ids = null)
{
if (is_null($ids)) {
$parameters = [
'performAll' => true
];
} else {
$parameters = [
'ids' => implode(',', (array) $ids),
];
}
$response = $this->ontraport->del... | [
"public",
"function",
"deleteMany",
"(",
"$",
"ids",
"=",
"null",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"ids",
")",
")",
"{",
"$",
"parameters",
"=",
"[",
"'performAll'",
"=>",
"true",
"]",
";",
"}",
"else",
"{",
"$",
"parameters",
"=",
"[",
... | Delete a list of Ontraport resources.
@param array $ids
@return \Wsio\Ontraport\Fluent | [
"Delete",
"a",
"list",
"of",
"Ontraport",
"resources",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L193-L215 |
231,654 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.info | public function info(array $data = [])
{
return $this->ontraport->get($this->getNamespace() . '/getInfo', $this->toArray($data));
} | php | public function info(array $data = [])
{
return $this->ontraport->get($this->getNamespace() . '/getInfo', $this->toArray($data));
} | [
"public",
"function",
"info",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"ontraport",
"->",
"get",
"(",
"$",
"this",
"->",
"getNamespace",
"(",
")",
".",
"'/getInfo'",
",",
"$",
"this",
"->",
"toArray",
"(",
"$... | Retrieve information about an Ontraport resource.
@return array | [
"Retrieve",
"information",
"about",
"an",
"Ontraport",
"resource",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L239-L242 |
231,655 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.meta | public function meta(array $data = [])
{
return $this->ontraport->get($this->getNamespace() . '/meta', $this->toArray($data));
} | php | public function meta(array $data = [])
{
return $this->ontraport->get($this->getNamespace() . '/meta', $this->toArray($data));
} | [
"public",
"function",
"meta",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"return",
"$",
"this",
"->",
"ontraport",
"->",
"get",
"(",
"$",
"this",
"->",
"getNamespace",
"(",
")",
".",
"'/meta'",
",",
"$",
"this",
"->",
"toArray",
"(",
"$",
... | Retrieve meta about an Ontraport resource.
@param array $data
@return array | [
"Retrieve",
"meta",
"about",
"an",
"Ontraport",
"resource",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L250-L253 |
231,656 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.orderBy | public function orderBy($field, $direction = 'asc')
{
$this->sort = $field;
$this->sortDirection = $direction;
return $this;
} | php | public function orderBy($field, $direction = 'asc')
{
$this->sort = $field;
$this->sortDirection = $direction;
return $this;
} | [
"public",
"function",
"orderBy",
"(",
"$",
"field",
",",
"$",
"direction",
"=",
"'asc'",
")",
"{",
"$",
"this",
"->",
"sort",
"=",
"$",
"field",
";",
"$",
"this",
"->",
"sortDirection",
"=",
"$",
"direction",
";",
"return",
"$",
"this",
";",
"}"
] | The field and direction to sort by.
@param string $field
@param string $direction
@return $this | [
"The",
"field",
"and",
"direction",
"to",
"sort",
"by",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L336-L342 |
231,657 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.where | public function where($field, $operator = null, $value = null, $boolean = 'AND')
{
// If the developer is adding multiple where statements together,
// we will enforce that by adding the approriate boolean.
if ($this->condition && count($this->condition) > 0) {
$this->condition[... | php | public function where($field, $operator = null, $value = null, $boolean = 'AND')
{
// If the developer is adding multiple where statements together,
// we will enforce that by adding the approriate boolean.
if ($this->condition && count($this->condition) > 0) {
$this->condition[... | [
"public",
"function",
"where",
"(",
"$",
"field",
",",
"$",
"operator",
"=",
"null",
",",
"$",
"value",
"=",
"null",
",",
"$",
"boolean",
"=",
"'AND'",
")",
"{",
"// If the developer is adding multiple where statements together,",
"// we will enforce that by adding th... | Add a constraint to the request query.
@param string $field
@param string $operator
@param string $value
@param string $boolean
@return $this | [
"Add",
"a",
"constraint",
"to",
"the",
"request",
"query",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L364-L388 |
231,658 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.whereIn | public function whereIn($field, $values)
{
$list = array_map(function ($value) {
return compact('value');
}, $values);
$this->condition[] = [
'field' => compact('field'),
'op' => '=',
'value' => compact('list')
];
return $this... | php | public function whereIn($field, $values)
{
$list = array_map(function ($value) {
return compact('value');
}, $values);
$this->condition[] = [
'field' => compact('field'),
'op' => '=',
'value' => compact('list')
];
return $this... | [
"public",
"function",
"whereIn",
"(",
"$",
"field",
",",
"$",
"values",
")",
"{",
"$",
"list",
"=",
"array_map",
"(",
"function",
"(",
"$",
"value",
")",
"{",
"return",
"compact",
"(",
"'value'",
")",
";",
"}",
",",
"$",
"values",
")",
";",
"$",
... | Add a where in constraint to the request query.
@param string $field
@param array $values
@return $this | [
"Add",
"a",
"where",
"in",
"constraint",
"to",
"the",
"request",
"query",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L424-L437 |
231,659 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.prepareValueAndOperator | protected function prepareValueAndOperator($value, $operator)
{
if (is_null($value) && ! in_array($operator, ['='])) {
$value = $operator;
$operator = '=';
} elseif (! in_array($operator, ['='])) {
throw new \InvalidArgumentException('Illegal operator and value co... | php | protected function prepareValueAndOperator($value, $operator)
{
if (is_null($value) && ! in_array($operator, ['='])) {
$value = $operator;
$operator = '=';
} elseif (! in_array($operator, ['='])) {
throw new \InvalidArgumentException('Illegal operator and value co... | [
"protected",
"function",
"prepareValueAndOperator",
"(",
"$",
"value",
",",
"$",
"operator",
")",
"{",
"if",
"(",
"is_null",
"(",
"$",
"value",
")",
"&&",
"!",
"in_array",
"(",
"$",
"operator",
",",
"[",
"'='",
"]",
")",
")",
"{",
"$",
"value",
"=",
... | Retrieve the value an operator of the conditional.
@param mixed $value
@param mixed $operator
@return array | [
"Retrieve",
"the",
"value",
"an",
"operator",
"of",
"the",
"conditional",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L446-L463 |
231,660 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.toArray | public function toArray(array $data = [])
{
return array_filter(array_merge([
'start' => $this->start,
'range' => $this->range,
'sort' => $this->sort,
'sortDir' => $this->sortDirection,
'search' => $this->search,
'searchNotes' => $this-... | php | public function toArray(array $data = [])
{
return array_filter(array_merge([
'start' => $this->start,
'range' => $this->range,
'sort' => $this->sort,
'sortDir' => $this->sortDirection,
'search' => $this->search,
'searchNotes' => $this-... | [
"public",
"function",
"toArray",
"(",
"array",
"$",
"data",
"=",
"[",
"]",
")",
"{",
"return",
"array_filter",
"(",
"array_merge",
"(",
"[",
"'start'",
"=>",
"$",
"this",
"->",
"start",
",",
"'range'",
"=>",
"$",
"this",
"->",
"range",
",",
"'sort'",
... | Retrieve the default request parameters.
@param array $data
@return array | [
"Retrieve",
"the",
"default",
"request",
"parameters",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L471-L484 |
231,661 | wallstreetio/ontraport | src/Resources/Resource.php | Resource.reset | public function reset()
{
$this->start = null;
$this->range = null;
$this->sort = null;
$this->sortDirection = null;
$this->search = null;
$this->searchNotes = null;
$this->condition = null;
return $this;
} | php | public function reset()
{
$this->start = null;
$this->range = null;
$this->sort = null;
$this->sortDirection = null;
$this->search = null;
$this->searchNotes = null;
$this->condition = null;
return $this;
} | [
"public",
"function",
"reset",
"(",
")",
"{",
"$",
"this",
"->",
"start",
"=",
"null",
";",
"$",
"this",
"->",
"range",
"=",
"null",
";",
"$",
"this",
"->",
"sort",
"=",
"null",
";",
"$",
"this",
"->",
"sortDirection",
"=",
"null",
";",
"$",
"thi... | Reset the resource parameters.
@return $this | [
"Reset",
"the",
"resource",
"parameters",
"."
] | 55467fd63637083f76e497897af4aee13fc2c8b1 | https://github.com/wallstreetio/ontraport/blob/55467fd63637083f76e497897af4aee13fc2c8b1/src/Resources/Resource.php#L491-L501 |
231,662 | praxisnetau/silverware | src/Extensions/AreaExtension.php | AreaExtension.getPanelForArea | public function getPanelForArea(AreaComponent $area)
{
// Answer Panel from Children:
foreach ($this->owner->getChildPanels() as $panel) {
if ($panel->hasArea($area)) {
return $panel;
}
}
// Answer Pa... | php | public function getPanelForArea(AreaComponent $area)
{
// Answer Panel from Children:
foreach ($this->owner->getChildPanels() as $panel) {
if ($panel->hasArea($area)) {
return $panel;
}
}
// Answer Pa... | [
"public",
"function",
"getPanelForArea",
"(",
"AreaComponent",
"$",
"area",
")",
"{",
"// Answer Panel from Children:",
"foreach",
"(",
"$",
"this",
"->",
"owner",
"->",
"getChildPanels",
"(",
")",
"as",
"$",
"panel",
")",
"{",
"if",
"(",
"$",
"panel",
"->",... | Answers the panel associated with the given area component.
@param AreaComponent $area
@return Panel | [
"Answers",
"the",
"panel",
"associated",
"with",
"the",
"given",
"area",
"component",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/AreaExtension.php#L54-L89 |
231,663 | i-am-tom/schemer | src/Validator/NestableAbstract.php | NestableAbstract.unnest | protected static function unnest(NestableResult $struct) : Result
{
$result = $struct->outer();
foreach ($struct as $key => $error) {
if ($error instanceof NestableResult) {
$error = self::unnest($error);
}
$result = $result->concat(
... | php | protected static function unnest(NestableResult $struct) : Result
{
$result = $struct->outer();
foreach ($struct as $key => $error) {
if ($error instanceof NestableResult) {
$error = self::unnest($error);
}
$result = $result->concat(
... | [
"protected",
"static",
"function",
"unnest",
"(",
"NestableResult",
"$",
"struct",
")",
":",
"Result",
"{",
"$",
"result",
"=",
"$",
"struct",
"->",
"outer",
"(",
")",
";",
"foreach",
"(",
"$",
"struct",
"as",
"$",
"key",
"=>",
"$",
"error",
")",
"{"... | Collapse a nested error into a standard Result object.
@param array $errors The nested error set.
@return Result The unnested Result object. | [
"Collapse",
"a",
"nested",
"error",
"into",
"a",
"standard",
"Result",
"object",
"."
] | aa4ff458eae636ca61ada07d05859e27d3b4584d | https://github.com/i-am-tom/schemer/blob/aa4ff458eae636ca61ada07d05859e27d3b4584d/src/Validator/NestableAbstract.php#L47-L64 |
231,664 | praxisnetau/silverware | src/Extensions/Style/CornerStyle.php | CornerStyle.getCornerStyleClass | public function getCornerStyleClass()
{
switch ($this->owner->CornerStyle) {
case self::CORNER_ROUNDED:
return $this->style('rounded');
case self::CORNER_CIRCULAR:
return $this->style('rounded.circle');
}
} | php | public function getCornerStyleClass()
{
switch ($this->owner->CornerStyle) {
case self::CORNER_ROUNDED:
return $this->style('rounded');
case self::CORNER_CIRCULAR:
return $this->style('rounded.circle');
}
} | [
"public",
"function",
"getCornerStyleClass",
"(",
")",
"{",
"switch",
"(",
"$",
"this",
"->",
"owner",
"->",
"CornerStyle",
")",
"{",
"case",
"self",
"::",
"CORNER_ROUNDED",
":",
"return",
"$",
"this",
"->",
"style",
"(",
"'rounded'",
")",
";",
"case",
"... | Answers the corner style class of the extended object.
@return string | [
"Answers",
"the",
"corner",
"style",
"class",
"of",
"the",
"extended",
"object",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Style/CornerStyle.php#L125-L133 |
231,665 | praxisnetau/silverware | src/Tools/ViewTools.php | ViewTools.convertClass | public function convertClass($val)
{
if (is_array($val)) {
foreach ($val as $k => $v) {
$val[$k] = $this->convertClass($v);
}
return $val;
}
return strtolower(trim(str_replace('\\', '-', $val)... | php | public function convertClass($val)
{
if (is_array($val)) {
foreach ($val as $k => $v) {
$val[$k] = $this->convertClass($v);
}
return $val;
}
return strtolower(trim(str_replace('\\', '-', $val)... | [
"public",
"function",
"convertClass",
"(",
"$",
"val",
")",
"{",
"if",
"(",
"is_array",
"(",
"$",
"val",
")",
")",
"{",
"foreach",
"(",
"$",
"val",
"as",
"$",
"k",
"=>",
"$",
"v",
")",
"{",
"$",
"val",
"[",
"$",
"k",
"]",
"=",
"$",
"this",
... | Converts the given value to a string suitable for HTML class attributes.
@param string|array $val
@return string | [
"Converts",
"the",
"given",
"value",
"to",
"a",
"string",
"suitable",
"for",
"HTML",
"class",
"attributes",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Tools/ViewTools.php#L60-L73 |
231,666 | praxisnetau/silverware | src/Tools/ViewTools.php | ViewTools.getAncestorClassNames | public function getAncestorClassNames($nameOrObject, $stopAt = null, $removeNamespaces = true)
{
return $this->convertClass(
ClassTools::singleton()->getObjectAncestry(
$nameOrObject,
$stopAt,
$removeNamespaces
)
);
} | php | public function getAncestorClassNames($nameOrObject, $stopAt = null, $removeNamespaces = true)
{
return $this->convertClass(
ClassTools::singleton()->getObjectAncestry(
$nameOrObject,
$stopAt,
$removeNamespaces
)
);
} | [
"public",
"function",
"getAncestorClassNames",
"(",
"$",
"nameOrObject",
",",
"$",
"stopAt",
"=",
"null",
",",
"$",
"removeNamespaces",
"=",
"true",
")",
"{",
"return",
"$",
"this",
"->",
"convertClass",
"(",
"ClassTools",
"::",
"singleton",
"(",
")",
"->",
... | Answers an array of ancestor class names for the given object.
@param string|object $nameOrObject Class name or object.
@param string $stopAt Ancestor class to stop at.
@param boolean $removeNamespaces If true, remove namespaces from class names.
@return array | [
"Answers",
"an",
"array",
"of",
"ancestor",
"class",
"names",
"for",
"the",
"given",
"object",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Tools/ViewTools.php#L84-L93 |
231,667 | praxisnetau/silverware | src/Tools/ViewTools.php | ViewTools.combineFiles | public function combineFiles($name, $files)
{
$backend = Requirements::backend();
$path = File::join_paths($backend->getCombinedFilesFolder(), $name);
return $backend->getAssetHandler()->getContentURL($path, function () use ($files) {
$output = [];
... | php | public function combineFiles($name, $files)
{
$backend = Requirements::backend();
$path = File::join_paths($backend->getCombinedFilesFolder(), $name);
return $backend->getAssetHandler()->getContentURL($path, function () use ($files) {
$output = [];
... | [
"public",
"function",
"combineFiles",
"(",
"$",
"name",
",",
"$",
"files",
")",
"{",
"$",
"backend",
"=",
"Requirements",
"::",
"backend",
"(",
")",
";",
"$",
"path",
"=",
"File",
"::",
"join_paths",
"(",
"$",
"backend",
"->",
"getCombinedFilesFolder",
"... | Combines the given array of files into a single file within the specified name and answers the URL.
@param string $name
@param array $files
@return string | [
"Combines",
"the",
"given",
"array",
"of",
"files",
"into",
"a",
"single",
"file",
"within",
"the",
"specified",
"name",
"and",
"answers",
"the",
"URL",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Tools/ViewTools.php#L150-L168 |
231,668 | praxisnetau/silverware | src/Tools/ViewTools.php | ViewTools.minifyCSS | public function minifyCSS($css, $wrap = 200)
{
// Remove Comments:
$css = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css);
// Remove Space Following Colons:
$css = str_replace(': ', ':', $css);
// Remove Whitespace:
... | php | public function minifyCSS($css, $wrap = 200)
{
// Remove Comments:
$css = preg_replace('!/\*[^*]*\*+([^/][^*]*\*+)*/!', '', $css);
// Remove Space Following Colons:
$css = str_replace(': ', ':', $css);
// Remove Whitespace:
... | [
"public",
"function",
"minifyCSS",
"(",
"$",
"css",
",",
"$",
"wrap",
"=",
"200",
")",
"{",
"// Remove Comments:",
"$",
"css",
"=",
"preg_replace",
"(",
"'!/\\*[^*]*\\*+([^/][^*]*\\*+)*/!'",
",",
"''",
",",
"$",
"css",
")",
";",
"// Remove Space Following Colons... | Minifies and wraps the given string of CSS.
@param string $css
@param integer $wrap
@return string | [
"Minifies",
"and",
"wraps",
"the",
"given",
"string",
"of",
"CSS",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Tools/ViewTools.php#L178-L195 |
231,669 | praxisnetau/silverware | src/Tools/ViewTools.php | ViewTools.getAttributesHTML | public function getAttributesHTML($attributes)
{
// Initialise:
$markup = [];
// Remove Empty Attributes:
$attributes = array_filter($attributes, function ($v) {
return ($v || $v === 0 || $v === '0');
});
// Render Remai... | php | public function getAttributesHTML($attributes)
{
// Initialise:
$markup = [];
// Remove Empty Attributes:
$attributes = array_filter($attributes, function ($v) {
return ($v || $v === 0 || $v === '0');
});
// Render Remai... | [
"public",
"function",
"getAttributesHTML",
"(",
"$",
"attributes",
")",
"{",
"// Initialise:",
"$",
"markup",
"=",
"[",
"]",
";",
"// Remove Empty Attributes:",
"$",
"attributes",
"=",
"array_filter",
"(",
"$",
"attributes",
",",
"function",
"(",
"$",
"v",
")"... | Converts the given associative array of attributes to a string of HTML.
@param array $attributes
@return string | [
"Converts",
"the",
"given",
"associative",
"array",
"of",
"attributes",
"to",
"a",
"string",
"of",
"HTML",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Tools/ViewTools.php#L204-L225 |
231,670 | praxisnetau/silverware | src/Tools/ViewTools.php | ViewTools.processAttributeArgs | public function processAttributeArgs($stringOrArray, ViewableData $object, ViewableData $parent = null)
{
$args = (array) $stringOrArray;
foreach ($args as $key => $arg) {
$args[$key] = $this->processAttribute($arg, $object, $parent);
}
return $args;
... | php | public function processAttributeArgs($stringOrArray, ViewableData $object, ViewableData $parent = null)
{
$args = (array) $stringOrArray;
foreach ($args as $key => $arg) {
$args[$key] = $this->processAttribute($arg, $object, $parent);
}
return $args;
... | [
"public",
"function",
"processAttributeArgs",
"(",
"$",
"stringOrArray",
",",
"ViewableData",
"$",
"object",
",",
"ViewableData",
"$",
"parent",
"=",
"null",
")",
"{",
"$",
"args",
"=",
"(",
"array",
")",
"$",
"stringOrArray",
";",
"foreach",
"(",
"$",
"ar... | Processes the given array of arguments for an attribute.
@param string|array $stringOrArray
@param ViewableData $object
@param ViewableData $parent
@return array | [
"Processes",
"the",
"given",
"array",
"of",
"arguments",
"for",
"an",
"attribute",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Tools/ViewTools.php#L316-L325 |
231,671 | praxisnetau/silverware | src/Tools/ViewTools.php | ViewTools.renderCSS | public function renderCSS(ViewableData $object, $template, $css = [])
{
if (SSViewer::hasTemplate($template)) {
return array_merge(
$css,
preg_split('/\r\n|\n|\r/', (string) $object->renderWith($template))
);
}
... | php | public function renderCSS(ViewableData $object, $template, $css = [])
{
if (SSViewer::hasTemplate($template)) {
return array_merge(
$css,
preg_split('/\r\n|\n|\r/', (string) $object->renderWith($template))
);
}
... | [
"public",
"function",
"renderCSS",
"(",
"ViewableData",
"$",
"object",
",",
"$",
"template",
",",
"$",
"css",
"=",
"[",
"]",
")",
"{",
"if",
"(",
"SSViewer",
"::",
"hasTemplate",
"(",
"$",
"template",
")",
")",
"{",
"return",
"array_merge",
"(",
"$",
... | Renders the given object using the given CSS template.
@param ViewableData $object
@param string $template
@param array $css
@return array | [
"Renders",
"the",
"given",
"object",
"using",
"the",
"given",
"CSS",
"template",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Tools/ViewTools.php#L348-L360 |
231,672 | praxisnetau/silverware | src/Extensions/Model/LinkToExtension.php | LinkToExtension.getLinkAttributes | public function getLinkAttributes()
{
$attributes = [
'href' => $this->owner->Link,
'title' => $this->owner->LinkTitle
];
if ($class = $this->owner->LinkClass) {
$attributes['class'] = $class;
}
if ($this->owner->OpenLinkI... | php | public function getLinkAttributes()
{
$attributes = [
'href' => $this->owner->Link,
'title' => $this->owner->LinkTitle
];
if ($class = $this->owner->LinkClass) {
$attributes['class'] = $class;
}
if ($this->owner->OpenLinkI... | [
"public",
"function",
"getLinkAttributes",
"(",
")",
"{",
"$",
"attributes",
"=",
"[",
"'href'",
"=>",
"$",
"this",
"->",
"owner",
"->",
"Link",
",",
"'title'",
"=>",
"$",
"this",
"->",
"owner",
"->",
"LinkTitle",
"]",
";",
"if",
"(",
"$",
"class",
"... | Answers an array of attributes for a link.
@return array | [
"Answers",
"an",
"array",
"of",
"attributes",
"for",
"a",
"link",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Model/LinkToExtension.php#L178-L194 |
231,673 | praxisnetau/silverware | src/Extensions/Model/LinkToExtension.php | LinkToExtension.getLink | public function getLink()
{
if ($this->owner->isURL() && $this->owner->LinkURL) {
return $this->owner->dbObject('LinkURL')->URL();
}
if ($this->owner->isPage() && $this->owner->LinkPageID) {
return $this->owner->LinkPage()->Link();
}
} | php | public function getLink()
{
if ($this->owner->isURL() && $this->owner->LinkURL) {
return $this->owner->dbObject('LinkURL')->URL();
}
if ($this->owner->isPage() && $this->owner->LinkPageID) {
return $this->owner->LinkPage()->Link();
}
} | [
"public",
"function",
"getLink",
"(",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"owner",
"->",
"isURL",
"(",
")",
"&&",
"$",
"this",
"->",
"owner",
"->",
"LinkURL",
")",
"{",
"return",
"$",
"this",
"->",
"owner",
"->",
"dbObject",
"(",
"'LinkURL'",
"... | Answers the link for the template.
@return string | [
"Answers",
"the",
"link",
"for",
"the",
"template",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Extensions/Model/LinkToExtension.php#L241-L250 |
231,674 | praxisnetau/silverware | src/Forms/ViewportsField.php | ViewportsField.setSource | public function setSource($source)
{
$this->source = $this->getSourceAsArray($source);
$this->updateViewportFields();
return $this;
} | php | public function setSource($source)
{
$this->source = $this->getSourceAsArray($source);
$this->updateViewportFields();
return $this;
} | [
"public",
"function",
"setSource",
"(",
"$",
"source",
")",
"{",
"$",
"this",
"->",
"source",
"=",
"$",
"this",
"->",
"getSourceAsArray",
"(",
"$",
"source",
")",
";",
"$",
"this",
"->",
"updateViewportFields",
"(",
")",
";",
"return",
"$",
"this",
";"... | Defines the value of the source attribute.
@param array|ArrayAccess $source
@return $this | [
"Defines",
"the",
"value",
"of",
"the",
"source",
"attribute",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Forms/ViewportsField.php#L223-L230 |
231,675 | praxisnetau/silverware | src/Forms/ViewportsField.php | ViewportsField.setViewportLabel | public function setViewportLabel($viewport, $label)
{
$this->labels[$viewport] = $label;
$this->updateViewportFields();
return $this;
} | php | public function setViewportLabel($viewport, $label)
{
$this->labels[$viewport] = $label;
$this->updateViewportFields();
return $this;
} | [
"public",
"function",
"setViewportLabel",
"(",
"$",
"viewport",
",",
"$",
"label",
")",
"{",
"$",
"this",
"->",
"labels",
"[",
"$",
"viewport",
"]",
"=",
"$",
"label",
";",
"$",
"this",
"->",
"updateViewportFields",
"(",
")",
";",
"return",
"$",
"this"... | Defines the label for the specified viewport.
@param string $viewport
@param string $label
@return $this | [
"Defines",
"the",
"label",
"for",
"the",
"specified",
"viewport",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Forms/ViewportsField.php#L308-L315 |
231,676 | praxisnetau/silverware | src/Forms/ViewportsField.php | ViewportsField.getViewportValues | public function getViewportValues()
{
$values = [];
foreach ($this->getViewports() as $viewport) {
$values[$viewport] = $this->getViewportField($viewport)->dataValue();
}
return $values;
} | php | public function getViewportValues()
{
$values = [];
foreach ($this->getViewports() as $viewport) {
$values[$viewport] = $this->getViewportField($viewport)->dataValue();
}
return $values;
} | [
"public",
"function",
"getViewportValues",
"(",
")",
"{",
"$",
"values",
"=",
"[",
"]",
";",
"foreach",
"(",
"$",
"this",
"->",
"getViewports",
"(",
")",
"as",
"$",
"viewport",
")",
"{",
"$",
"values",
"[",
"$",
"viewport",
"]",
"=",
"$",
"this",
"... | Answers an array containing the values of the viewport fields.
@return array | [
"Answers",
"an",
"array",
"containing",
"the",
"values",
"of",
"the",
"viewport",
"fields",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Forms/ViewportsField.php#L338-L347 |
231,677 | praxisnetau/silverware | src/Forms/ViewportsField.php | ViewportsField.setHiddenViewports | public function setHiddenViewports()
{
$args = func_get_args();
if (count($args) == 1 && is_array($args[0])) {
$viewports = $args[0];
} else {
$viewports = $args;
}
foreach ($viewports as $viewport) {
if ($thi... | php | public function setHiddenViewports()
{
$args = func_get_args();
if (count($args) == 1 && is_array($args[0])) {
$viewports = $args[0];
} else {
$viewports = $args;
}
foreach ($viewports as $viewport) {
if ($thi... | [
"public",
"function",
"setHiddenViewports",
"(",
")",
"{",
"$",
"args",
"=",
"func_get_args",
"(",
")",
";",
"if",
"(",
"count",
"(",
"$",
"args",
")",
"==",
"1",
"&&",
"is_array",
"(",
"$",
"args",
"[",
"0",
"]",
")",
")",
"{",
"$",
"viewports",
... | Defines the viewport fields to hide from display.
@return $this | [
"Defines",
"the",
"viewport",
"fields",
"to",
"hide",
"from",
"display",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Forms/ViewportsField.php#L354-L375 |
231,678 | praxisnetau/silverware | src/Forms/ViewportsField.php | ViewportsField.getSourceAsArray | protected function getSourceAsArray($source)
{
if (!is_array($source) && !($source instanceof ArrayAccess)) {
user_error('$source passed in as invalid type', E_USER_ERROR);
}
if ($source instanceof SS_List || $source instanceof Map) {
$source = $source->toArr... | php | protected function getSourceAsArray($source)
{
if (!is_array($source) && !($source instanceof ArrayAccess)) {
user_error('$source passed in as invalid type', E_USER_ERROR);
}
if ($source instanceof SS_List || $source instanceof Map) {
$source = $source->toArr... | [
"protected",
"function",
"getSourceAsArray",
"(",
"$",
"source",
")",
"{",
"if",
"(",
"!",
"is_array",
"(",
"$",
"source",
")",
"&&",
"!",
"(",
"$",
"source",
"instanceof",
"ArrayAccess",
")",
")",
"{",
"user_error",
"(",
"'$source passed in as invalid type'",... | Converts the given source parameter to an array.
@param array|ArrayAccess $source
@return array | [
"Converts",
"the",
"given",
"source",
"parameter",
"to",
"an",
"array",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Forms/ViewportsField.php#L481-L492 |
231,679 | praxisnetau/silverware | src/Forms/ViewportsField.php | ViewportsField.buildViewportFields | protected function buildViewportFields()
{
foreach ($this->getViewports() as $viewport) {
$this->push($this->buildViewportField($viewport));
}
} | php | protected function buildViewportFields()
{
foreach ($this->getViewports() as $viewport) {
$this->push($this->buildViewportField($viewport));
}
} | [
"protected",
"function",
"buildViewportFields",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getViewports",
"(",
")",
"as",
"$",
"viewport",
")",
"{",
"$",
"this",
"->",
"push",
"(",
"$",
"this",
"->",
"buildViewportField",
"(",
"$",
"viewport",
")... | Builds the viewport fields for the receiver.
@return void | [
"Builds",
"the",
"viewport",
"fields",
"for",
"the",
"receiver",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Forms/ViewportsField.php#L499-L504 |
231,680 | praxisnetau/silverware | src/Forms/ViewportsField.php | ViewportsField.buildViewportField | protected function buildViewportField($viewport)
{
if ($this->useTextInput) {
$field = TextField::create(
$this->getViewportName($viewport),
$this->getViewportLabel($viewport)
);
} else {
$fiel... | php | protected function buildViewportField($viewport)
{
if ($this->useTextInput) {
$field = TextField::create(
$this->getViewportName($viewport),
$this->getViewportLabel($viewport)
);
} else {
$fiel... | [
"protected",
"function",
"buildViewportField",
"(",
"$",
"viewport",
")",
"{",
"if",
"(",
"$",
"this",
"->",
"useTextInput",
")",
"{",
"$",
"field",
"=",
"TextField",
"::",
"create",
"(",
"$",
"this",
"->",
"getViewportName",
"(",
"$",
"viewport",
")",
"... | Builds and answers a form field for the specified viewport.
@param string $viewport
@return FormField | [
"Builds",
"and",
"answers",
"a",
"form",
"field",
"for",
"the",
"specified",
"viewport",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Forms/ViewportsField.php#L513-L533 |
231,681 | praxisnetau/silverware | src/Forms/ViewportsField.php | ViewportsField.updateViewportFields | protected function updateViewportFields()
{
foreach ($this->getViewports() as $viewport) {
// Obtain Field:
if (!($field = $this->getViewportField($viewport))) {
continue;
}
// Update Title:
... | php | protected function updateViewportFields()
{
foreach ($this->getViewports() as $viewport) {
// Obtain Field:
if (!($field = $this->getViewportField($viewport))) {
continue;
}
// Update Title:
... | [
"protected",
"function",
"updateViewportFields",
"(",
")",
"{",
"foreach",
"(",
"$",
"this",
"->",
"getViewports",
"(",
")",
"as",
"$",
"viewport",
")",
"{",
"// Obtain Field:",
"if",
"(",
"!",
"(",
"$",
"field",
"=",
"$",
"this",
"->",
"getViewportField",... | Updates the viewport fields after a state change.
@return void | [
"Updates",
"the",
"viewport",
"fields",
"after",
"a",
"state",
"change",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Forms/ViewportsField.php#L540-L587 |
231,682 | kamilZ/B2Backblaze | src/B2Backblaze/B2Service.php | B2Service.authorize | public function authorize()
{
$response = $this->client->b2AuthorizeAccount();
if ($response->isOk()) {
$this->apiURL = $response->get('apiUrl');
$this->token = $response->get('authorizationToken');
$this->downloadURL = $response->get('downloadUrl');
$... | php | public function authorize()
{
$response = $this->client->b2AuthorizeAccount();
if ($response->isOk()) {
$this->apiURL = $response->get('apiUrl');
$this->token = $response->get('authorizationToken');
$this->downloadURL = $response->get('downloadUrl');
$... | [
"public",
"function",
"authorize",
"(",
")",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"b2AuthorizeAccount",
"(",
")",
";",
"if",
"(",
"$",
"response",
"->",
"isOk",
"(",
")",
")",
"{",
"$",
"this",
"->",
"apiURL",
"=",
"$",
"re... | Authenticate with server.
@return bool | [
"Authenticate",
"with",
"server",
"."
] | 64d25e60849f7bcb957a070af3231694da118f55 | https://github.com/kamilZ/B2Backblaze/blob/64d25e60849f7bcb957a070af3231694da118f55/src/B2Backblaze/B2Service.php#L41-L54 |
231,683 | kamilZ/B2Backblaze | src/B2Backblaze/B2Service.php | B2Service.isBucketExist | public function isBucketExist($bucketId)
{
$this->ensureAuthorized();
$response = $this->client->b2ListBuckets($this->apiURL, $this->token);
if ($response->isOk()) {
$buckets = $response->get('buckets');
if (!is_null($buckets)) {
foreach ($buckets as $... | php | public function isBucketExist($bucketId)
{
$this->ensureAuthorized();
$response = $this->client->b2ListBuckets($this->apiURL, $this->token);
if ($response->isOk()) {
$buckets = $response->get('buckets');
if (!is_null($buckets)) {
foreach ($buckets as $... | [
"public",
"function",
"isBucketExist",
"(",
"$",
"bucketId",
")",
"{",
"$",
"this",
"->",
"ensureAuthorized",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"b2ListBuckets",
"(",
"$",
"this",
"->",
"apiURL",
",",
"$",
"this",
"... | Returns true if bucket exist.
@param $bucketId
@return bool | [
"Returns",
"true",
"if",
"bucket",
"exist",
"."
] | 64d25e60849f7bcb957a070af3231694da118f55 | https://github.com/kamilZ/B2Backblaze/blob/64d25e60849f7bcb957a070af3231694da118f55/src/B2Backblaze/B2Service.php#L63-L79 |
231,684 | kamilZ/B2Backblaze | src/B2Backblaze/B2Service.php | B2Service.get | public function get($bucketName, $fileName, $private = false, $metadataOnly = false)
{
$token = null;
if ($private == true) {
$this->ensureAuthorized();
$token = $this->token;
}
$response = $this->client->b2DownloadFileByName($this->downloadURL, $bucketName, $... | php | public function get($bucketName, $fileName, $private = false, $metadataOnly = false)
{
$token = null;
if ($private == true) {
$this->ensureAuthorized();
$token = $this->token;
}
$response = $this->client->b2DownloadFileByName($this->downloadURL, $bucketName, $... | [
"public",
"function",
"get",
"(",
"$",
"bucketName",
",",
"$",
"fileName",
",",
"$",
"private",
"=",
"false",
",",
"$",
"metadataOnly",
"=",
"false",
")",
"{",
"$",
"token",
"=",
"null",
";",
"if",
"(",
"$",
"private",
"==",
"true",
")",
"{",
"$",
... | Returns the file content and file metadata.
@param String $bucketName
@param String $fileName
@param bool $private
@param bool $metadataOnly
@return array|bool | [
"Returns",
"the",
"file",
"content",
"and",
"file",
"metadata",
"."
] | 64d25e60849f7bcb957a070af3231694da118f55 | https://github.com/kamilZ/B2Backblaze/blob/64d25e60849f7bcb957a070af3231694da118f55/src/B2Backblaze/B2Service.php#L116-L129 |
231,685 | kamilZ/B2Backblaze | src/B2Backblaze/B2Service.php | B2Service.insert | public function insert($bucketId, $file, $fileName)
{
$this->ensureAuthorized();
if(!$this->downloadToken || !$this->uploadURL){
$response = $this->client->b2GetUploadURL($this->apiURL, $this->token, $bucketId);
if ($response->isOk()) {
$this->downloadToken = ... | php | public function insert($bucketId, $file, $fileName)
{
$this->ensureAuthorized();
if(!$this->downloadToken || !$this->uploadURL){
$response = $this->client->b2GetUploadURL($this->apiURL, $this->token, $bucketId);
if ($response->isOk()) {
$this->downloadToken = ... | [
"public",
"function",
"insert",
"(",
"$",
"bucketId",
",",
"$",
"file",
",",
"$",
"fileName",
")",
"{",
"$",
"this",
"->",
"ensureAuthorized",
"(",
")",
";",
"if",
"(",
"!",
"$",
"this",
"->",
"downloadToken",
"||",
"!",
"$",
"this",
"->",
"uploadURL... | Inserts file and returns array of file metadata.
@param String $bucketId
@param mixed $file
@param String $fileName
@return array|bool|null
@throws B2Exception | [
"Inserts",
"file",
"and",
"returns",
"array",
"of",
"file",
"metadata",
"."
] | 64d25e60849f7bcb957a070af3231694da118f55 | https://github.com/kamilZ/B2Backblaze/blob/64d25e60849f7bcb957a070af3231694da118f55/src/B2Backblaze/B2Service.php#L172-L203 |
231,686 | kamilZ/B2Backblaze | src/B2Backblaze/B2Service.php | B2Service.insertLarge | public function insertLarge($bucketId, $filePath, $fileName)
{
$this->ensureAuthorized();
// start large file:
$startResponse = $this->client->b2StartLargeFile($this->apiURL, $this->token, $bucketId, $fileName);
$fileId = $startResponse->get("fileId");
try{
// get... | php | public function insertLarge($bucketId, $filePath, $fileName)
{
$this->ensureAuthorized();
// start large file:
$startResponse = $this->client->b2StartLargeFile($this->apiURL, $this->token, $bucketId, $fileName);
$fileId = $startResponse->get("fileId");
try{
// get... | [
"public",
"function",
"insertLarge",
"(",
"$",
"bucketId",
",",
"$",
"filePath",
",",
"$",
"fileName",
")",
"{",
"$",
"this",
"->",
"ensureAuthorized",
"(",
")",
";",
"// start large file:",
"$",
"startResponse",
"=",
"$",
"this",
"->",
"client",
"->",
"b2... | Inserts large file and returns array of file metadata.
Large files can range in size from 5MB to 10TB.
Each large file must consist of at least 2 parts, and all of the parts except the last one must be at least 5MB in size.
The last part must contain at least one byte.
@param String $bucketId
@param mixed $filePath
@... | [
"Inserts",
"large",
"file",
"and",
"returns",
"array",
"of",
"file",
"metadata",
".",
"Large",
"files",
"can",
"range",
"in",
"size",
"from",
"5MB",
"to",
"10TB",
".",
"Each",
"large",
"file",
"must",
"consist",
"of",
"at",
"least",
"2",
"parts",
"and",
... | 64d25e60849f7bcb957a070af3231694da118f55 | https://github.com/kamilZ/B2Backblaze/blob/64d25e60849f7bcb957a070af3231694da118f55/src/B2Backblaze/B2Service.php#L219-L243 |
231,687 | kamilZ/B2Backblaze | src/B2Backblaze/B2Service.php | B2Service.delete | public function delete($bucketName, $fileName, $private = false)
{
$data = $this->get($bucketName, $fileName, $private, true);
if ($data !== false && array_key_exists('x-bz-file-id', $data['headers'])) {
$response = $this->client->b2DeleteFileVersion($this->apiURL, $this->token, $data['h... | php | public function delete($bucketName, $fileName, $private = false)
{
$data = $this->get($bucketName, $fileName, $private, true);
if ($data !== false && array_key_exists('x-bz-file-id', $data['headers'])) {
$response = $this->client->b2DeleteFileVersion($this->apiURL, $this->token, $data['h... | [
"public",
"function",
"delete",
"(",
"$",
"bucketName",
",",
"$",
"fileName",
",",
"$",
"private",
"=",
"false",
")",
"{",
"$",
"data",
"=",
"$",
"this",
"->",
"get",
"(",
"$",
"bucketName",
",",
"$",
"fileName",
",",
"$",
"private",
",",
"true",
"... | Delete file version.
@param String $bucketName
@param String $fileName
@param bool $private
@return bool | [
"Delete",
"file",
"version",
"."
] | 64d25e60849f7bcb957a070af3231694da118f55 | https://github.com/kamilZ/B2Backblaze/blob/64d25e60849f7bcb957a070af3231694da118f55/src/B2Backblaze/B2Service.php#L254-L264 |
231,688 | kamilZ/B2Backblaze | src/B2Backblaze/B2Service.php | B2Service.all | public function all($bucketId)
{
$this->ensureAuthorized();
$list = array();
$nexFile = null;
do {
$response = $this->client->b2ListFileNames($this->apiURL, $this->token, $bucketId, $nexFile, 1000);
if ($response->isOk()) {
$files = $response->... | php | public function all($bucketId)
{
$this->ensureAuthorized();
$list = array();
$nexFile = null;
do {
$response = $this->client->b2ListFileNames($this->apiURL, $this->token, $bucketId, $nexFile, 1000);
if ($response->isOk()) {
$files = $response->... | [
"public",
"function",
"all",
"(",
"$",
"bucketId",
")",
"{",
"$",
"this",
"->",
"ensureAuthorized",
"(",
")",
";",
"$",
"list",
"=",
"array",
"(",
")",
";",
"$",
"nexFile",
"=",
"null",
";",
"do",
"{",
"$",
"response",
"=",
"$",
"this",
"->",
"cl... | Returns the list of files in bucket.
@param String $bucketId
@return array
@throws B2Exception | [
"Returns",
"the",
"list",
"of",
"files",
"in",
"bucket",
"."
] | 64d25e60849f7bcb957a070af3231694da118f55 | https://github.com/kamilZ/B2Backblaze/blob/64d25e60849f7bcb957a070af3231694da118f55/src/B2Backblaze/B2Service.php#L303-L323 |
231,689 | kamilZ/B2Backblaze | src/B2Backblaze/B2Service.php | B2Service.existsInList | public function existsInList($bucketId, $fileName)
{
$this->ensureAuthorized();
$response = $this->client->b2ListFileNames($this->apiURL, $this->token, $bucketId, $fileName, 1);
if (!$response->isOk(false)) {
return false;
}
return $response->get('files')[0]['fil... | php | public function existsInList($bucketId, $fileName)
{
$this->ensureAuthorized();
$response = $this->client->b2ListFileNames($this->apiURL, $this->token, $bucketId, $fileName, 1);
if (!$response->isOk(false)) {
return false;
}
return $response->get('files')[0]['fil... | [
"public",
"function",
"existsInList",
"(",
"$",
"bucketId",
",",
"$",
"fileName",
")",
"{",
"$",
"this",
"->",
"ensureAuthorized",
"(",
")",
";",
"$",
"response",
"=",
"$",
"this",
"->",
"client",
"->",
"b2ListFileNames",
"(",
"$",
"this",
"->",
"apiURL"... | Check if the filename exists.
@param String $bucketId
@param String $fileName
@return bool | [
"Check",
"if",
"the",
"filename",
"exists",
"."
] | 64d25e60849f7bcb957a070af3231694da118f55 | https://github.com/kamilZ/B2Backblaze/blob/64d25e60849f7bcb957a070af3231694da118f55/src/B2Backblaze/B2Service.php#L334-L343 |
231,690 | praxisnetau/silverware | src/Grid/Frameworks/Bootstrap/Framework.php | Framework.getTextAlignmentClass | public function getTextAlignmentClass($viewport, $value)
{
if ($value) {
$class = [$this->getStyle('text')];
$class[] = $this->getStyle('viewport', $viewport);
$class[] = $this->getStyle('align', $value);
ret... | php | public function getTextAlignmentClass($viewport, $value)
{
if ($value) {
$class = [$this->getStyle('text')];
$class[] = $this->getStyle('viewport', $viewport);
$class[] = $this->getStyle('align', $value);
ret... | [
"public",
"function",
"getTextAlignmentClass",
"(",
"$",
"viewport",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
")",
"{",
"$",
"class",
"=",
"[",
"$",
"this",
"->",
"getStyle",
"(",
"'text'",
")",
"]",
";",
"$",
"class",
"[",
"]",
"=",
... | Answers the text alignment class for the specified viewport and value.
@param string $viewport
@param string $value
@return string | [
"Answers",
"the",
"text",
"alignment",
"class",
"for",
"the",
"specified",
"viewport",
"and",
"value",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Grid/Frameworks/Bootstrap/Framework.php#L64-L77 |
231,691 | praxisnetau/silverware | src/Grid/Frameworks/Bootstrap/Framework.php | Framework.getImageAlignmentClass | public function getImageAlignmentClass($viewport, $value)
{
if ($value) {
$class = [$this->getStyle('image')];
$class[] = $this->getStyle('viewport', $viewport);
$class[] = $this->getStyle('align', $value);
r... | php | public function getImageAlignmentClass($viewport, $value)
{
if ($value) {
$class = [$this->getStyle('image')];
$class[] = $this->getStyle('viewport', $viewport);
$class[] = $this->getStyle('align', $value);
r... | [
"public",
"function",
"getImageAlignmentClass",
"(",
"$",
"viewport",
",",
"$",
"value",
")",
"{",
"if",
"(",
"$",
"value",
")",
"{",
"$",
"class",
"=",
"[",
"$",
"this",
"->",
"getStyle",
"(",
"'image'",
")",
"]",
";",
"$",
"class",
"[",
"]",
"=",... | Answers the image alignment class for the specified viewport and value.
@param string $viewport
@param string $value
@return string | [
"Answers",
"the",
"image",
"alignment",
"class",
"for",
"the",
"specified",
"viewport",
"and",
"value",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Grid/Frameworks/Bootstrap/Framework.php#L87-L100 |
231,692 | praxisnetau/silverware | src/Components/TableComponent.php | TableComponent.getColumns | public function getColumns()
{
$columns = ArrayList::create();
foreach ($this->getEnabledChildren() as $child) {
$columns->push(
ArrayData::create([
'Child' => $child,
'ColumnClass' => $this->ColumnClass
... | php | public function getColumns()
{
$columns = ArrayList::create();
foreach ($this->getEnabledChildren() as $child) {
$columns->push(
ArrayData::create([
'Child' => $child,
'ColumnClass' => $this->ColumnClass
... | [
"public",
"function",
"getColumns",
"(",
")",
"{",
"$",
"columns",
"=",
"ArrayList",
"::",
"create",
"(",
")",
";",
"foreach",
"(",
"$",
"this",
"->",
"getEnabledChildren",
"(",
")",
"as",
"$",
"child",
")",
"{",
"$",
"columns",
"->",
"push",
"(",
"A... | Answers a list of the columns within the receiver.
@return ArrayList | [
"Answers",
"a",
"list",
"of",
"the",
"columns",
"within",
"the",
"receiver",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Components/TableComponent.php#L191-L207 |
231,693 | praxisnetau/silverware | src/Components/TableComponent.php | TableComponent.getColumnClassNames | public function getColumnClassNames()
{
$classes = array_merge(
$this->styles('column'),
Column::singleton()->getSpanClassNames($this->dbObject('ColumnSpan'))
);
$this->extend('updateColumnClassNames', $classes);
return $classes;
} | php | public function getColumnClassNames()
{
$classes = array_merge(
$this->styles('column'),
Column::singleton()->getSpanClassNames($this->dbObject('ColumnSpan'))
);
$this->extend('updateColumnClassNames', $classes);
return $classes;
} | [
"public",
"function",
"getColumnClassNames",
"(",
")",
"{",
"$",
"classes",
"=",
"array_merge",
"(",
"$",
"this",
"->",
"styles",
"(",
"'column'",
")",
",",
"Column",
"::",
"singleton",
"(",
")",
"->",
"getSpanClassNames",
"(",
"$",
"this",
"->",
"dbObject... | Answers an array of column class names for the template.
@return array | [
"Answers",
"an",
"array",
"of",
"column",
"class",
"names",
"for",
"the",
"template",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Components/TableComponent.php#L214-L224 |
231,694 | praxisnetau/silverware | src/Dev/FixtureBlueprint.php | FixtureBlueprint.createObject | public function createObject($identifier, $data = null, $fixtures = null, $filter = [])
{
// Trigger Before Create Event:
$this->onBeforeCreate($identifier, $data, $fixtures);
// Attempt Object Creation:
try {
// Obtain Object:
... | php | public function createObject($identifier, $data = null, $fixtures = null, $filter = [])
{
// Trigger Before Create Event:
$this->onBeforeCreate($identifier, $data, $fixtures);
// Attempt Object Creation:
try {
// Obtain Object:
... | [
"public",
"function",
"createObject",
"(",
"$",
"identifier",
",",
"$",
"data",
"=",
"null",
",",
"$",
"fixtures",
"=",
"null",
",",
"$",
"filter",
"=",
"[",
"]",
")",
"{",
"// Trigger Before Create Event:",
"$",
"this",
"->",
"onBeforeCreate",
"(",
"$",
... | Creates a data object using the provided data.
@param string $identifier Unique identifier for this fixture type.
@param array $data Map of property names with associated values.
@param array $fixtures Map of fixture names to an array of identifiers and IDs.
@param array $filter Map of property names and associated va... | [
"Creates",
"a",
"data",
"object",
"using",
"the",
"provided",
"data",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Dev/FixtureBlueprint.php#L120-L161 |
231,695 | praxisnetau/silverware | src/Dev/FixtureBlueprint.php | FixtureBlueprint.findOrMakeObject | public function findOrMakeObject($identifier, $data = null, $fixtures = null, $filter = [])
{
// Handle Default Parent:
if (($ID = $this->getDefaultParent()) && !isset($data['ParentID'])) {
$data['ParentID'] = $filter['ParentID'] = $ID;
}
// Obtain Exist... | php | public function findOrMakeObject($identifier, $data = null, $fixtures = null, $filter = [])
{
// Handle Default Parent:
if (($ID = $this->getDefaultParent()) && !isset($data['ParentID'])) {
$data['ParentID'] = $filter['ParentID'] = $ID;
}
// Obtain Exist... | [
"public",
"function",
"findOrMakeObject",
"(",
"$",
"identifier",
",",
"$",
"data",
"=",
"null",
",",
"$",
"fixtures",
"=",
"null",
",",
"$",
"filter",
"=",
"[",
"]",
")",
"{",
"// Handle Default Parent:",
"if",
"(",
"(",
"$",
"ID",
"=",
"$",
"this",
... | Answers either an existing instance or a new instance of the data object.
@param string $identifier
@param array $data
@param array $fixtures
@param array $filter
@return DataObject | [
"Answers",
"either",
"an",
"existing",
"instance",
"or",
"a",
"new",
"instance",
"of",
"the",
"data",
"object",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Dev/FixtureBlueprint.php#L173-L236 |
231,696 | praxisnetau/silverware | src/Dev/FixtureBlueprint.php | FixtureBlueprint.findObject | public function findObject($identifier, $data, $filter)
{
if ($objects = $this->findObjects($identifier, $data, $filter)) {
if ($objects->exists()) {
return $objects->first();
}
}
} | php | public function findObject($identifier, $data, $filter)
{
if ($objects = $this->findObjects($identifier, $data, $filter)) {
if ($objects->exists()) {
return $objects->first();
}
}
} | [
"public",
"function",
"findObject",
"(",
"$",
"identifier",
",",
"$",
"data",
",",
"$",
"filter",
")",
"{",
"if",
"(",
"$",
"objects",
"=",
"$",
"this",
"->",
"findObjects",
"(",
"$",
"identifier",
",",
"$",
"data",
",",
"$",
"filter",
")",
")",
"{... | Answers an existing instance of the data object.
@param string $identifier
@param array $data
@param array $filter
@return DataObject | [
"Answers",
"an",
"existing",
"instance",
"of",
"the",
"data",
"object",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Dev/FixtureBlueprint.php#L247-L256 |
231,697 | praxisnetau/silverware | src/Dev/FixtureBlueprint.php | FixtureBlueprint.findObjects | public function findObjects($identifier, $data, $filter)
{
$objects = DataList::create($this->getClass());
if (!$objects->exists() && $this->config()->filter_by_base_class) {
$objects = DataList::create($this->getBaseClass());
}
if (is_array($filter)) {
... | php | public function findObjects($identifier, $data, $filter)
{
$objects = DataList::create($this->getClass());
if (!$objects->exists() && $this->config()->filter_by_base_class) {
$objects = DataList::create($this->getBaseClass());
}
if (is_array($filter)) {
... | [
"public",
"function",
"findObjects",
"(",
"$",
"identifier",
",",
"$",
"data",
",",
"$",
"filter",
")",
"{",
"$",
"objects",
"=",
"DataList",
"::",
"create",
"(",
"$",
"this",
"->",
"getClass",
"(",
")",
")",
";",
"if",
"(",
"!",
"$",
"objects",
"-... | Answers a list of the existing objects in the database.
@param string $identifier
@param array $data
@param array $filter
@return DataList | [
"Answers",
"a",
"list",
"of",
"the",
"existing",
"objects",
"in",
"the",
"database",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Dev/FixtureBlueprint.php#L267-L292 |
231,698 | praxisnetau/silverware | src/Dev/FixtureBlueprint.php | FixtureBlueprint.matchObjects | public function matchObjects(DataList $objects, $data)
{
// Detect Filter:
$name = $this->getMatchOnName();
if (isset($data[$name])) {
$filter = [];
$matchOn = $data[$name];
if (is_array($matchOn)) {
... | php | public function matchObjects(DataList $objects, $data)
{
// Detect Filter:
$name = $this->getMatchOnName();
if (isset($data[$name])) {
$filter = [];
$matchOn = $data[$name];
if (is_array($matchOn)) {
... | [
"public",
"function",
"matchObjects",
"(",
"DataList",
"$",
"objects",
",",
"$",
"data",
")",
"{",
"// Detect Filter:",
"$",
"name",
"=",
"$",
"this",
"->",
"getMatchOnName",
"(",
")",
";",
"if",
"(",
"isset",
"(",
"$",
"data",
"[",
"$",
"name",
"]",
... | Answers those objects within the given data list matching the provided filter.
@param DataList $objects
@param array $data
@return DataList | [
"Answers",
"those",
"objects",
"within",
"the",
"given",
"data",
"list",
"matching",
"the",
"provided",
"filter",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Dev/FixtureBlueprint.php#L302-L350 |
231,699 | praxisnetau/silverware | src/Dev/FixtureBlueprint.php | FixtureBlueprint.mutateClass | public function mutateClass(DataObject $object, $identifier, $data)
{
$class = $this->getClass();
if ($object->ClassName != $class) {
// Show Notice Message:
$this->noticeMessage(
sprintf(
'Mutating %s (%s... | php | public function mutateClass(DataObject $object, $identifier, $data)
{
$class = $this->getClass();
if ($object->ClassName != $class) {
// Show Notice Message:
$this->noticeMessage(
sprintf(
'Mutating %s (%s... | [
"public",
"function",
"mutateClass",
"(",
"DataObject",
"$",
"object",
",",
"$",
"identifier",
",",
"$",
"data",
")",
"{",
"$",
"class",
"=",
"$",
"this",
"->",
"getClass",
"(",
")",
";",
"if",
"(",
"$",
"object",
"->",
"ClassName",
"!=",
"$",
"class... | Mutates the class of the given object, if required.
@param DataObject $object
@param string $identifier
@param array $data
@return DataObject | [
"Mutates",
"the",
"class",
"of",
"the",
"given",
"object",
"if",
"required",
"."
] | 2fa731c7f0737b350e0cbc676e93ac5beb430792 | https://github.com/praxisnetau/silverware/blob/2fa731c7f0737b350e0cbc676e93ac5beb430792/src/Dev/FixtureBlueprint.php#L424-L453 |
Subsets and Splits
Yii Code Samples
Gathers all records from test, train, and validation sets that contain the word 'yii', providing a basic filtered view of the dataset relevant to Yii-related content.