method getUniquePrimary documentation in bbn\Db\Languages\Sql

Return the unique primary key of the given table.

Example

X::dump($db->getUniquePrimary('table_users')); // (string) id function(string $table) { if (($keys = $this->getKeys($table)) && isset($keys['keys']['PRIMARY']) && (\count($keys['keys']['PRIMARY']['columns']) === 1) ) { return $keys['keys']['PRIMARY']['columns'][0]; } return null; }

Return the unique primary key of the given table. BBN is a suite of PHP and JS libraries and VueJS components - all open-source! bbn.io, build applications, the quick way

This website uses cookies to ensure you get the best experience on our website.