protected function doInsert(\woo\domain\DomainObject $object) { $space = $object->getSpace(); if (!$space) { throw new \woo\base\AppException("cannot save without space"); } $values = array($object->getstart(), $object->getduration(), $space->getId(), $object->getname()); $this->insertStmt->execute($values); }
function newUpdate(\woo\domain\DomainObject $obj) { // not type checking removed $id = $obj->getId(); $cond = null; $values['name'] = $obj->getName(); $values['space'] = $obj->getSpace()->getId(); if ($id > -1) { $cond['id'] = $id; } return $this->buildStatement("event", $values, $cond); }