From 2a1322b8961fcae73b6f4594a94a90c60cb2265d Mon Sep 17 00:00:00 2001 From: Timothy J Warren Date: Wed, 14 Feb 2018 16:19:26 -0500 Subject: [PATCH] Add Film Entity --- composer.json | 1 + composer.lock | 59 ++++++- config/bundles.php | 1 + config/packages/doctrine.yaml | 6 +- src/Entity/Camera.php | 4 +- src/Entity/Film.php | 298 ++++++++++++++++++++++++++++++++++ symfony.lock | 9 + 7 files changed, 371 insertions(+), 7 deletions(-) create mode 100644 src/Entity/Film.php diff --git a/composer.json b/composer.json index 46ee390..466946e 100644 --- a/composer.json +++ b/composer.json @@ -11,6 +11,7 @@ "symfony/debug-pack": "^1.0", "symfony/form": "^4.0", "symfony/framework-bundle": "^4.0", + "symfony/maker-bundle": "^1.0", "symfony/monolog-bundle": "^3.1", "symfony/twig-bundle": "^4.0", "symfony/yaml": "^4.0", diff --git a/composer.lock b/composer.lock index 1e37ebb..e3f2b8d 100644 --- a/composer.lock +++ b/composer.lock @@ -4,7 +4,7 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "content-hash": "44811497a38d5f50ce281de61bee69d1", + "content-hash": "30d680cd17b7f8a373cf65cd59e8e5c2", "packages": [ { "name": "doctrine/annotations", @@ -2353,6 +2353,63 @@ ], "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", "version": "v4.0.4", diff --git a/config/bundles.php b/config/bundles.php index 97839e7..2c4b64f 100644 --- a/config/bundles.php +++ b/config/bundles.php @@ -10,4 +10,5 @@ return [ Symfony\Bundle\TwigBundle\TwigBundle::class => ['all' => true], Symfony\Bundle\WebProfilerBundle\WebProfilerBundle::class => ['dev' => true, 'test' => true], Symfony\Bundle\DebugBundle\DebugBundle::class => ['dev' => true, 'test' => true], + Symfony\Bundle\MakerBundle\MakerBundle::class => ['dev' => true], ]; diff --git a/config/packages/doctrine.yaml b/config/packages/doctrine.yaml index e1e0c6f..ea4b78a 100644 --- a/config/packages/doctrine.yaml +++ b/config/packages/doctrine.yaml @@ -23,9 +23,9 @@ doctrine: naming_strategy: doctrine.orm.naming_strategy.underscore auto_mapping: true mappings: - App: + CameraBundle: is_bundle: false type: annotation dir: '%kernel.project_dir%/src/Entity' - prefix: 'App\Entity' - alias: App + prefix: 'CameraBundle\Entity' + alias: CameraBundle diff --git a/src/Entity/Camera.php b/src/Entity/Camera.php index 282ef3d..b292c93 100644 --- a/src/Entity/Camera.php +++ b/src/Entity/Camera.php @@ -12,8 +12,7 @@ use Doctrine\ORM\Mapping as ORM; }) * @ORM\Entity(repositoryClass="CameraBundle\Repository\CameraRepository") */ -class Camera -{ +class Camera { use CameraTrait; /** @@ -25,5 +24,4 @@ class Camera * @ORM\SequenceGenerator(sequenceName="camera__id_seq", allocationSize=1, initialValue=1) */ private $id; - } diff --git a/src/Entity/Film.php b/src/Entity/Film.php new file mode 100644 index 0000000..7c01450 --- /dev/null +++ b/src/Entity/Film.php @@ -0,0 +1,298 @@ +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; + } +} diff --git a/symfony.lock b/symfony.lock index 1daf6b4..160435c 100644 --- a/symfony.lock +++ b/symfony.lock @@ -155,6 +155,15 @@ "symfony/intl": { "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": { "version": "v4.0.0" },