1. Go to this page and download the library: Download mero/base-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/ */
mero / base-bundle example snippets
use Mero\Bundle\BaseBundle\Validator\Constraints as MeroAssert;
class Payment
{
/**
* @var \DateTime Payment date
*
* @MeroAssert\DateRange(min="2017-01-01", max="today")
*/
private $date;
}
namespace Acme\Bundle\BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Mero\Bundle\BaseBundle\Entity\AbstractEntity;
/**
* @ORM\Entity()
* @ORM\Table(name="post")
*/
class Post extends AbstractEntity
{
// Entity class with IdTrait, CreatedTrait and ModifiedTrait implemented
}
namespace Acme\Bundle\BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Mero\Bundle\BaseBundle\Entity\AbstractEntityWithUuid;
/**
* @ORM\Entity()
* @ORM\Table(name="post")
*/
class Post extends AbstractEntityWithUuid
{
// Entity class with UuidTrait, CreatedTrait and ModifiedTrait implemented
}
namespace Acme\Bundle\BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Mero\Bundle\BaseBundle\Entity\IdTrait;
/**
* @ORM\Entity()
* @ORM\Table(name="post")
*/
class Post
{
use IdTrait;
}
namespace Acme\Bundle\BlogBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Mero\Bundle\BaseBundle\Helper\ClassNameTrait;
/**
* @ORM\Entity()
* @ORM\Table(name="post")
*/
class Post
{
use ClassNameTrait;
}
Post::className(); // Return "Post" using ClassNameTrait for PHP 5.4
Post::class // Return "Post" if you are using PHP 5.5 or above
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.