/** * Check if we can create a new instance of the ExObject * * @param CMbObject $host Host object * * @return bool */ function canCreateNew(CMbObject $host) { switch ($this->unicity) { default: case "no": return true; case "host": // Host $ex_object = new CExObject($this->_id); $ex_object->setObject($host); if ($ex_object->countMatchingList() > 0) { return false; } /* // Reférence 1 $ex_object = new CExObject($this->_id); $ex_object->setReferenceObject_1($host); if ($ex_object->countMatchingList() > 0) { return false; } // Référence 2 $ex_object = new CExObject($this->_id); $ex_object->setReferenceObject_2($host); if ($ex_object->countMatchingList() > 0) { return false; }*/ } return true; }