/** * Filter by project name or id. * * @param mixed $project_ref * @return \Todoist\Task\Tasks */ public function filterByProject($project_ref) { // Get the project_id. $project = $this->engine->getProject($project_ref); $project_id = $project['id']; // Build a new array of tasks. $tasks = array(); foreach ($this as $task) { if ($task['project_id'] == $project_id) { $tasks[] = $task; } } return $this->factorySub($tasks); }
public function getProject($id) { return $this->engine->getProject($id); }