src/Titon/Db/Repository.php
public function getPrimaryKey() {
        return $this->cache(__METHOD__, function() {
            $pk = $this->getConfig('primaryKey');
            $schema = $this->getSchema();

            if ($schema->hasColumn($pk)) {
                return $pk;
            }

            if ($pk = $schema->getPrimaryKey()) {
                return $pk['columns'][0];
            }

            return 'id';
        });
    }
public function getPrimaryKey() {
        return $this->cache(__METHOD__, function() {
            $pk = $this->getConfig('primaryKey');
            $schema = $this->getSchema();

            if ($schema->hasColumn($pk)) {
                return $pk;
            }

            if ($pk = $schema->getPrimaryKey()) {
                return $pk['columns'][0];
            }

            return 'id';
        });
    }
public function getPrimaryKey ( ) { return $ this -> cache ( __METHOD__ , function ( ) { $ pk = $ this -> getConfig ( 'primaryKey' ) ; $ schema = $ this -> getSchema ( ) ; if ( $ schema -> hasColumn ( $ pk ) ) { return $ pk ; } if ( $ pk = $ schema -> getPrimaryKey ( ) ) { return $ pk [ 'columns' ] [ 0 ] ; } return 'id' ; } ) ; }
Return the field used as the primary, usually the ID.

@return string
Return the field used as the primary usually the ID .