getProperties($object, function ($value){ return (is_string($value)) ? $this->mysql->escapeStr($value) : $value; }); if(static::DEBUG) dd($object, $in, $table); try { if (!empty($object->getId()) && !empty($this->mysql->findById($table, $object->getId()))) { $this->mysql->updateById($table, $in, $object->getId()); return $object->getId(); } else { $this->mysql->insert($table, $in); return (is_string($object->getId())) ? $object->getId() : $this->mysql->mysql()->insert_id; } } catch (\Throwable $throwable) {throw new RepositoryException($throwable->getMessage());} } }