public function addField($name, $dataType = "varchar(255)")
    {
        if ($name == "") {
            throw new Exception("Field name cannot be empty.");
        }

        // Check if the name whether is satisfied
        if (ctype_upper($name[0])) {
            throw new Exception("Field name cannot start with upper-case.");
        }

        $this->fieldList[$name] = new Field($this, $name, $dataType);
    }
public function addField($name, $dataType = "varchar(255)")
    {
        if ($name == "") {
            throw new Exception("Field name cannot be empty.");
        }

        // Check if the name whether is satisfied
        if (ctype_upper($name[0])) {
            throw new Exception("Field name cannot start with upper-case.");
        }

        $this->fieldList[$name] = new Field($this, $name, $dataType);
    }
public function addField ( $ name , $ dataType = "varchar(255)" ) { if ( $ name == "" ) { throw new Exception ( "Field name cannot be empty." ) ; } // Check if the name whether is satisfied if ( ctype_upper ( $ name [ 0 ] ) ) { throw new Exception ( "Field name cannot start with upper-case." ) ; } $ this -> fieldList [ $ name ] = new Field ( $ this , $ name , $ dataType ) ; }
Create a field with a name
@param $name
@param string $dataType it can be varchar/int/text
@throws Exception
Create a field with a name