Gc\User\Model::fromArray PHP Method

fromArray() public static method

Initiliaze from array
public static fromArray ( array $array ) : Model
$array array Data
return Model
    public static function fromArray(array $array)
    {
        $userTable = new Model();
        $userTable->setData($array);
        $userTable->unsetData('password');
        $userTable->setOrigData();
        return $userTable;
    }

Usage Example

コード例 #1
0
ファイル: AclTest.php プロジェクト: gotcms/gotcms
 /**
  * Sets up the fixture, for example, opens a network connection.
  * This method is called before a test is executed.
  *
  * @return void
  */
 protected function setUp()
 {
     $this->user = UserModel::fromArray(array('lastname' => 'User test', 'firstname' => 'User test', 'email' => '*****@*****.**', 'login' => 'test', 'user_acl_role_id' => 1));
     $this->user->setPassword('test');
     $this->user->save();
     $this->object = new Acl($this->user);
 }
All Usage Examples Of Gc\User\Model::fromArray