mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-02-11 06:28:40 +00:00
fix formatting/debugging
This commit is contained in:
parent
333741d1ef
commit
9272af316b
|
|
@ -2563,6 +2563,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
* @param string $order Order of the elements
|
* @param string $order Order of the elements
|
||||||
* @param int $relations Load relations
|
* @param int $relations Load relations
|
||||||
* @param int $depth Relation depth
|
* @param int $depth Relation depth
|
||||||
|
* @param Builder $query Query
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
|
|
@ -2574,10 +2575,11 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
int $limit = 50,
|
int $limit = 50,
|
||||||
string $order = 'ASC',
|
string $order = 'ASC',
|
||||||
int $relations = RelationType::ALL,
|
int $relations = RelationType::ALL,
|
||||||
int $depth = 3
|
int $depth = 3,
|
||||||
|
Builder $query = null
|
||||||
) : array
|
) : array
|
||||||
{
|
{
|
||||||
$query = self::getQuery(depth: $depth);
|
$query ??= self::getQuery(depth: $depth);
|
||||||
$query->where(static::$table . '_' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '>', $pivot)
|
$query->where(static::$table . '_' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '>', $pivot)
|
||||||
->orderBy(static::$table . '_' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), $order)
|
->orderBy(static::$table . '_' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), $order)
|
||||||
->limit($limit);
|
->limit($limit);
|
||||||
|
|
@ -2594,6 +2596,7 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
* @param string $order Order of the elements
|
* @param string $order Order of the elements
|
||||||
* @param int $relations Load relations
|
* @param int $relations Load relations
|
||||||
* @param int $depth Relation depth
|
* @param int $depth Relation depth
|
||||||
|
* @param Builder $query Query
|
||||||
*
|
*
|
||||||
* @return array
|
* @return array
|
||||||
*
|
*
|
||||||
|
|
@ -2609,10 +2612,11 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
int $limit = 50,
|
int $limit = 50,
|
||||||
string $order = 'ASC',
|
string $order = 'ASC',
|
||||||
int $relations = RelationType::ALL,
|
int $relations = RelationType::ALL,
|
||||||
int $depth = 3
|
int $depth = 3,
|
||||||
|
Builder $query = null
|
||||||
) : array
|
) : array
|
||||||
{
|
{
|
||||||
$query = self::getQuery();
|
$query ??= self::getQuery(depth: $depth);
|
||||||
$query->where(static::$table . '_' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '<', $pivot)
|
$query->where(static::$table . '_' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), '<', $pivot)
|
||||||
->orderBy(static::$table . '_' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), $order)
|
->orderBy(static::$table . '_' . $depth . '.' . ($column !== null ? self::getColumnByMember($column) : static::$primaryField), $order)
|
||||||
->limit($limit);
|
->limit($limit);
|
||||||
|
|
@ -2633,7 +2637,13 @@ class DataMapperAbstract implements DataMapperInterface
|
||||||
*
|
*
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
public static function get(mixed $primaryKey, int $relations = RelationType::ALL, int $depth = 3, string $ref = null, Builder $query = null) : mixed
|
public static function get(
|
||||||
|
mixed $primaryKey,
|
||||||
|
int $relations = RelationType::ALL,
|
||||||
|
int $depth = 3,
|
||||||
|
string $ref = null,
|
||||||
|
Builder $query = null
|
||||||
|
) : mixed
|
||||||
{
|
{
|
||||||
if ($depth < 1) {
|
if ($depth < 1) {
|
||||||
return self::createNullModel($primaryKey);
|
return self::createNullModel($primaryKey);
|
||||||
|
|
|
||||||
|
|
@ -1413,6 +1413,7 @@ class Builder extends BuilderAbstract
|
||||||
|
|
||||||
$sth->execute();
|
$sth->execute();
|
||||||
} catch (\Throwable $t) {
|
} catch (\Throwable $t) {
|
||||||
|
\var_dump($t->getMessage());
|
||||||
\var_dump($this->toSql());
|
\var_dump($this->toSql());
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user