* @copyright 2018 Areama * @license http://opensource.org/licenses/afl-3.0.php Academic Free License (AFL 3.0) * International Registered Trademark & Property of Areama */ abstract class ArSeoProTableAbstract extends ObjectModel { public static function installTable() { return true; } /** * Checks if object field values are valid before database interaction * * @param bool $die * @param bool $error_return * * @return bool|string True, false or error message. * @throws PrestaShopException */ public function validateFields($die = true, $error_return = false) { $errors = array(); foreach ($this->def['fields'] as $field => $data) { if (!empty($data['lang'])) { continue; } if (is_array($this->update_fields) && empty($this->update_fields[$field]) && isset($this->def['fields'][$field]['shop']) && $this->def['fields'][$field]['shop']) { continue; } $message = $this->validateField($field, $this->$field, null, array(), true); if ($message !== true) { if ($die) { throw new PrestaShopException($message); } $errors[$field] = $message; } } if ($errors && $error_return) { return $errors; } return true; } }