mirror of
https://github.com/Karaka-Management/oms-Auditor.git
synced 2026-02-14 12:48:39 +00:00
remove some getter/setter
This commit is contained in:
parent
4862346d3f
commit
112e06e898
|
|
@ -101,7 +101,7 @@ class Audit
|
||||||
* @var Account
|
* @var Account
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private Account $createdBy;
|
public Account $createdBy;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Created at.
|
* Created at.
|
||||||
|
|
@ -109,7 +109,7 @@ class Audit
|
||||||
* @var \DateTimeImmutable
|
* @var \DateTimeImmutable
|
||||||
* @since 1.0.0
|
* @since 1.0.0
|
||||||
*/
|
*/
|
||||||
private \DateTimeImmutable $createdAt;
|
public \DateTimeImmutable $createdAt;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ip of creator.
|
* Ip of creator.
|
||||||
|
|
@ -255,30 +255,6 @@ class Audit
|
||||||
return $this->new;
|
return $this->new;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Get created by.
|
|
||||||
*
|
|
||||||
* @return Account|int
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getCreatedBy()
|
|
||||||
{
|
|
||||||
return $this->createdBy;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Get created at.
|
|
||||||
*
|
|
||||||
* @return \DateTimeImmutable
|
|
||||||
*
|
|
||||||
* @since 1.0.0
|
|
||||||
*/
|
|
||||||
public function getCreatedAt() : \DateTimeImmutable
|
|
||||||
{
|
|
||||||
return $this->createdAt;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get ip.
|
* Get ip.
|
||||||
*
|
*
|
||||||
|
|
|
||||||
|
|
@ -65,9 +65,9 @@ echo $this->getData('nav')->render(); ?>
|
||||||
<td><?= $this->printHtml($audit->getOld()); ?>
|
<td><?= $this->printHtml($audit->getOld()); ?>
|
||||||
<td><?= $this->printHtml($audit->getNew()); ?>
|
<td><?= $this->printHtml($audit->getNew()); ?>
|
||||||
<td><?= $this->printHtml($audit->getContent()); ?>
|
<td><?= $this->printHtml($audit->getContent()); ?>
|
||||||
<td><?= $this->printHtml($audit->getCreatedBy()->getName()); ?>
|
<td><?= $this->printHtml($audit->createdBy->login); ?>
|
||||||
<td><?= $this->printHtml($audit->getRef()); ?>
|
<td><?= $this->printHtml($audit->getRef()); ?>
|
||||||
<td><?= $audit->getCreatedAt()->format('Y-m-d H:i'); ?>
|
<td><?= $audit->createdAt->format('Y-m-d H:i'); ?>
|
||||||
<?php endforeach; ?>
|
<?php endforeach; ?>
|
||||||
<?php if ($count === 0) : ?>
|
<?php if ($count === 0) : ?>
|
||||||
<tr><td colspan="10" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
<tr><td colspan="10" class="empty"><?= $this->getHtml('Empty', '0', '0'); ?>
|
||||||
|
|
|
||||||
|
|
@ -51,10 +51,10 @@ echo $this->getData('nav')->render();
|
||||||
|
|
||||||
<tr>
|
<tr>
|
||||||
<th>Created By
|
<th>Created By
|
||||||
<td><?= $audit->getCreatedBy()->getName1(); ?>
|
<td><?= $audit->createdBy->name1; ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Created At
|
<th>Created At
|
||||||
<td><?= $this->getDateTime($audit->getCreatedAt(), 'long'); ?>
|
<td><?= $this->getDateTime($audit->createdAt, 'long'); ?>
|
||||||
<tr>
|
<tr>
|
||||||
<th>Module
|
<th>Module
|
||||||
<td><?= $audit->getModule(); ?>
|
<td><?= $audit->getModule(); ?>
|
||||||
|
|
|
||||||
|
|
@ -41,8 +41,8 @@ class AuditTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertNull($audit->getOld());
|
self::assertNull($audit->getOld());
|
||||||
self::assertNull($audit->getNew());
|
self::assertNull($audit->getNew());
|
||||||
self::assertEquals(0, $audit->getIp());
|
self::assertEquals(0, $audit->getIp());
|
||||||
self::assertEquals(0, $audit->getCreatedBy()->getId());
|
self::assertEquals(0, $audit->createdBy->getId());
|
||||||
self::assertInstanceOf('\DateTimeImmutable', $audit->getCreatedAt());
|
self::assertInstanceOf('\DateTimeImmutable', $audit->createdAt);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
@ -70,6 +70,6 @@ class AuditTest extends \PHPUnit\Framework\TestCase
|
||||||
self::assertEquals('old', $audit->getOld());
|
self::assertEquals('old', $audit->getOld());
|
||||||
self::assertEquals('new', $audit->getNew());
|
self::assertEquals('new', $audit->getNew());
|
||||||
self::assertEquals(\ip2long('127.0.0.1'), $audit->getIp());
|
self::assertEquals(\ip2long('127.0.0.1'), $audit->getIp());
|
||||||
self::assertEquals(0, $audit->getCreatedBy()->getId());
|
self::assertEquals(0, $audit->createdBy->getId());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user