Skip to content

Commit

Permalink
Better way to set object name
Browse files Browse the repository at this point in the history
  • Loading branch information
Vítězslav Dvořák committed Nov 10, 2023
1 parent 9d1cc02 commit d77c3c5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions src/Ease/Brick.php
Expand Up @@ -6,7 +6,7 @@
* @author Vitex <vitex@hippy.cz>
* @copyright 2009-2023 Vitex@hippy.cz (G)
*
* PHP 7
* PHP 7,8
*/

declare(strict_types=1);
Expand Down Expand Up @@ -108,9 +108,14 @@ public function howToProcess($identifer)
public function setObjectName($objectName = null)
{
if (is_null($objectName)) {
$key = $this->getMyKey($this->data);
$recordId = $this->getMyKey($this->data);
if ($this->nameColumn && $this->getDataValue($this->nameColumn)) {
$key = '(' . $recordId . ')' . $this->getDataValue($this->nameColumn);
} else {
$key = $recordId;
}
if ($key) {
$result = parent::setObjectName(get_class($this) . '@' . $key);
$result = parent::setObjectName($key . '@' . \Ease\Logger\Message::getCallerName($this));
} else {
$result = parent::setObjectName();
}
Expand Down

0 comments on commit d77c3c5

Please sign in to comment.