mirror of
https://github.com/Karaka-Management/oms-Profile.git
synced 2026-02-16 07:18:41 +00:00
Remove mapper abstract duplication
This commit is contained in:
parent
2029ab5b01
commit
6d5085a530
|
|
@ -55,44 +55,4 @@ class AddressMapper extends DataMapperAbstract
|
||||||
*/
|
*/
|
||||||
protected static $primaryField = 'profile_address_id';
|
protected static $primaryField = 'profile_address_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) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $objId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get object.
|
|
||||||
*
|
|
||||||
* @param mixed $primaryKey Key
|
|
||||||
* @param int $relations Load relations
|
|
||||||
* @param mixed $fill Object to fill
|
|
||||||
*
|
|
||||||
* @return Account
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
|
||||||
{
|
|
||||||
return parent::get($primaryKey, $relations, $fill);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -47,44 +47,4 @@ class ContactElementMapper extends DataMapperAbstract
|
||||||
*/
|
*/
|
||||||
protected static $primaryField = 'profile_contact_id';
|
protected static $primaryField = 'profile_contact_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) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $objId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get object.
|
|
||||||
*
|
|
||||||
* @param mixed $primaryKey Key
|
|
||||||
* @param int $relations Load relations
|
|
||||||
* @param mixed $fill Object to fill
|
|
||||||
*
|
|
||||||
* @return Account
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
|
||||||
{
|
|
||||||
return parent::get($primaryKey, $relations, $fill);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -91,44 +91,4 @@ class ProfileMapper extends DataMapperAbstract
|
||||||
*/
|
*/
|
||||||
protected static $primaryField = 'profile_account_id';
|
protected static $primaryField = 'profile_account_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) {
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return $objId;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get object.
|
|
||||||
*
|
|
||||||
* @param mixed $primaryKey Key
|
|
||||||
* @param int $relations Load relations
|
|
||||||
* @param mixed $fill Object to fill
|
|
||||||
*
|
|
||||||
* @return Account
|
|
||||||
*
|
|
||||||
* @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