-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add custom Abstract log for the Loggable behaviour
- Loading branch information
Matt Cockayne
committed
Sep 18, 2015
1 parent
e8392cc
commit ad05d05
Showing
2 changed files
with
36 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
<?php | ||
namespace ZucchiDoctrine\Behaviour\Loggable; | ||
|
||
use Doctrine\ORM\Mapping as ORM; | ||
use Gedmo\Loggable\Entity\MappedSuperclass as MappedSuperclass; | ||
|
||
/** | ||
* Gedmo\Loggable\Entity\LogEntry | ||
* | ||
* @ORM\Table( | ||
* indexes={ | ||
* @ORM\Index(name="log_class_lookup_idx", columns={"object_class"}), | ||
* @ORM\Index(name="log_date_lookup_idx", columns={"logged_at"}), | ||
* @ORM\Index(name="log_user_lookup_idx", columns={"username"}), | ||
* @ORM\Index(name="log_version_lookup_idx", columns={"object_id", "object_class", "version"}) | ||
* } | ||
* ) | ||
* @ORM\Entity(repositoryClass="Gedmo\Loggable\Entity\Repository\LogEntryRepository") | ||
*/ | ||
class AbstractLog extends MappedSuperclass\AbstractLogEntry implements \JsonSerializable | ||
{ | ||
/** | ||
* (non-PHPdoc) | ||
* @see JsonSerializable::jsonSerialize() | ||
*/ | ||
public function jsonSerialize() | ||
{ | ||
return array( | ||
'version' => $this->getVersion(), | ||
'loggedAt'=> $this->getLoggedAt(), | ||
'username' => $this->getUsername(), | ||
'action' => $this->getAction(), | ||
'changes' => $this->getData(), | ||
); | ||
} | ||
} |
File renamed without changes.