mirror of
https://github.com/Karaka-Management/oms-Admin.git
synced 2026-02-16 20:38:41 +00:00
Remove mapper abstract duplication
This commit is contained in:
parent
19fa3672e0
commit
5f14c0a456
|
|
@ -85,31 +85,6 @@ class AccountMapper extends DataMapperAbstract
|
||||||
*/
|
*/
|
||||||
protected static $createdAt = 'account_created_at';
|
protected static $createdAt = 'account_created_at';
|
||||||
|
|
||||||
/**
|
|
||||||
* 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;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Login user.
|
* Login user.
|
||||||
*
|
*
|
||||||
|
|
@ -174,7 +149,7 @@ class AccountMapper extends DataMapperAbstract
|
||||||
* @param int $relations Load relations
|
* @param int $relations Load relations
|
||||||
* @param mixed $fill Object to fill
|
* @param mixed $fill Object to fill
|
||||||
*
|
*
|
||||||
* @return Account
|
* @return Account|array
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
|
|
|
||||||
|
|
@ -54,20 +54,4 @@ class AccountPermissionMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $primaryField = 'account_permission_id';
|
protected static $primaryField = 'account_permission_id';
|
||||||
|
|
||||||
/**
|
|
||||||
* Get object.
|
|
||||||
*
|
|
||||||
* @param mixed $primaryKey Key
|
|
||||||
* @param int $relations Load relations
|
|
||||||
* @param mixed $fill Object to fill
|
|
||||||
*
|
|
||||||
* @return Group
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
|
||||||
{
|
|
||||||
return parent::get($primaryKey, $relations, $fill);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -57,20 +57,4 @@ class GroupMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $createdAt = 'group_created';
|
protected static $createdAt = 'group_created';
|
||||||
|
|
||||||
/**
|
|
||||||
* Get object.
|
|
||||||
*
|
|
||||||
* @param mixed $primaryKey Key
|
|
||||||
* @param int $relations Load relations
|
|
||||||
* @param mixed $fill Object to fill
|
|
||||||
*
|
|
||||||
* @return Group
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
|
||||||
{
|
|
||||||
return parent::get($primaryKey, $relations, $fill);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -46,20 +46,4 @@ class ModuleMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $primaryField = 'module_id';
|
protected static $primaryField = 'module_id';
|
||||||
|
|
||||||
/**
|
|
||||||
* Get object.
|
|
||||||
*
|
|
||||||
* @param mixed $primaryKey Key
|
|
||||||
* @param int $relations Load relations
|
|
||||||
* @param mixed $fill Object to fill
|
|
||||||
*
|
|
||||||
* @return Group
|
|
||||||
*
|
|
||||||
* @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