Add Film Entity

This commit is contained in:
Timothy Warren 2018-02-14 16:19:26 -05:00
parent f21c629640
commit 2a1322b896
7 changed files with 371 additions and 7 deletions

View File

@ -11,6 +11,7 @@
"symfony/debug-pack": "^1.0", "symfony/debug-pack": "^1.0",
"symfony/form": "^4.0", "symfony/form": "^4.0",
"symfony/framework-bundle": "^4.0", "symfony/framework-bundle": "^4.0",
"symfony/maker-bundle": "^1.0",
"symfony/monolog-bundle": "^3.1", "symfony/monolog-bundle": "^3.1",
"symfony/twig-bundle": "^4.0", "symfony/twig-bundle": "^4.0",
"symfony/yaml": "^4.0", "symfony/yaml": "^4.0",

59
composer.lock generated
View File

@ -4,7 +4,7 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "44811497a38d5f50ce281de61bee69d1", "content-hash": "30d680cd17b7f8a373cf65cd59e8e5c2",
"packages": [ "packages": [
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
@ -2353,6 +2353,63 @@
], ],
"time": "2018-01-03T07:38:00+00:00" "time": "2018-01-03T07:38:00+00:00"
}, },
{
"name": "symfony/maker-bundle",
"version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/symfony/maker-bundle.git",
"reference": "bf97703ddb68c6b37bd6bab5f5ebd5c7542ca1ef"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/symfony/maker-bundle/zipball/bf97703ddb68c6b37bd6bab5f5ebd5c7542ca1ef",
"reference": "bf97703ddb68c6b37bd6bab5f5ebd5c7542ca1ef",
"shasum": ""
},
"require": {
"php": "^7.0.8",
"symfony/config": "^3.4|^4.0",
"symfony/console": "^3.4|^4.0",
"symfony/dependency-injection": "^3.4|^4.0",
"symfony/filesystem": "^3.4|^4.0",
"symfony/framework-bundle": "^3.4|^4.0",
"symfony/http-kernel": "^3.4|^4.0"
},
"require-dev": {
"friendsofphp/php-cs-fixer": "^2.8",
"symfony/phpunit-bridge": "^3.4|^4.0",
"symfony/process": "^3.4|^4.0"
},
"type": "symfony-bundle",
"extra": {
"branch-alias": {
"dev-master": "1.0-dev"
}
},
"autoload": {
"psr-4": {
"Symfony\\Bundle\\MakerBundle\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
"authors": [
{
"name": "Symfony Community",
"homepage": "https://symfony.com/contributors"
}
],
"keywords": [
"code generator",
"generator",
"scaffold",
"scaffolding"
],
"time": "2017-12-04T17:50:28+00:00"
},
{ {
"name": "symfony/monolog-bridge", "name": "symfony/monolog-bridge",
"version": "v4.0.4", "version": "v4.0.4",

View File

@ -10,4 +10,5 @@ return [
Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true],
Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true],
Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true],
]; ];

View File

@ -23,9 +23,9 @@ doctrine:
naming_strategy: doctrine.orm.naming_strategy.underscore naming_strategy: doctrine.orm.naming_strategy.underscore
auto_mapping: true auto_mapping: true
mappings: mappings:
App: CameraBundle:
is_bundle: false is_bundle: false
type: annotation type: annotation
dir: '%kernel.project_dir%/src/Entity' dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity' prefix: 'CameraBundle\Entity'
alias: App alias: CameraBundle

View File

@ -12,8 +12,7 @@ use Doctrine\ORM\Mapping as ORM;
}) })
* @ORM\Entity(repositoryClass="CameraBundle\Repository\CameraRepository") * @ORM\Entity(repositoryClass="CameraBundle\Repository\CameraRepository")
*/ */
class Camera class Camera {
{
use CameraTrait; use CameraTrait;
/** /**
@ -25,5 +24,4 @@ class Camera
* @ORM\SequenceGenerator(sequenceName="camera__id_seq", allocationSize=1, initialValue=1) * @ORM\SequenceGenerator(sequenceName="camera__id_seq", allocationSize=1, initialValue=1)
*/ */
private $id; private $id;
} }

298
src/Entity/Film.php Normal file
View File

@ -0,0 +1,298 @@
<?php declare(strict_types=1);
namespace CameraBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Camera
*
* @ORM\Table(name="film", schema="camera")
* @ORM\Entity
*/
class Film {
/**
* @var integer
*
* @ORM\Id
* @ORM\Column(name="id", type="integer", nullable=false)
* @ORM\GeneratedValue(strategy="IDENTITY")
*/
private $id;
/**
* @var string
*
* @ORM\Column(name="brand", type="string", nullable=false)
*/
private $brand;
/**
* @var string
*
* @ORM\Column(name="product_line", type="string", nullable=false)
*/
private $product_line;
/**
* @var string
*
* @ORM\Column(name="film_name", type="string", nullable=false)
*/
private $film_name;
/**
* @var int
*
* @ORM\Column(name="film_speed_asa", type="integer", nullable=false)
*/
private $film_speed_asa;
/**
* @var int
*
* @ORM\Column(name="film_speed_din", type="integer", nullable=false)
*/
private $film_speed_din;
/**
* @var string
*
* @ORM\Column(name="film_format", type="string", nullable=false)
*/
private $film_format;
/**
* @var string
*
* @ORM\Column(name="film_base", type="string", nullable=false, options={"default"="Cellulose Triacetate"})
*/
private $film_base;
/**
* @var int
*
* @ORM\Column(name="unused_rolls", type="integer", nullable=false, options={"default"=0})
*/
private $unused_rolls;
/**
* @var int
*
* @ORM\Column(name="developed_rolls", type="integer", nullable=false, options={"default"=0})
*/
private $developed_rolls;
/**
* @var string
*
* @ORM\Column(name="chemistry", type="string", nullable=false, options={"default"="C-41"})
*/
private $chemistry;
/**
* @var string
*
* @ORM\Column(name="notes", type="text", nullable=true)
*/
private $notes;
/**
* @return string
*/
public function getBrand(): string
{
return $this->brand;
}
/**
* @param string $brand
* @return self
*/
public function setBrand(string $brand): self
{
$this->brand = $brand;
return $this;
}
/**
* @return string
*/
public function getProductLine(): string
{
return $this->product_line;
}
/**
* @param string $product_line
* @return self
*/
public function setProductLine(string $product_line): self
{
$this->product_line = $product_line;
return $this;
}
/**
* @return string
*/
public function getFilmName(): string
{
return $this->film_name;
}
/**
* @param string $film_name
* @return self
*/
public function setFilmName(string $film_name): self
{
$this->film_name = $film_name;
return $this;
}
/**
* @return int
*/
public function getFilmSpeedAsa(): int
{
return $this->film_speed_asa;
}
/**
* @param int $film_speed_asa
* @return self
*/
public function setFilmSpeedAsa(int $film_speed_asa): self
{
$this->film_speed_asa = $film_speed_asa;
return $this;
}
/**
* @return int
*/
public function getFilmSpeedDin(): int
{
return $this->film_speed_din;
}
/**
* @param int $film_speed_din
* @return self
*/
public function setFilmSpeedDin(int $film_speed_din): self
{
$this->film_speed_din = $film_speed_din;
return $this;
}
/**
* @return string
*/
public function getFilmFormat(): string
{
return $this->film_format;
}
/**
* @param string $film_format
* @return self
*/
public function setFilmFormat(string $film_format): self
{
$this->film_format = $film_format;
return $this;
}
/**
* @return string
*/
public function getFilmBase(): string
{
return $this->film_base;
}
/**
* @param string $film_base
* @return self
*/
public function setFilmBase(string $film_base): self
{
$this->film_base = $film_base;
return $this;
}
/**
* @return int
*/
public function getUnusedRolls(): int
{
return $this->unused_rolls;
}
/**
* @param int $unused_rolls
* @return self
*/
public function setUnusedRolls(int $unused_rolls): self
{
$this->unused_rolls = $unused_rolls;
return $this;
}
/**
* @return int
*/
public function getDevelopedRolls(): int
{
return $this->developed_rolls;
}
/**
* @param int $developed_rolls
* @return self
*/
public function setDevelopedRolls(int $developed_rolls): self
{
$this->developed_rolls = $developed_rolls;
return $this;
}
/**
* @return string
*/
public function getChemistry(): string
{
return $this->chemistry;
}
/**
* @param string $chemistry
* @return self
*/
public function setChemistry(string $chemistry): self
{
$this->chemistry = $chemistry;
return $this;
}
/**
* @return string
*/
public function getNotes(): ?string
{
return $this->notes;
}
/**
* @param string $notes
* @return self
*/
public function setNotes(string $notes): self
{
$this->notes = $notes;
return $this;
}
}

View File

@ -155,6 +155,15 @@
"symfony/intl": { "symfony/intl": {
"version": "v4.0.0" "version": "v4.0.0"
}, },
"symfony/maker-bundle": {
"version": "1.0",
"recipe": {
"repo": "github.com/symfony/recipes",
"branch": "master",
"version": "1.0",
"ref": "fadbfe33303a76e25cb63401050439aa9b1a9c7f"
}
},
"symfony/monolog-bridge": { "symfony/monolog-bridge": {
"version": "v4.0.0" "version": "v4.0.0"
}, },