public function getPrimaryKeyIndex()
    {
        $database = DatabaseLayer::getInstance();

        $columns = array();

        if ($this instanceof VersionedActiveRecord) {
            $schema = $this->getClassSchema();
            $firstColumn = reset($schema)['name'];
            $columns = [$firstColumn => $firstColumn, "sequence" => "sequence"];
        } else {
            foreach ($database->getTableIndexes($this->_table) as $key) {
                $columns[$key->Column_name] = $key->Column_name;
            }
        }

        return array_values($columns);
    }
public function getPrimaryKeyIndex()
    {
        $database = DatabaseLayer::getInstance();

        $columns = array();

        if ($this instanceof VersionedActiveRecord) {
            $schema = $this->getClassSchema();
            $firstColumn = reset($schema)['name'];
            $columns = [$firstColumn => $firstColumn, "sequence" => "sequence"];
        } else {
            foreach ($database->getTableIndexes($this->_table) as $key) {
                $columns[$key->Column_name] = $key->Column_name;
            }
        }

        return array_values($columns);
    }
public function getPrimaryKeyIndex ( ) { $ database = DatabaseLayer :: getInstance ( ) ; $ columns = array ( ) ; if ( $ this instanceof VersionedActiveRecord ) { $ schema = $ this -> getClassSchema ( ) ; $ firstColumn = reset ( $ schema ) [ 'name' ] ; $ columns = [ $ firstColumn => $ firstColumn , "sequence" => "sequence" ] ; } else { foreach ( $ database -> getTableIndexes ( $ this -> _table ) as $ key ) { $ columns [ $ key -> Column_name ] = $ key -> Column_name ; } } return array_values ( $ columns ) ; }
Get a unique key to use as an index

@return string[]
Get a unique key to use as an index