getPK
Last updated Apr 6th, 2019 | Page history | Improve this page | Report an issue
xPDOObject::getPK()¶
Gets the name (or names) of the primary key field(s) for the object.
Syntax¶
API Docs: http://api.modxcms.com/xpdo/om/xPDOObject.html#getPK
mixed getPK ()
Example¶
Get the PK of a Person object, who's PK field is 'id'.
$person = $xpdo->getObject('Person',1);
$pk = $person->getPK();
echo $pk;
// prints "id"