public function equals(Bug $bug) { if (strcmp($this->title, $bug->getTitle()) == 0 && strcmp($this->description, $bug->getDescription()) == 0 && strcmp($this->getStatus()->getName(), $bug->getStatus()->getName()) == 0 && $this->getUser()->equals($bug->getUser())) { return TRUE; } return FALSE; }
public function test_initialization() { $bug = new Bug(); $this->assertEqual($bug->getId(), 0); $this->assertEqual($bug->getStatus(), ''); $this->assertEqual($bug->getDescription(), ''); $this->assertEqual($bug->getCreated(), ''); $this->assertEqual($bug->getUpdated(), ''); }
public function getStatus() { $this->__load(); return parent::getStatus(); }
public function updateStatusById(Bug $bug, $id) { $update_params = array("title" => $bug->getTitle(), "description" => $bug->getDescription(), "status" => $bug->getStatus(), "user_id" => $bug->getUser()->getId()); return $this->status_access_object->update($this->generateUpdateString($update_params), $this->generateWhereString(array("id" => $id))); }
public function save(Bug $bug) { $params = array("title" => $bug->getTitle(), "description" => $bug->getDescription(), "status" => $bug->getStatus()->getNumber(), "user_id" => $bug->getUser()->getId()); $sql = $this->generateInsertString($this->table_name, $params); return $this->execute_query($sql, FALSE); }