/** * Creates new entry * * @param Tinebase_Record_Interface $_record * @return Tinebase_Record_Interface * @throws Tinebase_Exception_InvalidArgument * @throws Tinebase_Exception_UnexpectedValue * * @todo remove autoincremental ids later */ public function create(Tinebase_Record_Interface $_record) { parent::create($_record); $taskParts = $this->_seperateTaskData($_record); $this->_insertDependentRows($taskParts); return $this->get($_record->getId()); }
/** * Creates new entry * * @param Tinebase_Record_Interface $_record * @return Tinebase_Record_Interface * @throws Tinebase_Exception_InvalidArgument * @throws Tinebase_Exception_UnexpectedValue */ public function create(Tinebase_Record_Interface $_record) { $contact = parent::create($_record); if (!empty($_record->jpegphoto)) { $contact->jpegphoto = $this->_saveImage($contact->getId(), $_record->jpegphoto); } return $contact; }
/** * Creates new entry * * @param Tinebase_Record_Interface $_record * @return Tinebase_Record_Interface * @throws Tinebase_Exception_Database * @throws Tinebase_Exception */ public function create(Tinebase_Record_Interface $_record) { try { $newEntry = parent::create($_record); Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . 'Successfully added new schedule task on database system.'); return $newEntry; } catch (Tinebase_Exception_Backend_Database $ex) { Tinebase_Core::getLogger()->error(__METHOD__ . '::' . __LINE__ . 'Database insertion fails at backend unit: ' . print_r($ex, true)); return $ex->getMessage(); } }
/** * Creates new entry * * @param Tinebase_Record_Interface $_record * @return Tinebase_Record_Interface * @throws Tinebase_Exception_InvalidArgument * @throws Tinebase_Exception_UnexpectedValue * * @todo remove autoincremental ids later */ public function create(Tinebase_Record_Interface $_record) { if ($_record->rrule) { $_record->rrule = (string) $_record->rrule; } $_record->rrule = !empty($_record->rrule) ? $_record->rrule : NULL; $_record->recurid = !empty($_record->recurid) ? $_record->recurid : NULL; $event = parent::create($_record); $this->_saveExdates($_record); //$this->_saveAttendee($_record); return $this->get($event->getId()); }
/** * Creates new entry * * @param Tinebase_Record_Interface $_record * @return Tinebase_Record_Interface * @throws Tinebase_Exception_InvalidArgument * @throws Tinebase_Exception_UnexpectedValue */ public function create(Tinebase_Record_Interface $_record) { if ($_record->rrule) { $_record->rrule = (string) $_record->rrule; } $_record->rrule = !empty($_record->rrule) ? $_record->rrule : NULL; $_record->recurid = !empty($_record->recurid) ? $_record->recurid : NULL; $_record->rrule_constraints = $_record->rrule_constraints instanceof Calendar_Model_EventFilter ? json_encode($_record->rrule_constraints->toArray()) : NULL; $event = parent::create($_record); $this->_saveExdates($_record); //$this->_saveAttendee($_record); return $this->get($event->getId()); }
/** * Creates new entry * * @param Tinebase_Record_Interface $_record * @return Tinebase_Record_Interface * @throws Tinebase_Exception_UnexpectedValue */ public function create(Tinebase_Record_Interface $_record) { // check if personal only and account type=anyone -> throw exception if ($_record->personal_only && $_record->account_type == Tinebase_Acl_Rights::ACCOUNT_TYPE_ANYONE) { $message = 'It is not allowed to set this preference for anyone.'; Tinebase_Core::getLogger()->err(__METHOD__ . '::' . __LINE__ . ' ' . $message); throw new Tinebase_Exception_UnexpectedValue($message); } return parent::create($_record); }