mirror of
https://github.com/Karaka-Management/oms-ItemManagement.git
synced 2026-02-05 06:48:42 +00:00
Remove mapper abstract duplication
This commit is contained in:
parent
6304de5f8a
commit
6f51f45c3b
|
|
@ -67,44 +67,4 @@ class ItemMapper extends DataMapperAbstract
|
|||
],
|
||||
];
|
||||
|
||||
/**
|
||||
* 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) {
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user