public function add($name, $class, $description = null) {

        if ( array_key_exists($name, $this->data) ) {
            $this->logger->warning("Skipping duplicate task $name ($class)");
            return false;
        }

        if ( empty($name) || empty($class) || !class_exists($class) ) {
            $this->logger->warning("Skipping invalid task definition", array(
                "NAME"       => $name,
                "CLASS"      => $class,
                "DESCRIPTION"=> $description
            ));
            return false;
        }

        $this->data[$name] = new TaskItem(
            $this->getConfiguration(),
            $this->getEvents(),
            $this->getLogger(),
            $name,
            $class,
            $description
        );

        $this->logger->debug("Task $name ($class) in table");

        return true;

    }
public function add($name, $class, $description = null) {

        if ( array_key_exists($name, $this->data) ) {
            $this->logger->warning("Skipping duplicate task $name ($class)");
            return false;
        }

        if ( empty($name) || empty($class) || !class_exists($class) ) {
            $this->logger->warning("Skipping invalid task definition", array(
                "NAME"       => $name,
                "CLASS"      => $class,
                "DESCRIPTION"=> $description
            ));
            return false;
        }

        $this->data[$name] = new TaskItem(
            $this->getConfiguration(),
            $this->getEvents(),
            $this->getLogger(),
            $name,
            $class,
            $description
        );

        $this->logger->debug("Task $name ($class) in table");

        return true;

    }
public function add ( $ name , $ class , $ description = null ) { if ( array_key_exists ( $ name , $ this -> data ) ) { $ this -> logger -> warning ( "Skipping duplicate task $name ($class)" ) ; return false ; } if ( empty ( $ name ) || empty ( $ class ) || ! class_exists ( $ class ) ) { $ this -> logger -> warning ( "Skipping invalid task definition" , array ( "NAME" => $ name , "CLASS" => $ class , "DESCRIPTION" => $ description ) ) ; return false ; } $ this -> data [ $ name ] = new TaskItem ( $ this -> getConfiguration ( ) , $ this -> getEvents ( ) , $ this -> getLogger ( ) , $ name , $ class , $ description ) ; $ this -> logger -> debug ( "Task $name ($class) in table" ) ; return true ; }
Add a new task to table

@param string $name
@param string $class
@param string $description
@return bool
Add a new task to table