/** * Insert data * * @param type $data * @return int */ public function insert($data = NULL) { if ($id = parent::insert($data)) { $this->branching(); parent::update(array($this->thread_field => $this->{$this->thread_field}, $this->level_field => $this->{$this->level_field})); } return $id; }
/** * Create new post * * @param type $data */ public function insert($data = NULL) { $data or $data = $this->object()->toArray(); if (NULL === session('converter.adapter')) { $data['created_date'] = time(); $data['ip'] = cogear()->session->get('ip'); $data['last_update'] = time(); $data['aid'] = cogear()->user->id; } if ($result = parent::insert($data)) { event('post.insert', $this, $data, $result); } return $result; }
/** * */ public function insert($data = NULL) { if ($result = parent::insert($data)) { event('user.insert', $this, $data, $result); } return $result; }