public function setData($data)
    {
        if ($data instanceof Collection || $data instanceof Model) {
            $this->data = $data->toArray();
        } elseif (is_array($data) || $data instanceof Repository) {
            $this->data = $data;
        } else {
            throw new \InvalidArgumentException('Data must be an array, a Collection, a Model or a Repository');
        }
    }
public function setData($data)
    {
        if ($data instanceof Collection || $data instanceof Model) {
            $this->data = $data->toArray();
        } elseif (is_array($data) || $data instanceof Repository) {
            $this->data = $data;
        } else {
            throw new \InvalidArgumentException('Data must be an array, a Collection, a Model or a Repository');
        }
    }
public function setData ( $ data ) { if ( $ data instanceof Collection || $ data instanceof Model ) { $ this -> data = $ data -> toArray ( ) ; } elseif ( is_array ( $ data ) || $ data instanceof Repository ) { $ this -> data = $ data ; } else { throw new \ InvalidArgumentException ( 'Data must be an array, a Collection, a Model or a Repository' ) ; } }
Set the form current values.

@param array|object $data The form values
Set the form current values .