/** * Add a comment * * @throws lang.IllegalArgumentException * @throws rdbms.SQLException * @return bool */ public function add() { // Check if all needed params are given if (empty($this->bug_id) or empty($this->user_id) or empty($this->comment)) { throw new IllegalArgumentException('Too few arguments given'); } with($desc = new BugzillaLongDescs()); $desc->setBug_id($this->bug_id); $desc->setBug_when(Date::now()); $desc->setThetext($this->comment); $desc->setWho($this->user_id); $desc->insert(); return TRUE; }
/** * Gets an instance of this object by index "bug_when" * * @param util.Date bug_when * @return &BugzillaLongDescs[] object * @throws rdbms.SQLException in case an error occurs */ public function getByBug_when($bug_when) { $peer = BugzillaLongDescs::getPeer(); return $peer->doSelect(new Criteria(array('bug_when', $bug_when, EQUAL))); }