mirror of
https://github.com/Karaka-Management/oms-Knowledgebase.git
synced 2026-02-13 00:38:41 +00:00
Remove mapper abstract duplication
This commit is contained in:
parent
008528d0fc
commit
4a5160aac4
|
|
@ -57,30 +57,4 @@ class WikiBadgeMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $primaryField = 'wiki_badge_id';
|
protected static $primaryField = 'wiki_badge_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -58,30 +58,4 @@ class WikiCategoryMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $primaryField = 'wiki_category_id';
|
protected static $primaryField = 'wiki_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -99,30 +99,4 @@ class WikiDocMapper extends DataMapperAbstract
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
protected static $primaryField = 'wiki_article_id';
|
protected static $primaryField = 'wiki_article_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;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user