private static function getPrimaryKey(Criteria $criteria)
    {
        // Assume all the keys are for the same table.
        $keys = $criteria->keys();
        $key = $keys[0];
        $table = $criteria->getTableName($key);

        $pk = null;

        if (!empty($table)) {

            $dbMap = Propel::getDatabaseMap($criteria->getDbName());

            $pks = $dbMap->getTable($table)->getPrimaryKeys();
            if (!empty($pks)) {
                $pk = array_shift($pks);
            }
        }

        return $pk;
    }
private static function getPrimaryKey(Criteria $criteria)
    {
        // Assume all the keys are for the same table.
        $keys = $criteria->keys();
        $key = $keys[0];
        $table = $criteria->getTableName($key);

        $pk = null;

        if (!empty($table)) {

            $dbMap = Propel::getDatabaseMap($criteria->getDbName());

            $pks = $dbMap->getTable($table)->getPrimaryKeys();
            if (!empty($pks)) {
                $pk = array_shift($pks);
            }
        }

        return $pk;
    }
private static function getPrimaryKey ( Criteria $ criteria ) { // Assume all the keys are for the same table. $ keys = $ criteria -> keys ( ) ; $ key = $ keys [ 0 ] ; $ table = $ criteria -> getTableName ( $ key ) ; $ pk = null ; if ( ! empty ( $ table ) ) { $ dbMap = Propel :: getDatabaseMap ( $ criteria -> getDbName ( ) ) ; $ pks = $ dbMap -> getTable ( $ table ) -> getPrimaryKeys ( ) ; if ( ! empty ( $ pks ) ) { $ pk = array_shift ( $ pks ) ; } } return $ pk ; }
Helper method which returns the primary key contained
in the given Criteria object.

@param Criteria $criteria A Criteria.

@return ColumnMap       If the Criteria object contains a primary key, or null if it doesn't.
@throws PropelException
Helper method which returns the primary key contained in the given Criteria object .