Inherits Doctrine_Task.
Definition at line 33 of file BuildAllLoad.php.
| Doctrine_Task::addArgument |
( |
|
$name, |
|
|
|
$value |
|
) |
| |
|
inherited |
addArgument
- Parameters
-
- Returns
- void
Definition at line 166 of file Task.php.
{
$this->arguments[$name] = $value;
}
ask
- Returns
- void
Definition at line 118 of file Task.php.
{
$args = func_get_args();
call_user_func_array(array($this, 'notify'), $args);
$answer = strtolower(trim(fgets(STDIN)));
return $answer;
}
| static Doctrine_Task::deriveTaskName |
( |
|
$className | ) |
|
|
staticinherited |
Returns the name of the task the specified class would implement
N.B. This method does not check if the specified class is actually a Doctrine Task
This is public so we can easily test its reactions to fully-qualified class names, without having to add PHP 5.3-specific test code
- Parameters
-
- Returns
- string|bool
Definition at line 81 of file Task.php.
{
$nameParts = explode('\\', $className);
foreach ($nameParts as &$namePart) {
$prefix = __CLASS__ . '_';
$baseName = strpos($namePart, $prefix) === 0 ? substr($namePart, strlen($prefix)) : $namePart;
}
return implode('-', $nameParts);
}
| Doctrine_Task::getArgument |
( |
|
$name, |
|
|
|
$default = null |
|
) |
| |
|
inherited |
getArgument
- Parameters
-
| string | $name | |
| string | $default | |
- Returns
- mixed
Definition at line 178 of file Task.php.
{
if (isset($this->arguments[$name]) && $this->arguments[$name] !== null) {
return $this->arguments[$name];
} else {
return $default;
}
}
| Doctrine_Task::getArguments |
( |
| ) |
|
|
inherited |
getArguments
- Returns
- array $arguments
Definition at line 192 of file Task.php.
{
return $this->arguments;
}
| Doctrine_Task::getDescription |
( |
| ) |
|
|
inherited |
getDescription
- Returns
- string $description
Definition at line 255 of file Task.php.
{
return $this->description;
}
| Doctrine_Task::getOptionalArguments |
( |
| ) |
|
|
inherited |
getOptionalArguments
- Returns
- array $optionalArguments
Definition at line 275 of file Task.php.
{
return array_keys($this->optionalArguments);
}
| Doctrine_Task::getOptionalArgumentsDescriptions |
( |
| ) |
|
|
inherited |
getOptionalArgumentsDescriptions
- Returns
- array $optionalArgumentsDescriptions
Definition at line 295 of file Task.php.
{
return $this->optionalArguments;
}
| Doctrine_Task::getRequiredArguments |
( |
| ) |
|
|
inherited |
getRequiredArguments
- Returns
- array $requiredArguments
Definition at line 265 of file Task.php.
{
return array_keys($this->requiredArguments);
}
| Doctrine_Task::getRequiredArgumentsDescriptions |
( |
| ) |
|
|
inherited |
getRequiredArgumentsDescriptions
- Returns
- array $requiredArgumentsDescriptions
Definition at line 285 of file Task.php.
{
return $this->requiredArguments;
}
| Doctrine_Task::getTaskName |
( |
| ) |
|
|
inherited |
getTaskName
- Returns
- string $taskName
Definition at line 245 of file Task.php.
{
return $this->taskName;
}
| Doctrine_Task::notify |
( |
|
$notification = null | ) |
|
|
inherited |
notify
- Parameters
-
- Returns
- void
Definition at line 100 of file Task.php.
{
if (is_object($this->dispatcher) && method_exists($this->dispatcher, 'notify')) {
$args = func_get_args();
return call_user_func_array(array($this->dispatcher, 'notify'), $args);
} else if ( $notification !== null ) {
return $notification;
} else {
return false;
}
}
| Doctrine_Task::setArguments |
( |
array |
$args | ) |
|
|
inherited |
setArguments
- Parameters
-
- Returns
- void
Definition at line 203 of file Task.php.
{
$this->arguments = $args;
}
| Doctrine_Task::setTaskName |
( |
|
$taskName | ) |
|
|
protectedinherited |
Sets the name of the task, the name that's used to invoke it through a CLI
- Parameters
-
- Exceptions
-
| InvalidArgumentException | If the task name is invalid |
Definition at line 229 of file Task.php.
{
if (! self::validateTaskName($taskName)) {
throw new InvalidArgumentException(
sprintf('The task name "%s", in %s, is invalid', $taskName, get_class($this))
);
}
$this->taskName = $taskName;
}
| Doctrine_Task::validate |
( |
| ) |
|
|
inherited |
validate
Validates that all required fields are present
- Returns
- bool true
Definition at line 146 of file Task.php.
{
foreach ($requiredArguments as $arg) {
if ( ! isset($this->arguments[$arg])) {
return false;
}
}
return true;
}
| static Doctrine_Task::validateTaskName |
( |
|
$taskName | ) |
|
|
staticprotectedinherited |
Returns TRUE if the specified task name is valid, or FALSE otherwise
- Parameters
-
- Returns
- bool
Definition at line 214 of file Task.php.
{
return (bool) preg_match('/^[a-z0-9][a-z0-9\-]*$/', $taskName);
}
The documentation for this class was generated from the following file: