mirror of
https://github.com/Karaka-Management/oms-RiskManagement.git
synced 2026-01-11 19:38:40 +00:00
Remove mapper abstract duplication
This commit is contained in:
parent
cfac79a2fd
commit
beb5c94c1b
|
|
@ -54,44 +54,4 @@ class CategoryMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $primaryField = 'riskmngmt_category_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 Cause
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
||||
{
|
||||
return parent::get($primaryKey, $relations, $fill);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -69,44 +69,4 @@ class CauseMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $primaryField = 'riskmngmt_cause_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 Cause
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
||||
{
|
||||
return parent::get($primaryKey, $relations, $fill);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,44 +64,4 @@ class DepartmentMapper 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 Cause
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
||||
{
|
||||
return parent::get($primaryKey, $relations, $fill);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -67,44 +67,4 @@ class ProcessMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $primaryField = 'riskmngmt_process_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 Cause
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
||||
{
|
||||
return parent::get($primaryKey, $relations, $fill);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -64,44 +64,4 @@ class ProjectMapper 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 Cause
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
||||
{
|
||||
return parent::get($primaryKey, $relations, $fill);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -116,44 +116,4 @@ class RiskMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $primaryField = 'riskmngmt_risk_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 supplier
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
||||
{
|
||||
return parent::get($primaryKey, $relations, $fill);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -60,44 +60,4 @@ class RiskObjectMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $primaryField = 'riskmngmt_risk_object_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 Cause
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function get($primaryKey, int $relations = RelationType::ALL, $fill = null)
|
||||
{
|
||||
return parent::get($primaryKey, $relations, $fill);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -65,44 +65,4 @@ class SolutionMapper extends DataMapperAbstract
|
|||
*/
|
||||
protected static $primaryField = 'riskmngmt_solution_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 Cause
|
||||
*
|
||||
* @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