public function testFilter() { $list = new Collection(array('one' => 1, 'two' => 2, 'three' => 3, 'four' => 4)); $this->assertNotNull($list->one); $this->assertNotNull($list->four); $list->filter('two', 'three'); $this->assertNull($list->one); $this->assertNull($list->four); $this->assertNotNull($list->two); $this->assertNotNull($list->three); }
public function register($request, $activation = false) { if ($request != null) { if (User::find()->count() == null) { $request[$this->tableName()]['GroupID'] = 1; } else { $request[$this->tableName()]['GroupID'] = 2; } $input = new Collection($request[$this->tableName()]); $input->filter('Username', 'Email', 'Password', 'GroupID'); return App::$user->register($input, $activation); } return false; }