['name' => 'comments_list_id', 'type' => 'int', 'internal' => 'id'], ]; /** * Has many relation. * * @var array * @since 1.0.0 */ protected static $hasMany = [ 'comments' => [ 'mapper' => CommentMapper::class, 'table' => 'comments_comment', 'dst' => 'comments_comment_list', 'src' => null, ], ]; /** * Primary table. * * @var string * @since 1.0.0 */ protected static $table = 'comments_list'; /** * Primary field name. * * @var string * @since 1.0.0 */ protected static $primaryField = 'comments_list_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; } }