['name' => 'support_ticket_id', 'type' => 'int', 'internal' => 'id'], 'support_ticket_task' => ['name' => 'support_ticket_task', 'type' => 'int', 'internal' => 'task'], ]; /** * Has one relation. * * @var array * @since 1.0.0 */ protected static $ownsOne = [ 'task' => [ 'mapper' => TaskMapper::class, 'src' => 'support_ticket_task', ], ]; /** * Primary table. * * @var string * @since 1.0.0 */ protected static $table = 'support_ticket'; /** * Primary field name. * * @var string * @since 1.0.0 */ protected static $primaryField = 'support_ticket_id'; /** * Create object. * * @param mixed $obj Object * @param int $relations Behavior for relations creation * * @return mixed * * @since 1.0.0 */ public static function create($obj, int $relations = RelationType::ALL) { try { $objId = parent::create($obj, $relations); if ($objId === null || !is_scalar($objId)) { return $objId; } } catch (\Exception $e) { var_dump($e->getMessage()); return false; } return $objId; } }