We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 24935
    • 160 Posts
    I'm reading through xpdoobject.class.php to better understand how it works, and I saw something that looks wrong. In the code below, shouldn't owner default to 'local' if cardinality is 'many'?
        protected function _saveRelatedObject(& $obj, $fkMeta) {
            $saved= false;
            $local= $fkMeta['local'];
            $foreign= $fkMeta['foreign'];
            $cardinality= $fkMeta['cardinality'];
            $owner= isset ($fkMeta['owner']) ? $fkMeta['owner'] : '';
            if (!$owner) {
                $owner= $cardinality === 'many' ? 'foreign' : 'local';
            }
    


    Or is the documentation wrong?
    http://rtfm.modx.com/display/xPDO20/Defining+Relationships