<?php

namespace Club\InstallerBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

/**
 * Club\InstallerBundle\Entity\MigrationVersion
 *
 * @ORM\Table(name="club_installer_migration_version")
 * @ORM\Entity(repositoryClass="Club\InstallerBundle\Entity\MigrationVersionRepository")
 * @ORM\HasLifecycleCallbacks()
 */
class MigrationVersion
{
    /**
     * @var integer $id
     *
     * @ORM\Column(name="id", type="integer")
     * @ORM\Id
     * @ORM\GeneratedValue(strategy="AUTO")
     */
    private $id;

    /**
     * @var string $version
     *
     * @ORM\Column(name="version", type="string", length=255)
     */
    private $version;

    /**
     * @var datetime $created_at
     *
     * @ORM\Column(name="created_at", type="datetime")
     */
    private $created_at;

    /**
     * Get id
     *
     * @return integer
     */
    public function getId()
    {
        return $this->id;
    }

    /**
     * Set version
     *
     * @param string $version
     */
    public function setVersion($version)
    {
        $this->version = $version;
    }

    /**
     * Get version
     *
     * @return string
     */
    public function getVersion()
    {
        return $this->version;
    }

    /**
     * Set created_at
     *
     * @param datetime $createdAt
     */
    public function setCreatedAt($createdAt)
    {
        $this->created_at = $createdAt;
    }

    /**
     * Get created_at
     *
     * @return datetime
     */
    public function getCreatedAt()
    {
        return $this->created_at;
    }

    /**
     * @ORM\PrePersist
     */
    public function prePersist()
    {
      $this->setCreatedAt(new \DateTime());
    }
}
