PHP code example of ruspanzer / loggable-bundle
1. Go to this page and download the library: Download ruspanzer/loggable-bundle library. Choose the download type require. 2. Extract the ZIP file and open the index.php. 3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
ruspanzer / loggable-bundle example snippets
class Place implements LoggableInterface
{
/**
* @ORM\Id()
*/
private $id;
/**
* @ORM\OneToOne(targetEntity="Address")
*/
private $address;
public function getId()
{
return $this->id;
}
public function getRelatedLogEntities()
{
return [];
}
}
class Address implements LoggableInterface
{
/**
* @ORM\Id()
*/
private $id;
/**
* @ORM\OneToOne(targetEntity="Place")
* @ORM\JoinColumn(name="place_id")
*/
private $place;
public function getId()
{
return $this->id;
}
public function getPlace()
{
return $this->place;
}
public function getRelatedLogEntities()
{
return [
$this->getPlace();
];
}
}