protected function assignFields($fields)
    {
        foreach ($fields as $field) {
            if (!$field instanceof FieldInterface) {
                throw new ModelException(sprintf('Field must be an instance of FieldInterface, got "%s"', $this->getType($field)));
            }

            $field->table($this->table);
            $this->fields[$field->name()] = $field;
        }
    }
protected function assignFields($fields)
    {
        foreach ($fields as $field) {
            if (!$field instanceof FieldInterface) {
                throw new ModelException(sprintf('Field must be an instance of FieldInterface, got "%s"', $this->getType($field)));
            }

            $field->table($this->table);
            $this->fields[$field->name()] = $field;
        }
    }
protected function assignFields ( $ fields ) { foreach ( $ fields as $ field ) { if ( ! $ field instanceof FieldInterface ) { throw new ModelException ( sprintf ( 'Field must be an instance of FieldInterface, got "%s"' , $ this -> getType ( $ field ) ) ) ; } $ field -> table ( $ this -> table ) ; $ this -> fields [ $ field -> name ( ) ] = $ field ; } }
Assigns fields to model

@param array $fields

@throws ModelException
Assigns fields to model