public function beforeSave() { // Проверяем наличие пользователя if (!$this->object->get('contractor') && !$this->object->getOne('Contractor')) { $error = "У заказа отсутствует контрагент"; $this->modx->log(xPDO::LOG_LEVEL_ERROR, "[- Billing -] [- " . __CLASS__ . " -] {$error}"); $this->modx->log(xPDO::LOG_LEVEL_ERROR, print_r($this->getProperties(), true)); return $error; } return parent::beforeSave(); }