protected function _newId($primary)
    {
        if (!$primary || count((array)$primary) > 1) {
            return null;
        }
        $typeName = $this->getSchema()->getColumnType($primary[0]);
        $type = Type::build($typeName);

        return $type->newId();
    }
protected function _newId($primary)
    {
        if (!$primary || count((array)$primary) > 1) {
            return null;
        }
        $typeName = $this->getSchema()->getColumnType($primary[0]);
        $type = Type::build($typeName);

        return $type->newId();
    }
protected function _newId ( $ primary ) { if ( ! $ primary || count ( ( array ) $ primary ) > 1 ) { return null ; } $ typeName = $ this -> getSchema ( ) -> getColumnType ( $ primary [ 0 ] ) ; $ type = Type :: build ( $ typeName ) ; return $ type -> newId ( ) ; }
Generate a primary key value for a new record.

By default, this uses the type system to generate a new primary key
value if possible. You can override this method if you have specific requirements
for id generation.

Note: The ORM will not generate primary key values for composite primary keys.
You can overwrite _newId() in your table class.

@param array $primary The primary key columns to get a new ID for.
@return null|string|array Either null or the primary key value or a list of primary key values.
Generate a primary key value for a new record .