/** * @param string $name * @throws DuplicationException * @throws \Exception * @return \Rocker\Object\ObjectInterface */ protected function createObject($name) { /* @var ObjectInterface $obj */ try { $this->db->prepare("INSERT INTO " . $this->tableName . " (`name`) VALUES (?)")->execute(array(trim($name))); } catch (\Exception $e) { $this->handlePossibleDuplication($e); } $objClass = $this->objectClassName(); $obj = new $objClass($name, $this->db->lastInsertId(), $this->objectTypeName()); $obj->setMeta(new MetaData(array())); return $obj; }