use Doctrine\ORM\Event\PreUpdateEventArgs;
/**
- * Asset
+ * Element
*/
-class Asset {
+class Element {
/**
* @var ?int
*/
/**
* Constructor
*
- * @param ?string $path The asset path
+ * @param ?string $path The element path
*/
public function __construct(private Album $album, private User $user, private ?string $path = null) {
$this->created = new \DateTime('now');
*
* @param \Rapsys\TreeBundle\Entity\Album $album
*
- * @return Asset
+ * @return Element
*/
- public function setAlbum(Album $album): Asset {
+ public function setAlbum(Album $album): Element {
$this->album = $album;
return $this;
*
* @param \Rapsys\TreeBundle\Entity\User $user
*
- * @return Asset
+ * @return Element
*/
- public function setUser(User $user): Asset {
+ public function setUser(User $user): Element {
$this->user = $user;
return $this;
*
* @param ?string $path
*
- * @return Asset
+ * @return Element
*/
- public function setPath(?string $path): Asset {
+ public function setPath(?string $path): Element {
$this->path = $path;
return $this;
*
* @param \DateTime $created
*
- * @return Asset
+ * @return Element
*/
- public function setCreated(\DateTime $created): Asset {
+ public function setCreated(\DateTime $created): Element {
$this->created = $created;
return $this;
*
* @param \DateTime $updated
*
- * @return Asset
+ * @return Element
*/
- public function setUpdated(\DateTime $updated): Asset {
+ public function setUpdated(\DateTime $updated): Element {
$this->updated = $updated;
return $this;
/**
* {@inheritdoc}
*/
- public function preUpdate(PreUpdateEventArgs $eventArgs): ?Asset {
+ public function preUpdate(PreUpdateEventArgs $eventArgs): ?Element {
//Check that we have an snippet instance
- if (($entity = $eventArgs->getEntity()) instanceof Asset) {
+ if (($entity = $eventArgs->getEntity()) instanceof Element) {
//Set updated value
return $entity->setUpdated(new \DateTime('now'));
}