protected function setFields()
    {
        $this->set = new \stdClass();
        $schema    = $this->schema();

        foreach ($schema as $field => $type)
        {
            if (Helpers\Validate::isNumeric($type) && $field != 'id')
            {
                $this->setField($field, 0);
            }
            else
            {
                $this->setField($field, null);
            }
        }
    }
protected function setFields()
    {
        $this->set = new \stdClass();
        $schema    = $this->schema();

        foreach ($schema as $field => $type)
        {
            if (Helpers\Validate::isNumeric($type) && $field != 'id')
            {
                $this->setField($field, 0);
            }
            else
            {
                $this->setField($field, null);
            }
        }
    }
protected function setFields ( ) { $ this -> set = new \ stdClass ( ) ; $ schema = $ this -> schema ( ) ; foreach ( $ schema as $ field => $ type ) { if ( Helpers \ Validate :: isNumeric ( $ type ) && $ field != 'id' ) { $ this -> setField ( $ field , 0 ) ; } else { $ this -> setField ( $ field , null ) ; } } }
Setting fields with default values
@uses \Lazer\Classes\Helpers\Validate::isNumeric() to check if type of field is numeric
Setting fields with default values