public function getTableName($type = 'plural')
    {
        if ($type == 'plural') {
            if (isset($this->pluralTableName)) {
                return $this->pluralTableName;
            } else {
                $this->pluralTableName = $this->getSource();
                return $this->pluralTableName;
            }
        }

        if ($type == 'singular') {
            if (isset($this->singularTableName)) {
                return $this->singularTableName;
            } else {
                $tableName = $this->getTableName('plural');
                // not the smartest way to make a value singular
                $this->singularTableName = substr($tableName, 0, strlen($tableName) - 1);
                return $this->singularTableName;
            }
        }
    }
public function getTableName($type = 'plural')
    {
        if ($type == 'plural') {
            if (isset($this->pluralTableName)) {
                return $this->pluralTableName;
            } else {
                $this->pluralTableName = $this->getSource();
                return $this->pluralTableName;
            }
        }

        if ($type == 'singular') {
            if (isset($this->singularTableName)) {
                return $this->singularTableName;
            } else {
                $tableName = $this->getTableName('plural');
                // not the smartest way to make a value singular
                $this->singularTableName = substr($tableName, 0, strlen($tableName) - 1);
                return $this->singularTableName;
            }
        }
    }
public function getTableName ( $ type = 'plural' ) { if ( $ type == 'plural' ) { if ( isset ( $ this -> pluralTableName ) ) { return $ this -> pluralTableName ; } else { $ this -> pluralTableName = $ this -> getSource ( ) ; return $ this -> pluralTableName ; } } if ( $ type == 'singular' ) { if ( isset ( $ this -> singularTableName ) ) { return $ this -> singularTableName ; } else { $ tableName = $ this -> getTableName ( 'plural' ) ; // not the smartest way to make a value singular $ this -> singularTableName = substr ( $ tableName , 0 , strlen ( $ tableName ) - 1 ) ; return $ this -> singularTableName ; } } }
default behavior is to expect plural table names in schema

@todo maybe we should be on the safe side and verify the argument, or return an error in the end if nothing happens?
@param string $type
@return string
default behavior is to expect plural table names in schema