Remove mapper abstract duplication

This commit is contained in:
Dennis Eichhorn 2017-11-08 21:18:31 +01:00
parent 19fa3672e0
commit 5f14c0a456
4 changed files with 1 additions and 74 deletions

View File

@ -85,31 +85,6 @@ class AccountMapper extends DataMapperAbstract
*/
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.
*
@ -174,7 +149,7 @@ class AccountMapper extends DataMapperAbstract
* @param int $relations Load relations
* @param mixed $fill Object to fill
*
* @return Account
* @return Account|array
*
* @since 1.0.0
*/

View File

@ -54,20 +54,4 @@ class AccountPermissionMapper extends DataMapperAbstract
* @since 1.0.0
*/
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);
}
}

View File

@ -57,20 +57,4 @@ class GroupMapper extends DataMapperAbstract
* @since 1.0.0
*/
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);
}
}

View File

@ -46,20 +46,4 @@ class ModuleMapper extends DataMapperAbstract
* @since 1.0.0
*/
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);
}
}