/** * @see parent::check() */ function check() { if ($msg = parent::check()) { return $msg; } if ($this->location_id) { $this->completeField("object_id", "object_class"); $location = $this->loadRefLocation(); if ($location->object_class !== $this->object_class || $location->object_id != $this->object_id) { return "Le stock doit être associé à un emplacement de '" . $this->loadTargetObject() . "'"; } } return null; }