mirror of
https://github.com/Karaka-Management/phpOMS.git
synced 2026-01-11 17:58:41 +00:00
Automated formatting changes
This commit is contained in:
parent
aa004569f5
commit
89ae5950e4
|
|
@ -14,7 +14,6 @@ declare(strict_types=1);
|
|||
|
||||
namespace phpOMS\DataStorage\Database\Mapper;
|
||||
|
||||
use phpOMS\DataStorage\Database\Exception\InvalidMapperException;
|
||||
use phpOMS\DataStorage\Database\Query\Builder;
|
||||
|
||||
/**
|
||||
|
|
@ -95,7 +94,7 @@ class DeleteMapper extends DataMapperAbstract
|
|||
$mapper = $relData['mapper'];
|
||||
|
||||
/** @var self $relMapper */
|
||||
$relMapper = $this->createRelationMapper($mapper::delete(db: $this->db), $member);
|
||||
$relMapper = $this->createRelationMapper($mapper::delete(db: $this->db), $member);
|
||||
$relMapper->depth = $this->depth + 1;
|
||||
|
||||
$refProp = $refClass->getProperty($member);
|
||||
|
|
@ -121,7 +120,7 @@ class DeleteMapper extends DataMapperAbstract
|
|||
continue;
|
||||
}
|
||||
|
||||
$objIds = [];
|
||||
$objIds = [];
|
||||
$refProp = $refClass->getProperty($member);
|
||||
if (!$refProp->isPublic()) {
|
||||
$refProp->setAccessible(true);
|
||||
|
|
|
|||
|
|
@ -105,12 +105,12 @@ class ReadMapper extends DataMapperAbstract
|
|||
// @todo: consider to always return an array, this way we could remove executeGetAll
|
||||
public function executeGet(Builder $query = null) : mixed
|
||||
{
|
||||
$primaryKeys = [];
|
||||
$primaryKeys = [];
|
||||
$memberOfPrimaryField = $this->mapper::COLUMNS[$this->mapper::PRIMARYFIELD]['internal'];
|
||||
$emptyWhere = empty($this->where);
|
||||
$emptyWhere = empty($this->where);
|
||||
|
||||
if (isset($this->where[$memberOfPrimaryField])) {
|
||||
$keys = $this->where[$memberOfPrimaryField][0]['value'];
|
||||
$keys = $this->where[$memberOfPrimaryField][0]['value'];
|
||||
$primaryKeys = \array_merge(\is_array($keys) ? $keys : [$keys], $primaryKeys);
|
||||
}
|
||||
|
||||
|
|
@ -205,8 +205,8 @@ class ReadMapper extends DataMapperAbstract
|
|||
/**
|
||||
* Get mapper specific builder
|
||||
*
|
||||
* @param Builder $query Query to fill
|
||||
* @param array $columns Columns to use
|
||||
* @param Builder $query Query to fill
|
||||
* @param array $columns Columns to use
|
||||
*
|
||||
* @return Builder
|
||||
*
|
||||
|
|
@ -350,7 +350,7 @@ class ReadMapper extends DataMapperAbstract
|
|||
}
|
||||
|
||||
/** @var self $relMapper */
|
||||
$relMapper = $this->createRelationMapper($rel['mapper']::reader(db: $this->db), $member);
|
||||
$relMapper = $this->createRelationMapper($rel['mapper']::reader(db: $this->db), $member);
|
||||
$relMapper->depth = $this->depth + 1;
|
||||
|
||||
$query = $relMapper->getQuery(
|
||||
|
|
@ -638,7 +638,7 @@ class ReadMapper extends DataMapperAbstract
|
|||
}
|
||||
|
||||
/** @var class-string<DataMapperFactory> $ownsOneMapper */
|
||||
$ownsOneMapper = $this->createRelationMapper($mapper::get($this->db), $member);
|
||||
$ownsOneMapper = $this->createRelationMapper($mapper::get($this->db), $member);
|
||||
$ownsOneMapper->depth = $this->depth + 1;
|
||||
|
||||
return $ownsOneMapper->populateAbstract($result, $mapper::createBaseModel());
|
||||
|
|
@ -689,7 +689,7 @@ class ReadMapper extends DataMapperAbstract
|
|||
// in this case you can get the profile by loading the profile based on the account reference column
|
||||
if (isset($this->mapper::BELONGS_TO[$member]['by'])) {
|
||||
/** @var class-string<DataMapperFactory> $belongsToMapper */
|
||||
$belongsToMapper = $this->createRelationMapper($mapper::get($this->db), $member);
|
||||
$belongsToMapper = $this->createRelationMapper($mapper::get($this->db), $member);
|
||||
$belongsToMapper->depth = $this->depth + 1;
|
||||
$belongsToMapper->where($this->mapper::BELONGS_TO[$member]['by'], $result[$mapper::getColumnByMember($this->mapper::BELONGS_TO[$member]['by']) . '_d' . $this->depth + 1], '=');
|
||||
|
||||
|
|
@ -697,7 +697,7 @@ class ReadMapper extends DataMapperAbstract
|
|||
}
|
||||
|
||||
/** @var class-string<DataMapperFactory> $belongsToMapper */
|
||||
$belongsToMapper = $this->createRelationMapper($mapper::get($this->db), $member);
|
||||
$belongsToMapper = $this->createRelationMapper($mapper::get($this->db), $member);
|
||||
$belongsToMapper->depth = $this->depth + 1;
|
||||
|
||||
return $belongsToMapper->populateAbstract($result, $mapper::createBaseModel());
|
||||
|
|
@ -706,7 +706,7 @@ class ReadMapper extends DataMapperAbstract
|
|||
/**
|
||||
* Fill object with relations
|
||||
*
|
||||
* @param mixed $obj Object to fill
|
||||
* @param mixed $obj Object to fill
|
||||
*
|
||||
* @return void
|
||||
*
|
||||
|
|
@ -742,7 +742,7 @@ class ReadMapper extends DataMapperAbstract
|
|||
->from($many['table'])
|
||||
->where($many['table'] . '.' . $many['self'], '=', $primaryKey);
|
||||
|
||||
if ($many['mapper']::TABLE !== $many['table']) {
|
||||
if ($many['table'] !== $many['mapper']::TABLE) {
|
||||
$query->leftJoin($many['mapper']::TABLE)
|
||||
->on($many['table'] . '.' . $src, '=', $many['mapper']::TABLE . '.' . $many['mapper']::PRIMARYFIELD);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -158,7 +158,7 @@ class UpdateMapper extends DataMapperAbstract
|
|||
$mapper = $this->mapper::BELONGS_TO[$propertyName]['mapper'];
|
||||
|
||||
/** @var self $relMapper */
|
||||
$relMapper = $this->createRelationMapper($mapper::update(db: $this->db), $propertyName);
|
||||
$relMapper = $this->createRelationMapper($mapper::update(db: $this->db), $propertyName);
|
||||
$relMapper->depth = $this->depth + 1;
|
||||
|
||||
return $relMapper->execute($obj);
|
||||
|
|
@ -174,7 +174,7 @@ class UpdateMapper extends DataMapperAbstract
|
|||
$mapper = $this->mapper::OWNS_ONE[$propertyName]['mapper'];
|
||||
|
||||
/** @var self $relMapper */
|
||||
$relMapper = $this->createRelationMapper($mapper::update(db: $this->db), $propertyName);
|
||||
$relMapper = $this->createRelationMapper($mapper::update(db: $this->db), $propertyName);
|
||||
$relMapper->depth = $this->depth + 1;
|
||||
|
||||
return $relMapper->execute($obj);
|
||||
|
|
@ -230,7 +230,7 @@ class UpdateMapper extends DataMapperAbstract
|
|||
// already in db
|
||||
if (!empty($primaryKey)) {
|
||||
/** @var self $relMapper */
|
||||
$relMapper = $this->createRelationMapper($mapper::update(db: $this->db), $propertyName);
|
||||
$relMapper = $this->createRelationMapper($mapper::update(db: $this->db), $propertyName);
|
||||
$relMapper->depth = $this->depth + 1;
|
||||
|
||||
$relMapper->execute($value);
|
||||
|
|
@ -277,7 +277,7 @@ class UpdateMapper extends DataMapperAbstract
|
|||
->from($many['table'])
|
||||
->where($many['table'] . '.' . $many['self'], '=', $objId);
|
||||
|
||||
if ($many['mapper']::TABLE !== $many['table']) {
|
||||
if ($many['table'] !== $many['mapper']::TABLE) {
|
||||
$query->leftJoin($many['mapper']::TABLE)
|
||||
->on($many['table'] . '.' . $src, '=', $many['mapper']::TABLE . '.' . $many['mapper']::PRIMARYFIELD);
|
||||
}
|
||||
|
|
|
|||
|
|
@ -895,7 +895,7 @@ class Email implements MessageInterface
|
|||
|
||||
$errorcode = 0;
|
||||
if (\defined('INTL_IDNA_VARIANT_UTS46')) {
|
||||
$punycode = \idn_to_ascii($domain, $errorcode, INTL_IDNA_VARIANT_UTS46);
|
||||
$punycode = \idn_to_ascii($domain, $errorcode, \INTL_IDNA_VARIANT_UTS46);
|
||||
} else {
|
||||
$punycode = \idn_to_ascii($domain, $errorcode);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user