Explorar o código

[loggable] removed unused files

Gediminas Morkevicius %!s(int64=14) %!d(string=hai) anos
pai
achega
497ddc8de4

+ 0 - 73
lib/Gedmo/Loggable/AbstractHistoryLog.php

@@ -1,73 +0,0 @@
-<?php
-
-namespace Gedmo\Loggable;
-
-/**
- * Base class for Log object
- *
- * @author Boussekeyt Jules <jules.boussekeyt@gmail.com>
- * @author Gediminas Morkevicius <gediminas.morkevicius@gmail.com>
- * @package Gedmo.Loggable
- * @subpackage Log
- * @link http://www.gediminasm.org
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-abstract class AbstractHistoryLog
-{
-    public function __construct()
-    {
-        $this->actualizeDate();
-    }
-
-    public function getId()
-    {
-        return $this->id;
-    }
-
-    public function getDate()
-    {
-        return $this->date;
-    }
-
-    public function getUser()
-    {
-        return $this->user;
-    }
-
-    public function setUser($user)
-    {
-        $this->user = $user;
-    }
-
-    public function getAction()
-    {
-        return $this->action;
-    }
-
-    public function setAction($action)
-    {
-        $this->action = $action;
-    }
-
-    public function getObjectClass()
-    {
-        return $this->objectClass;
-    }
-
-    public function setObjectClass($objectClass)
-    {
-        $this->objectClass = $objectClass;
-    }
-
-    public function setForeignKey($foreignKey)
-    {
-        $this->foreignKey = $foreignKey;
-    }
-
-    public function getForeignKey()
-    {
-        return $this->foreignKey;
-    }
-
-    abstract protected function actualizeDate();
-}

+ 0 - 58
lib/Gedmo/Loggable/Document/HistoryLog.php

@@ -1,58 +0,0 @@
-<?php
-
-namespace Gedmo\Loggable\Document;
-
-use Gedmo\Loggable\AbstractHistoryLog;
-
-/**
- * @Document
- */
-class HistoryLog extends AbstractHistoryLog
-{
-    /**
-     * @var string $id
-     *
-     * @Id
-     */
-    protected $id;
-
-    /**
-     * @var string $user
-     *
-     * @String
-     */
-    protected $user;
-
-    /**
-     * @var string $action
-     *
-     * @String
-     */
-    protected $action;
-
-    /**
-     * @var string $objectClass
-     *
-     * @String(name="object_class")
-     */
-    protected $objectClass;
-
-    /**
-     * @var string $foreignKey
-     *
-     * @String(name="foreign_key")
-     */
-    protected $foreignKey;
-
-    /**
-     * @var MongoData $date 
-     *
-     * @Date
-     */
-    protected $date;
-
-    protected function actualizeDate()
-    {
-        $this->date = new \MongoDate();
-    }
-}

+ 0 - 61
lib/Gedmo/Loggable/Entity/HistoryLog.php

@@ -1,61 +0,0 @@
-<?php
-
-namespace Gedmo\Loggable\Entity;
-
-use Gedmo\Loggable\AbstractHistoryLog;
-
-/**
- * @Entity
- * @gedmo:Loggable
- */
-class HistoryLog extends AbstractHistoryLog
-{
-    /**
-     * @var integer $id
-     *
-     * @Column(name="id", type="integer")
-     * @Id
-     * @GeneratedValue(strategy="IDENTITY")
-     */
-    protected $id;
-
-    /**
-     * @var string $user
-     *
-     * @Column(name="user", type="string", length=128)
-     */
-    protected $user;
-
-    /**
-     * @var string $action
-     *
-     * @Column(type="string", length=64)
-     */
-    protected $action;
-
-    /**
-     * @var string $objectClass
-     *
-     * @Column(name="object_class", type="string", length=255)
-     */
-    protected $objectClass;
-
-    /**
-     * @var string $foreignKey
-     *
-     * @Column(name="foreign_key", type="string", length=64)
-     */
-    protected $foreignKey;
-
-    /**
-     * @var string $date
-     *
-     * @Column(name="date", type="datetime", length=8)
-     */
-    protected $date;
-
-    protected function actualizeDate()
-    {
-        $this->date = new \DateTime();
-    }
-}

+ 0 - 114
lib/Gedmo/Loggable/ORM/LoggableListener.php

@@ -1,114 +0,0 @@
-<?php
-
-namespace Gedmo\Loggable\ORM;
-
-use Gedmo\Loggable\AbstractLoggableListener;
-
-use Doctrine\ORM\Events,
-    Doctrine\Dbal\Types\Type,
-    Doctrine\Common\EventArgs;
-
-/**
- * @author Boussekeyt Jules <jules.boussekeyt@gmail.com>
- * @package Gedmo.Loggable.ORM
- * @subpackage LoggableListener
- * @link http://www.gediminasm.org
- * @license MIT License (http://www.opensource.org/licenses/mit-license.php)
- */
-class LoggableListener extends AbstractLoggableListener
-{
-    /**
-     * The loggable document class used to store the logs
-     *
-     * @var string
-     */
-    protected $defaultLoggableEntity = 'Gedmo\Loggable\Entity\HistoryLog';
-
-    protected $logger;
-
-    public function getSubscribedEvents()
-    {
-        return array(Events::onFlush, Events::postPersist, Events::loadClassMetadata);
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function insertLogRecord($om, $log)
-    {
-        $meta = $om->getClassMetadata(get_class($log));
-        $data = array();
-
-        foreach ($meta->getReflectionProperties() as $fieldName => $reflProp) {
-            if (!$meta->isIdentifier($fieldName)) {
-                $data[$meta->getColumnName($fieldName)] = $reflProp->getValue($log);
-            }
-        }
-
-        // DateTime value isn't converted to string
-        $data['date'] = Type::getType('datetime')->convertToDatabaseValue($data['date'],
-            $om->getConnection()->getDatabasePlatform()
-        );
-
-        $table = $meta->getTableName();
-        if (!$om->getConnection()->insert($table, $data)) {
-            throw new \Gedmo\Exception\RuntimeException('Failed to insert new Log record');
-        }
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function getLogClass()
-    {
-        return $this->defaultLoggableEntity;
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function getObject(EventArgs $args)
-    {
-        return $args->getEntity();
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function getObjectManager(EventArgs $args)
-    {
-        return $args->getEntityManager();
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function getScheduledObjectUpdates($uow)
-    {
-        return $uow->getScheduledEntityUpdates();
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function getScheduledObjectInsertions($uow)
-    {
-        return $uow->getScheduledEntityInsertions();
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function getScheduledObjectDeletions($uow)
-    {
-        return $uow->getScheduledEntityDeletions();
-    }
-
-    /**
-     * {@inheritdoc}
-     */
-    protected function getSingleIdentifierFieldName($meta)
-    {
-        return $meta->getSingleIdentifierFieldName();
-    }
-}