function test_same_data_returns_same_object() { $criteria = new TActiveRecordCriteria('username = ?', 'admin'); $finder = new UserRecord(); $finder->OnCreateCommand[] = array($this, 'logger'); $finder->OnExecuteCommand[] = array($this, 'logger'); $user1 = $finder->find($criteria); //var_dump($user1); //var_dump(UserRecord::finder()->find($criteria)); }
public function destroy() { $user_record = UserRecord::find($this->params()->id); if ($this->current_user->is_mod_or_higher() || $this->current_user->id == $user_record->reported_by) { $user_record->destroy(); $this->respond_to_success("Record updated", ["#index", 'user_id' => $this->params()->id]); } else { $this->access_denied(); } }