private function checkRequiredCustomPropsBeforeSave($custom_props) { $errors = array(); if (is_array($custom_props)) { foreach ($custom_props as $id => $value) { $cp = CustomProperties::findById($id); if (!$cp) { continue; } if ($cp->getIsRequired() && $value == '') { $errors[] = lang('custom property value required', $cp->getName()); } } } return $errors; }