mirror of
https://github.com/Karaka-Management/oms-Media.git
synced 2026-02-18 10:18:41 +00:00
PhpUnit fixes
This commit is contained in:
parent
cad27a3891
commit
20caea6f6e
|
|
@ -69,14 +69,14 @@ class Collection extends Media
|
||||||
/**
|
/**
|
||||||
* Set sources.
|
* Set sources.
|
||||||
*
|
*
|
||||||
* @param int $source Source
|
* @param int|Media $source Source
|
||||||
*
|
*
|
||||||
* @return void
|
* @return void
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
* @author Dennis Eichhorn <d.eichhorn@oms.com>
|
||||||
*/
|
*/
|
||||||
public function addSource(int $source)
|
public function addSource($source)
|
||||||
{
|
{
|
||||||
$this->sources[] = $source;
|
$this->sources[] = $source;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -82,6 +82,11 @@ class MediaMapper extends DataMapperAbstract
|
||||||
{
|
{
|
||||||
try {
|
try {
|
||||||
$objId = parent::create($obj, $relations);
|
$objId = parent::create($obj, $relations);
|
||||||
|
|
||||||
|
if($objId === null || !is_scalar($objId)) {
|
||||||
|
return $objId;
|
||||||
|
}
|
||||||
|
|
||||||
$query = new Builder(self::$db);
|
$query = new Builder(self::$db);
|
||||||
$query->prefix(self::$db->getPrefix())
|
$query->prefix(self::$db->getPrefix())
|
||||||
->insert(
|
->insert(
|
||||||
|
|
@ -101,6 +106,8 @@ class MediaMapper extends DataMapperAbstract
|
||||||
|
|
||||||
self::$db->con->prepare($query->toSql())->execute();
|
self::$db->con->prepare($query->toSql())->execute();
|
||||||
} catch (\Exception $e) {
|
} catch (\Exception $e) {
|
||||||
|
var_dump($e->getMessage());
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user