PHP code example of madesst / doctrine-generation-bundle
1. Go to this page and download the library: Download madesst/doctrine-generation-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/ */
madesst / doctrine-generation-bundle example snippets
// src/Company/SomeBundle/Entity/User.php
class User extends \Smartstart\SpecialBundle\Entity\Base\User
{
public function getUsername()
{
return $this->getFirstname().' '.$this->getLastname();
}
}
// src/Company/SomeBundle/Entity/Base/User.php
class User
{
/**
* @var integer
*/
protected $id;
/**
* @var string
*/
protected $firstname;
/**
* @var string
*/
protected $lastname;
// ...
// И так далее, обычный сгенерерированный доктриной класс
// app/AppKernel.php
public function registerBundles()
{
if (in_array($this->getEnvironment(), array('dev', 'test'))) {
// ...
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
$bundles[] = new Madesst\DoctrineGenerationBundle\MadesstDoctrineGenerationBundle();
}
}
Loading please wait ...
Before you can download the PHP files, the dependencies should be resolved. This can take some minutes. Please be patient.