/** * * {@inheritDoc} * * @see \Spark\Project\DataMapper\MapperAbstract::insert() */ protected function insert(ModelAbstract $model) { //todo: make this more automatic $values = ['manager_id' => (int) $model->getManagerId(), 'employee_id' => (int) $model->getEmployeeId(), 'break' => floatval($model->getBreak()), 'start_time' => $model->getStartTime(), 'end_time' => $model->getEndTime(), 'created_at' => new \FluentLiteral('NOW()'), 'updated_at' => new \FluentLiteral('NOW()')]; return $this->fpdo->insertInto('shifts')->values($values)->execute(); }