protected static function _validateModel()
    {
        // check if model is already validate
        if (!isset(self::$_validationStatus[static::$_databaseName . static::$_tableName])) {

            // grab actual class name from late state binding
            $subClassName = get_class(new static());

            // check model OOP static structure is OK
            if (static::$_tableName === null) {
                throw new Exception($subClassName . '::$_tableName must be implemented');
            }
            if (static::$_primaryKey === null) {
                throw new Exception($subClassName . '::$_primaryKey must be implemented');
            }
            if (static::$_tableFields === null) {
                throw new Exception($subClassName . '::$_tableFields must be implemented');
            }
            if(in_array(static::$_primaryKey,static::$_tableFields)) {
                throw new Exception($subClassName . '::$_tableFields must not contain $_primaryKey');
            }
            // if user has implemented $_relations for this model, call the defineRelations() method
            if (static::$_relations !== null) {
                static::defineRelations();
            }

            // store model validation status
            self::$_validationStatus[static::$_databaseName . static::$_tableName] = true;
        }
    }
protected static function _validateModel()
    {
        // check if model is already validate
        if (!isset(self::$_validationStatus[static::$_databaseName . static::$_tableName])) {

            // grab actual class name from late state binding
            $subClassName = get_class(new static());

            // check model OOP static structure is OK
            if (static::$_tableName === null) {
                throw new Exception($subClassName . '::$_tableName must be implemented');
            }
            if (static::$_primaryKey === null) {
                throw new Exception($subClassName . '::$_primaryKey must be implemented');
            }
            if (static::$_tableFields === null) {
                throw new Exception($subClassName . '::$_tableFields must be implemented');
            }
            if(in_array(static::$_primaryKey,static::$_tableFields)) {
                throw new Exception($subClassName . '::$_tableFields must not contain $_primaryKey');
            }
            // if user has implemented $_relations for this model, call the defineRelations() method
            if (static::$_relations !== null) {
                static::defineRelations();
            }

            // store model validation status
            self::$_validationStatus[static::$_databaseName . static::$_tableName] = true;
        }
    }
protected static function _validateModel ( ) { // check if model is already validate if ( ! isset ( self :: $ _validationStatus [ static :: $ _databaseName . static :: $ _tableName ] ) ) { // grab actual class name from late state binding $ subClassName = get_class ( new static ( ) ) ; // check model OOP static structure is OK if ( static :: $ _tableName === null ) { throw new Exception ( $ subClassName . '::$_tableName must be implemented' ) ; } if ( static :: $ _primaryKey === null ) { throw new Exception ( $ subClassName . '::$_primaryKey must be implemented' ) ; } if ( static :: $ _tableFields === null ) { throw new Exception ( $ subClassName . '::$_tableFields must be implemented' ) ; } if ( in_array ( static :: $ _primaryKey , static :: $ _tableFields ) ) { throw new Exception ( $ subClassName . '::$_tableFields must not contain $_primaryKey' ) ; } // if user has implemented $_relations for this model, call the defineRelations() method if ( static :: $ _relations !== null ) { static :: defineRelations ( ) ; } // store model validation status self :: $ _validationStatus [ static :: $ _databaseName . static :: $ _tableName ] = true ; } }
Validate if this model is correctly implemented

@return void
@throws Exception
Validate if this model is correctly implemented