mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-15 11:38:40 +00:00
Remove unused function
This commit is contained in:
parent
acb32ba190
commit
766b79cfd3
|
|
@ -874,7 +874,7 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
return $value->serialize();
|
||||
} elseif ($value instanceof \JsonSerializable) {
|
||||
return (string) \json_encode($value->jsonSerialize());
|
||||
} elseif (\is_object($value) && method_exists($value, 'getId')) {
|
||||
} elseif (\is_object($value) && \method_exists($value, 'getId')) {
|
||||
return $value->getId();
|
||||
}
|
||||
|
||||
|
|
@ -2862,31 +2862,6 @@ class DataMapperAbstract implements DataMapperInterface
|
|||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Check if model exists in database
|
||||
*
|
||||
* @param mixed $id Object id
|
||||
*
|
||||
* @return bool
|
||||
*
|
||||
* @since 1.0.0
|
||||
*/
|
||||
public static function exists($id) : bool
|
||||
{
|
||||
$query = $query ?? new Builder(self::$db);
|
||||
$query->prefix(self::$db->getPrefix())
|
||||
->select(static::$primaryField)
|
||||
->from(static::$table)
|
||||
->where(static::$primaryField, '=', $id);
|
||||
|
||||
$sth = self::$db->con->prepare($query->toSql());
|
||||
$sth->execute();
|
||||
|
||||
$results = $sth->fetchAll(\PDO::FETCH_ASSOC);
|
||||
|
||||
return $results && \count($results) === 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Find database column name by member name
|
||||
*
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user