PHP code example of 20steps / autotables-bundle
1. Go to this page and download the library: Download 20steps/autotables-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/ */
20steps / autotables-bundle example snippets
php composer.phar update 20steps/autotables-bundle
namespace Acme\StoreBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use twentysteps\Bundle\AutoTablesBundle\Annotations as AUT;
/**
* Product
*
* @ORM\Table()
* @ORM\Entity(repositoryClass="Acme\StoreBundle\Entity\ProductRepository")
*/
class Product
{
/**
* @ORM\Column(type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
* @AUT\Column(ignore=true)
*/
protected $id;
/**
* @ORM\Column(type="string", length=100)
* @AUT\Column(ignore=true)
*/
protected $name;
/**
* @ORM\Column(type="decimal", scale=2)
* @AUT\Column(name="col_prize", order = 2, readOnly = true)
*/
protected $price;
/**
* @ORM\Column(type="text")
* @AUT\Column(name="col_description", order = 3)
*/
protected $description;
/**
* @AUT\Column(name="col_name", type="string", order=1)
* @return string
*/
public function getDisplayName()
{
return '#' . $this->name . '#';
}
public function setDisplayName($name)
{
$this->name = trim($name, '#');
}