['name' => 'itemmgmt_item_id', 'type' => 'int', 'internal' => 'id'], 'itemmgmt_item_no' => ['name' => 'itemmgmt_item_no', 'type' => 'int', 'internal' => 'number'], 'itemmgmt_item_segment' => ['name' => 'itemmgmt_item_segment', 'type' => 'int', 'internal' => 'segment'], 'itemmgmt_item_productgroup' => ['name' => 'itemmgmt_item_productgroup', 'type' => 'int', 'internal' => 'productGroup'], 'itemmgmt_item_salesgroup' => ['name' => 'itemmgmt_item_salesgroup', 'type' => 'int', 'internal' => 'salesGroup'], 'itemmgmt_item_articlegroup' => ['name' => 'itemmgmt_item_articlegroup', 'type' => 'int', 'internal' => 'articleGroup'], 'itemmgmt_item_successor' => ['name' => 'itemmgmt_item_successor', 'type' => 'int', 'internal' => 'successor'], 'itemmgmt_item_info' => ['name' => 'itemmgmt_item_info', 'type' => 'string', 'internal' => 'info'], ]; /** * Primary table. * * @var string * @since 1.0.0 */ protected static $table = 'itemmgmt_item'; /** * Primary field name. * * @var string * @since 1.0.0 */ protected static $primaryField = 'itemmgmt_item_id'; protected static $hasMany = [ 'media' => [ 'mapper' => MediaMapper::class, /* mapper of the related object */ 'table' => 'itemmgmt_item_media', /* table of the related object, null if no relation table is used (many->1) */ 'dst' => 'itemmgmt_item_media_dst', 'src' => 'itemmgmt_item_media_src', ], ]; /** * 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; } /** * Get object. * * @param mixed $primaryKey Key * @param int $relations Load relations * @param mixed $fill Object to fill * * @return Client * * @since 1.0.0 */ public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null) { return parent::get($primaryKey, $relations, $fill); } }