Storage::getJobsForTube PHP Method

getJobsForTube() public method

public getJobsForTube ( $tubename )
    public function getJobsForTube($tubename)
    {
        $collection = $this->readCollection();
        $result = array();
        if (@is_array($collection[self::VERSION]['tubes'][$tubename])) {
            foreach ($collection[self::VERSION]['tubes'][$tubename] as $key => $val) {
                $job = @$collection[self::VERSION]['jobs'][$key];
                if (!empty($job)) {
                    $result[$key] = $job['name'];
                }
            }
        }
        return $result;
    }

Usage Example

Ejemplo n.º 1
0
 public function getSampleJobs($tube = null)
 {
     $storage = new Storage($this->_globalVar['config']['storage']);
     if ($tube) {
         return $storage->getJobsForTube($tube);
     } else {
         return $storage->getJobs();
     }
 }