First commit
This commit is contained in:
commit
078f79c638
17
.gitignore
vendored
Normal file
17
.gitignore
vendored
Normal file
@ -0,0 +1,17 @@
|
||||
/.web-server-pid
|
||||
/app/config/parameters.yml
|
||||
/build/
|
||||
/phpunit.xml
|
||||
/var/*
|
||||
!/var/cache
|
||||
/var/cache/*
|
||||
!var/cache/.gitkeep
|
||||
!/var/logs
|
||||
/var/logs/*
|
||||
!var/logs/.gitkeep
|
||||
!/var/sessions
|
||||
/var/sessions/*
|
||||
!var/sessions/.gitkeep
|
||||
!var/SymfonyRequirements.php
|
||||
/vendor/
|
||||
/web/bundles/
|
7
app/.htaccess
Normal file
7
app/.htaccess
Normal file
@ -0,0 +1,7 @@
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
7
app/AppCache.php
Normal file
7
app/AppCache.php
Normal file
@ -0,0 +1,7 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\HttpCache\HttpCache;
|
||||
|
||||
class AppCache extends HttpCache
|
||||
{
|
||||
}
|
55
app/AppKernel.php
Normal file
55
app/AppKernel.php
Normal file
@ -0,0 +1,55 @@
|
||||
<?php
|
||||
|
||||
use CameraBundle\CameraBundle;
|
||||
use Symfony\Component\HttpKernel\Kernel;
|
||||
use Symfony\Component\Config\Loader\LoaderInterface;
|
||||
|
||||
class AppKernel extends Kernel
|
||||
{
|
||||
public function registerBundles()
|
||||
{
|
||||
$bundles = [
|
||||
new Symfony\Bundle\FrameworkBundle\FrameworkBundle(),
|
||||
new Symfony\Bundle\SecurityBundle\SecurityBundle(),
|
||||
new Symfony\Bundle\TwigBundle\TwigBundle(),
|
||||
new Symfony\Bundle\MonologBundle\MonologBundle(),
|
||||
new Symfony\Bundle\SwiftmailerBundle\SwiftmailerBundle(),
|
||||
new Doctrine\Bundle\DoctrineBundle\DoctrineBundle(),
|
||||
new Sensio\Bundle\FrameworkExtraBundle\SensioFrameworkExtraBundle(),
|
||||
new CameraBundle(),
|
||||
];
|
||||
|
||||
if (in_array($this->getEnvironment(), ['dev', 'test'], true)) {
|
||||
$bundles[] = new Symfony\Bundle\DebugBundle\DebugBundle();
|
||||
$bundles[] = new Symfony\Bundle\WebProfilerBundle\WebProfilerBundle();
|
||||
$bundles[] = new Sensio\Bundle\DistributionBundle\SensioDistributionBundle();
|
||||
|
||||
if ('dev' === $this->getEnvironment()) {
|
||||
$bundles[] = new Sensio\Bundle\GeneratorBundle\SensioGeneratorBundle();
|
||||
$bundles[] = new Symfony\Bundle\WebServerBundle\WebServerBundle();
|
||||
}
|
||||
}
|
||||
|
||||
return $bundles;
|
||||
}
|
||||
|
||||
public function getRootDir()
|
||||
{
|
||||
return __DIR__;
|
||||
}
|
||||
|
||||
public function getCacheDir()
|
||||
{
|
||||
return dirname(__DIR__).'/var/cache/'.$this->getEnvironment();
|
||||
}
|
||||
|
||||
public function getLogDir()
|
||||
{
|
||||
return dirname(__DIR__).'/var/logs';
|
||||
}
|
||||
|
||||
public function registerContainerConfiguration(LoaderInterface $loader)
|
||||
{
|
||||
$loader->load($this->getRootDir().'/config/config_'.$this->getEnvironment().'.yml');
|
||||
}
|
||||
}
|
47
app/Resources/views/base.html.twig
Normal file
47
app/Resources/views/base.html.twig
Normal file
@ -0,0 +1,47 @@
|
||||
{% set route = app.request.get('_route') %}
|
||||
<!DOCTYPE html>
|
||||
<html class="no-js" lang="en">
|
||||
<head>
|
||||
<meta charset="UTF-8" />
|
||||
<meta http-equiv="x-ua-compatible" content="ie=edge">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
||||
<title>{% block title %}Welcome!{% endblock %}</title>
|
||||
<link rel="stylesheet" href="/css/foundation.min.css" />
|
||||
<link rel="stylesheet" href="/css/app.css" />
|
||||
{% block stylesheets %}{% endblock %}
|
||||
<link rel="icon" type="image/x-icon" href="{{ asset('favicon.ico') }}" />
|
||||
</head>
|
||||
<body>
|
||||
<main class="page-pad">
|
||||
<div class="top-bar">
|
||||
<div class="top-bar-left">
|
||||
<ul class="menu expanded align-center">
|
||||
<li class="{{ route starts with 'camera_' ? 'is-active' }}">
|
||||
<a href="{{ path('camera_index') }}">Cameras</a>
|
||||
</li>
|
||||
<li class="{{ route starts with 'camera-type_' ? 'is-active' }}">
|
||||
<a href="{{ path('camera-type_index') }}">Camera Types</a>
|
||||
</li>
|
||||
<li class="{{ route starts with 'lens_' ? 'is-active' }}">
|
||||
<a href="{{ path('lens_index') }}">Lenses</a>
|
||||
</li>
|
||||
<li class="{{ route starts with 'flash_' ? 'is-active' }}">
|
||||
<a href="{{ path('flash_index') }}">Flashes</a>
|
||||
</li>
|
||||
<li class="{{ route starts with 'previously-owned-camera' ? 'is-active' }}">
|
||||
<a href="{{ path('previously-owned-camera_index') }}">Previously Owned Cameras</a>
|
||||
</li>
|
||||
<li class="{{ route starts with 'previously-owned-lens' ? 'is-active' }}">
|
||||
<a href="{{ path('previously-owned-lens_index') }}">Previously Owned Lenses</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
{% block body %}{% endblock %}
|
||||
</main>
|
||||
<script src="/js/vendor/jquery.js"></script>
|
||||
<script src="/js/vendor/what-input.js"></script>
|
||||
<script src="/js/vendor/foundation.min.js"></script>
|
||||
{% block javascripts %}{% endblock %}
|
||||
</body>
|
||||
</html>
|
26
app/Resources/views/camera/edit.html.twig
Normal file
26
app/Resources/views/camera/edit.html.twig
Normal file
@ -0,0 +1,26 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Edit Camera</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<button type="submit" class="button">Update</button>
|
||||
{{ form_end(edit_form) }}
|
||||
|
||||
<hr />
|
||||
|
||||
{{ form_start(delete_form) }}
|
||||
<button type="submit" class="alert button">Delete</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</div>
|
||||
{% endblock %}
|
65
app/Resources/views/camera/index.html.twig
Normal file
65
app/Resources/views/camera/index.html.twig
Normal file
@ -0,0 +1,65 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Cameras</h1>
|
||||
|
||||
<div class="callout primary">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera_new') }}">Add a new camera</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Actions</th>
|
||||
<th>Id</th>
|
||||
<th>Brand</th>
|
||||
<th>Mount</th>
|
||||
<th>Model</th>
|
||||
<th>Is Digital?</th>
|
||||
<th>Crop Factor</th>
|
||||
<th>Is Working?</th>
|
||||
<th>Notes</th>
|
||||
<th>Serial</th>
|
||||
<th>Formerly Owned?</th>
|
||||
<th>Purchase Price</th>
|
||||
<th>Battery Type</th>
|
||||
<th>Film Format</th>
|
||||
<th>Received</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for camera in cameras %}
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera_edit', { 'id': camera.id }) }}">edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><a href="{{ path('camera_show', { 'id': camera.id }) }}">{{ camera.id }}</a></td>
|
||||
<td>{{ camera.brand }}</td>
|
||||
<td>{{ camera.mount }}</td>
|
||||
<td>{{ camera.model }}</td>
|
||||
<td>{% if camera.isDigital %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ camera.cropFactor }}</td>
|
||||
<td>{% if camera.isWorking %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ camera.notes }}</td>
|
||||
<td>{{ camera.serial }}</td>
|
||||
<td>{% if camera.formerlyOwned %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ camera.purchasePrice }}</td>
|
||||
<td>{{ camera.batteryType }}</td>
|
||||
<td>{{ camera.filmFormat }}</td>
|
||||
<td>{% if camera.received %}Yes{% else %}No{% endif %}</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
{% endblock %}
|
22
app/Resources/views/camera/new.html.twig
Normal file
22
app/Resources/views/camera/new.html.twig
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Add a Camera</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button type="submit" class="button">Add</button>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
86
app/Resources/views/camera/show.html.twig
Normal file
86
app/Resources/views/camera/show.html.twig
Normal file
@ -0,0 +1,86 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Camera</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera_index') }}">Back to the list</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('camera_edit', { 'id': camera.id }) }}">Edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
|
||||
<div class="primary callout">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ camera.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Brand</th>
|
||||
<td>{{ camera.brand }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Mount</th>
|
||||
<td>{{ camera.mount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Model</th>
|
||||
<td>{{ camera.model }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is Digital?</th>
|
||||
<td>{% if camera.isDigital %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Crop Factor</th>
|
||||
<td>{{ camera.cropFactor }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is Working?</th>
|
||||
<td>{% if camera.isWorking %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Notes</th>
|
||||
<td>{{ camera.notes }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Serial</th>
|
||||
<td>{{ camera.serial }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Formerly Owned?</th>
|
||||
<td>{% if camera.formerlyOwned %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Purchase Price</th>
|
||||
<td>{{ camera.purchasePrice }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Battery Type</th>
|
||||
<td>{{ camera.batteryType }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Film Format</th>
|
||||
<td>{{ camera.filmFormat }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Received</th>
|
||||
<td>{% if camera.received %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="callout">
|
||||
{{ form_start(delete_form) }}
|
||||
<button type="submit" class="alert button">Delete Camera</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</div>
|
||||
{% endblock %}
|
26
app/Resources/views/cameratype/edit.html.twig
Normal file
26
app/Resources/views/cameratype/edit.html.twig
Normal file
@ -0,0 +1,26 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Edit Camera Type</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera-type_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="callout primary">
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<button type="submit" class="button">Save</button>
|
||||
{{ form_end(edit_form) }}
|
||||
|
||||
<hr />
|
||||
|
||||
{{ form_start(delete_form) }}
|
||||
<button type="submit" class="alert button">Delete</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</div>
|
||||
{% endblock %}
|
39
app/Resources/views/cameratype/index.html.twig
Normal file
39
app/Resources/views/cameratype/index.html.twig
Normal file
@ -0,0 +1,39 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Camera Types</h1>
|
||||
|
||||
<div class="primary callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera-type_new') }}">Add a Camera Type</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Actions</th>
|
||||
<th>Id</th>
|
||||
<th>Type</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for cameraType in cameraTypes %}
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera-type_edit', { 'id': cameraType.id }) }}">edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><a href="{{ path('camera-type_show', { 'id': cameraType.id }) }}">{{ cameraType.id }}</a></td>
|
||||
<td>{{ cameraType.type }}</td>
|
||||
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
20
app/Resources/views/cameratype/new.html.twig
Normal file
20
app/Resources/views/cameratype/new.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Add a Camera Type</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera-type_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="callout primary">
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button type="submit" class="button">Add</button>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
37
app/Resources/views/cameratype/show.html.twig
Normal file
37
app/Resources/views/cameratype/show.html.twig
Normal file
@ -0,0 +1,37 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Camera Type</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('camera-type_index') }}">Back to the list</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('camera-type_edit', { 'id': cameraType.id }) }}">Edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ cameraType.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Type</th>
|
||||
<td>{{ cameraType.type }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="callout">
|
||||
{{ form_start(delete_form) }}
|
||||
<button type="submit" class="alert button">Delete Camera Type</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</div>
|
||||
{% endblock %}
|
6
app/Resources/views/default/index.html.twig
Normal file
6
app/Resources/views/default/index.html.twig
Normal file
@ -0,0 +1,6 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<div class="grid-container"></div>
|
||||
{% endblock %}
|
||||
|
26
app/Resources/views/flash/edit.html.twig
Normal file
26
app/Resources/views/flash/edit.html.twig
Normal file
@ -0,0 +1,26 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Flash edit</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('flash_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<button type="submit" class="button">Update</button>
|
||||
{{ form_end(edit_form) }}
|
||||
|
||||
<hr />
|
||||
|
||||
{{ form_start(delete_form) }}
|
||||
<button type="submit" class="alert button">Delete Flash</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</div>
|
||||
{% endblock %}
|
62
app/Resources/views/flash/index.html.twig
Normal file
62
app/Resources/views/flash/index.html.twig
Normal file
@ -0,0 +1,62 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Flashes list</h1>
|
||||
|
||||
<div class="primary callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('flash_new') }}">Add a Flash</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Actions</th>
|
||||
<th>Id</th>
|
||||
<th>Brand</th>
|
||||
<th>Model</th>
|
||||
<th>Is Auto Flash?</th>
|
||||
<th>Is TTL?</th>
|
||||
<th>TTL Type</th>
|
||||
<th>Is P-TTL?</th>
|
||||
<th>P-TTL type</th>
|
||||
<th>Guide Number</th>
|
||||
<th>Purchase Price</th>
|
||||
<th>Batteries</th>
|
||||
<th>Notes</th>
|
||||
<th>Serial</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for flash in flashes %}
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('flash_edit', { 'id': flash.id }) }}">edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><a href="{{ path('flash_show', { 'id': flash.id }) }}">{{ flash.id }}</a></td>
|
||||
<td>{{ flash.brand }}</td>
|
||||
<td>{{ flash.model }}</td>
|
||||
<td>{% if flash.isAutoFlash %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{% if flash.isTtl %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ flash.ttlType }}</td>
|
||||
<td>{% if flash.isPTtl %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ flash.pTtlType }}</td>
|
||||
<td>{{ flash.guideNumber }}</td>
|
||||
<td>{{ flash.purchasePrice }}</td>
|
||||
<td>{{ flash.batteries }}</td>
|
||||
<td>{{ flash.notes }}</td>
|
||||
<td>{{ flash.serial }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
{% endblock %}
|
22
app/Resources/views/flash/new.html.twig
Normal file
22
app/Resources/views/flash/new.html.twig
Normal file
@ -0,0 +1,22 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Flash creation</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('flash_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="callout primary">
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button type="submit" class="button">Add</button>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
82
app/Resources/views/flash/show.html.twig
Normal file
82
app/Resources/views/flash/show.html.twig
Normal file
@ -0,0 +1,82 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Flash</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('flash_index') }}">Back to the list</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('flash_edit', { 'id': flash.id }) }}">Edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ flash.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Brand</th>
|
||||
<td>{{ flash.brand }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Model</th>
|
||||
<td>{{ flash.model }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is Auto Flash?</th>
|
||||
<td>{% if flash.isAutoFlash %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is TTL?</th>
|
||||
<td>{% if flash.isTtl %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>TTL Type</th>
|
||||
<td>{{ flash.ttlType }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is P-TTL?</th>
|
||||
<td>{% if flash.isPTtl %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>P-TTL Type</th>
|
||||
<td>{{ flash.pTtlType }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Guide Number</th>
|
||||
<td>{{ flash.guideNumber }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Purchase Price</th>
|
||||
<td>{{ flash.purchasePrice }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Batteries</th>
|
||||
<td>{{ flash.batteries }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Notes</th>
|
||||
<td>{{ flash.notes }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Serial</th>
|
||||
<td>{{ flash.serial }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="callout">
|
||||
{{ form_start(delete_form) }}
|
||||
<button type="submit" class="alert button">Delete Flash</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
19
app/Resources/views/form.html.twig
Normal file
19
app/Resources/views/form.html.twig
Normal file
@ -0,0 +1,19 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block stylesheets %}
|
||||
<style>
|
||||
th {
|
||||
text-align: right;
|
||||
}
|
||||
</style>
|
||||
{% endblock %}
|
||||
|
||||
{% block body %}
|
||||
<div class="grid-container">
|
||||
<div class="x-grid">
|
||||
<div class="medium-4">
|
||||
{% block form %}{% endblock %}
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
{% endblock %}
|
28
app/Resources/views/lenses/edit.html.twig
Normal file
28
app/Resources/views/lenses/edit.html.twig
Normal file
@ -0,0 +1,28 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Edit Lens</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('lens_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<button type="submit" class="button">Update</button>
|
||||
{{ form_end(edit_form) }}
|
||||
|
||||
<hr />
|
||||
|
||||
{{ form_start(delete_form) }}
|
||||
<button type="submit" class="alert button">Delete Lens</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
66
app/Resources/views/lenses/index.html.twig
Normal file
66
app/Resources/views/lenses/index.html.twig
Normal file
@ -0,0 +1,66 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Lenses</h1>
|
||||
|
||||
<div class="primary callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('lens_new') }}">Add a Lens</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Actions</th>
|
||||
<th>Id</th>
|
||||
<th>Description</th>
|
||||
<th>Aperture Range</th>
|
||||
<th>Focal Range</th>
|
||||
<th>Serial</th>
|
||||
<th>Purchase Price</th>
|
||||
<th>Notes</th>
|
||||
<th>Mount</th>
|
||||
<th>Received</th>
|
||||
<th>Formerly Owned</th>
|
||||
<th>Front Filter Size</th>
|
||||
<th>Rear Filter Size</th>
|
||||
<th>Is Teleconverter?</th>
|
||||
<th>Design Elements / Groups</th>
|
||||
<th>Aperture Blades</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for lense in lenses %}
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('lens_edit', { 'id': lense.id }) }}">edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><a href="{{ path('lens_show', { 'id': lense.id }) }}">{{ lense.id }}</a></td>
|
||||
<td>{{ lense.brand }} {{ lense.coatings }} {{ lense.productLine }} {{ lense.model }}</td>
|
||||
<td>{{ lense.minFStop }} — {{ lense.maxFStop }}</td>
|
||||
<td>{{ lense.minFocalLength }} — {{ lense.maxFocalLength }}</td>
|
||||
<td>{{ lense.serial }}</td>
|
||||
<td>{{ lense.purchasePrice }}</td>
|
||||
<td>{{ lense.notes }}</td>
|
||||
<td>{{ lense.mount }}</td>
|
||||
<td>{% if lense.received %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{% if lense.formerlyOwned %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ lense.frontFilterSize }}</td>
|
||||
<td>{{ lense.rearFilterSize }}</td>
|
||||
<td>{% if lense.isTeleconverter %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ lense.designElements }} / {{ lense.designGroups }}</td>
|
||||
<td>{{ lense.apertureBlades }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
|
||||
|
||||
{% endblock %}
|
20
app/Resources/views/lenses/new.html.twig
Normal file
20
app/Resources/views/lenses/new.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Add a Lens</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('lens_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
{{ form_start(form) }}
|
||||
{{ form_widget(form) }}
|
||||
<button type="submit" class="button">Add</button>
|
||||
{{ form_end(form) }}
|
||||
</div>
|
||||
{% endblock %}
|
102
app/Resources/views/lenses/show.html.twig
Normal file
102
app/Resources/views/lenses/show.html.twig
Normal file
@ -0,0 +1,102 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Lens</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('lens_index') }}">Back to the list</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('lens_edit', { 'id': lense.id }) }}">Edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ lense.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Brand</th>
|
||||
<td>{{ lense.brand }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Coatings</th>
|
||||
<td>{{ lense.coatings }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Product Line</th>
|
||||
<td>{{ lense.productLine }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Model</th>
|
||||
<td>{{ lense.model }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Aperture Range</th>
|
||||
<td>ƒ {{ lense.minFStop }} — {{ lense.maxFStop }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Focal Range</th>
|
||||
<td>{{ lense.minFocalLength }} — {{ lense.maxFocalLength }}mm</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Serial</th>
|
||||
<td>{{ lense.serial }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Purchase Price</th>
|
||||
<td>{{ lense.purchasePrice }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Notes</th>
|
||||
<td>{{ lense.notes }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Mount</th>
|
||||
<td>{{ lense.mount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Received</th>
|
||||
<td>{% if lense.received %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Formerly Owned?</th>
|
||||
<td>{% if lense.formerlyOwned %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Front Filter Size</th>
|
||||
<td>{{ lense.frontFilterSize }}mm</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Rear Filter Size</th>
|
||||
<td>{{ lense.rearFilterSize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is Teleconverter?</th>
|
||||
<td>{% if lense.isTeleconverter %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Design Elements / Groups</th>
|
||||
<td>{{ lense.designElements }} / {{ lense.designGroups }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Aperture Blades</th>
|
||||
<td>{{ lense.apertureBlades }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
<div class="callout">
|
||||
{{ form_start(delete_form) }}
|
||||
<button type="submit" class="alert button">Delete Lens</button>
|
||||
{{ form_end(delete_form) }}
|
||||
</div>
|
||||
|
||||
{% endblock %}
|
20
app/Resources/views/previouslyownedcamera/edit.html.twig
Normal file
20
app/Resources/views/previouslyownedcamera/edit.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Edit Camera</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('previously-owned-camera_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<button type="submit" class="button">Update</button>
|
||||
{{ form_end(edit_form) }}
|
||||
</div>
|
||||
{% endblock %}
|
52
app/Resources/views/previouslyownedcamera/index.html.twig
Normal file
52
app/Resources/views/previouslyownedcamera/index.html.twig
Normal file
@ -0,0 +1,52 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Previously Owned Cameras</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Actions</th>
|
||||
<th>Id</th>
|
||||
<th>Brand</th>
|
||||
<th>Mount</th>
|
||||
<th>Model</th>
|
||||
<th>Is Digital?</th>
|
||||
<th>Crop Factor</th>
|
||||
<th>Is Working?</th>
|
||||
<th>Notes</th>
|
||||
<th>Serial</th>
|
||||
<th>Purchase Price</th>
|
||||
<th>Battery Type</th>
|
||||
<th>Film Format</th>
|
||||
<th>Received</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for previouslyOwnedCamera in previouslyOwnedCameras %}
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('previously-owned-camera_edit', { 'id': previouslyOwnedCamera.id }) }}">edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><a href="{{ path('previously-owned-camera_show', { 'id': previouslyOwnedCamera.id }) }}">{{ previouslyOwnedCamera.id }}</a></td>
|
||||
<td>{{ previouslyOwnedCamera.brand }}</td>
|
||||
<td>{{ previouslyOwnedCamera.mount }}</td>
|
||||
<td>{{ previouslyOwnedCamera.model }}</td>
|
||||
<td>{% if previouslyOwnedCamera.isDigital %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ previouslyOwnedCamera.cropFactor }}</td>
|
||||
<td>{% if previouslyOwnedCamera.isWorking %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ previouslyOwnedCamera.notes }}</td>
|
||||
<td>{{ previouslyOwnedCamera.serial }}</td>
|
||||
<td>{{ previouslyOwnedCamera.purchasePrice }}</td>
|
||||
<td>{{ previouslyOwnedCamera.batteryType }}</td>
|
||||
<td>{{ previouslyOwnedCamera.filmFormat }}</td>
|
||||
<td>{% if previouslyOwnedCamera.received %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
75
app/Resources/views/previouslyownedcamera/show.html.twig
Normal file
75
app/Resources/views/previouslyownedcamera/show.html.twig
Normal file
@ -0,0 +1,75 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Previously Owned Camera</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('previously-owned-camera_index') }}">Back to the list</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('previously-owned-camera_edit', { 'id': previouslyOwnedCamera.id }) }}">Edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ previouslyOwnedCamera.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Brand</th>
|
||||
<td>{{ previouslyOwnedCamera.brand }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Mount</th>
|
||||
<td>{{ previouslyOwnedCamera.mount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Model</th>
|
||||
<td>{{ previouslyOwnedCamera.model }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is Digital?</th>
|
||||
<td>{% if previouslyOwnedCamera.isDigital %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Crop Factor</th>
|
||||
<td>{{ previouslyOwnedCamera.cropFactor }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is Working?</th>
|
||||
<td>{% if previouslyOwnedCamera.isWorking %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Notes</th>
|
||||
<td>{{ previouslyOwnedCamera.notes }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Serial</th>
|
||||
<td>{{ previouslyOwnedCamera.serial }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Purchase Price</th>
|
||||
<td>{{ previouslyOwnedCamera.purchasePrice }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Battery Type</th>
|
||||
<td>{{ previouslyOwnedCamera.batteryType }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Film Format</th>
|
||||
<td>{{ previouslyOwnedCamera.filmFormat }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Received</th>
|
||||
<td>{% if previouslyOwnedCamera.received %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
{% endblock %}
|
20
app/Resources/views/previouslyownedlenses/edit.html.twig
Normal file
20
app/Resources/views/previouslyownedlenses/edit.html.twig
Normal file
@ -0,0 +1,20 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Edit Lens</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('previously-owned-lens_index') }}">Back to the list</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
{{ form_start(edit_form) }}
|
||||
{{ form_widget(edit_form) }}
|
||||
<button type="submit" class="button">Update</button>
|
||||
{{ form_end(edit_form) }}
|
||||
</div>
|
||||
{% endblock %}
|
58
app/Resources/views/previouslyownedlenses/index.html.twig
Normal file
58
app/Resources/views/previouslyownedlenses/index.html.twig
Normal file
@ -0,0 +1,58 @@
|
||||
{% extends 'base.html.twig' %}
|
||||
|
||||
{% block body %}
|
||||
<h1>Previously Owned Lenses</h1>
|
||||
|
||||
<table>
|
||||
<thead>
|
||||
<tr>
|
||||
<th>Actions</th>
|
||||
<th>Id</th>
|
||||
<th>Brand</th>
|
||||
<th>Coatings</th>
|
||||
<th>Product Line</th>
|
||||
<th>Model</th>
|
||||
<th>Aperture Range</th>
|
||||
<th>Focal Range</th>
|
||||
<th>Serial</th>
|
||||
<th>Purchase Price</th>
|
||||
<th>Notes</th>
|
||||
<th>Mount</th>
|
||||
<th>Front Filter Size</th>
|
||||
<th>Rear Filter Size</th>
|
||||
<th>Is Teleconverter?</th>
|
||||
<th>Design Elements/Groups</th>
|
||||
<th>Aperture Blades</th>
|
||||
</tr>
|
||||
</thead>
|
||||
<tbody>
|
||||
{% for previouslyOwnedLense in previouslyOwnedLenses %}
|
||||
<tr>
|
||||
<td>
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('previously-owned-lens_edit', { 'id': previouslyOwnedLense.id }) }}">edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</td>
|
||||
<td><a href="{{ path('previously-owned-lens_show', { 'id': previouslyOwnedLense.id }) }}">{{ previouslyOwnedLense.id }}</a></td>
|
||||
<td>{{ previouslyOwnedLense.brand }}</td>
|
||||
<td>{{ previouslyOwnedLense.coatings }}</td>
|
||||
<td>{{ previouslyOwnedLense.productLine }}</td>
|
||||
<td>{{ previouslyOwnedLense.model }}</td>
|
||||
<td>{{ previouslyOwnedLense.minFStop }} — {{ previouslyOwnedLense.maxFStop }}</td>
|
||||
<td>{{ previouslyOwnedLense.minFocalLength }} — {{ previouslyOwnedLense.maxFocalLength }}</td>
|
||||
<td>{{ previouslyOwnedLense.serial }}</td>
|
||||
<td>{{ previouslyOwnedLense.purchasePrice }}</td>
|
||||
<td>{{ previouslyOwnedLense.notes }}</td>
|
||||
<td>{{ previouslyOwnedLense.mount }}</td>
|
||||
<td>{{ previouslyOwnedLense.frontFilterSize }}</td>
|
||||
<td>{{ previouslyOwnedLense.rearFilterSize }}</td>
|
||||
<td>{% if previouslyOwnedLense.isTeleconverter %}Yes{% else %}No{% endif %}</td>
|
||||
<td>{{ previouslyOwnedLense.designElements }}/{{ previouslyOwnedLense.designGroups }}</td>
|
||||
<td>{{ previouslyOwnedLense.apertureBlades }}</td>
|
||||
</tr>
|
||||
{% endfor %}
|
||||
</tbody>
|
||||
</table>
|
||||
{% endblock %}
|
89
app/Resources/views/previouslyownedlenses/show.html.twig
Normal file
89
app/Resources/views/previouslyownedlenses/show.html.twig
Normal file
@ -0,0 +1,89 @@
|
||||
{% extends 'form.html.twig' %}
|
||||
|
||||
{% block form %}
|
||||
<h1>Previously Owned Lens</h1>
|
||||
|
||||
<div class="callout">
|
||||
<ul>
|
||||
<li>
|
||||
<a href="{{ path('previously-owned-lens_index') }}">Back to the list</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="{{ path('previously-owned-lens_edit', { 'id': previouslyOwnedLense.id }) }}">Edit</a>
|
||||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
|
||||
<div class="primary callout">
|
||||
<table>
|
||||
<tbody>
|
||||
<tr>
|
||||
<th>Id</th>
|
||||
<td>{{ previouslyOwnedLense.id }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Brand</th>
|
||||
<td>{{ previouslyOwnedLense.brand }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Coatings</th>
|
||||
<td>{{ previouslyOwnedLense.coatings }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Product Line</th>
|
||||
<td>{{ previouslyOwnedLense.productLine }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Model</th>
|
||||
<td>{{ previouslyOwnedLense.model }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Aperture Range</th>
|
||||
<td>ƒ {{ previouslyOwnedLense.minFStop }} — {{ previouslyOwnedLense.maxFStop }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Focal Range</th>
|
||||
<td>{{ previouslyOwnedLense.minFocalLength }} — {{ previouslyOwnedLense.maxFocalLength }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Serial</th>
|
||||
<td>{{ previouslyOwnedLense.serial }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Purchase Price</th>
|
||||
<td>${{ previouslyOwnedLense.purchasePrice }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Notes</th>
|
||||
<td>{{ previouslyOwnedLense.notes }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Mount</th>
|
||||
<td>{{ previouslyOwnedLense.mount }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Front Filter Size</th>
|
||||
<td>{{ previouslyOwnedLense.frontFilterSize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Rear Filter Size</th>
|
||||
<td>{{ previouslyOwnedLense.rearFilterSize }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Is Teleconverter</th>
|
||||
<td>{% if previouslyOwnedLense.isTeleconverter %}Yes{% else %}No{% endif %}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Design Elements / Groups</th>
|
||||
<td>{{ previouslyOwnedLense.designElements }} / {{ previouslyOwnedLense.designGroups }}</td>
|
||||
</tr>
|
||||
<tr>
|
||||
<th>Aperture Blades</th>
|
||||
<td>{{ previouslyOwnedLense.apertureBlades }}</td>
|
||||
</tr>
|
||||
</tbody>
|
||||
</table>
|
||||
</div>
|
||||
|
||||
|
||||
{% endblock %}
|
73
app/config/config.yml
Normal file
73
app/config/config.yml
Normal file
@ -0,0 +1,73 @@
|
||||
imports:
|
||||
- { resource: parameters.yml }
|
||||
- { resource: security.yml }
|
||||
- { resource: services.yml }
|
||||
|
||||
# Put parameters here that don't need to change on each machine where the app is deployed
|
||||
# https://symfony.com/doc/current/best_practices/configuration.html#application-related-configuration
|
||||
parameters:
|
||||
locale: en
|
||||
|
||||
framework:
|
||||
#esi: ~
|
||||
#translator: { fallbacks: ['%locale%'] }
|
||||
secret: '%secret%'
|
||||
router:
|
||||
resource: '%kernel.project_dir%/app/config/routing.yml'
|
||||
strict_requirements: ~
|
||||
form: ~
|
||||
csrf_protection: ~
|
||||
validation: { enable_annotations: true }
|
||||
#serializer: { enable_annotations: true }
|
||||
templating:
|
||||
engines: ['twig']
|
||||
default_locale: '%locale%'
|
||||
trusted_hosts: ~
|
||||
session:
|
||||
# https://symfony.com/doc/current/reference/configuration/framework.html#handler-id
|
||||
handler_id: session.handler.native_file
|
||||
save_path: '%kernel.project_dir%/var/sessions/%kernel.environment%'
|
||||
fragments: ~
|
||||
http_method_override: true
|
||||
assets: ~
|
||||
php_errors:
|
||||
log: true
|
||||
|
||||
# Twig Configuration
|
||||
twig:
|
||||
debug: '%kernel.debug%'
|
||||
form_themes:
|
||||
- 'foundation_5_layout.html.twig'
|
||||
strict_variables: '%kernel.debug%'
|
||||
|
||||
# Doctrine Configuration
|
||||
doctrine:
|
||||
dbal:
|
||||
driver: pdo_pgsql
|
||||
host: '%database_host%'
|
||||
port: '%database_port%'
|
||||
dbname: '%database_name%'
|
||||
user: '%database_user%'
|
||||
password: '%database_password%'
|
||||
charset: UTF8
|
||||
# if using pdo_sqlite as your database driver:
|
||||
# 1. add the path in parameters.yml
|
||||
# e.g. database_path: '%kernel.project_dir%/var/data/data.sqlite'
|
||||
# 2. Uncomment database_path in parameters.yml.dist
|
||||
# 3. Uncomment next line:
|
||||
# path: '%database_path%'
|
||||
mapping_types:
|
||||
bit: boolean
|
||||
|
||||
orm:
|
||||
auto_generate_proxy_classes: '%kernel.debug%'
|
||||
naming_strategy: doctrine.orm.naming_strategy.underscore
|
||||
auto_mapping: true
|
||||
|
||||
# Swiftmailer Configuration
|
||||
swiftmailer:
|
||||
transport: '%mailer_transport%'
|
||||
host: '%mailer_host%'
|
||||
username: '%mailer_user%'
|
||||
password: '%mailer_password%'
|
||||
spool: { type: memory }
|
41
app/config/config_dev.yml
Normal file
41
app/config/config_dev.yml
Normal file
@ -0,0 +1,41 @@
|
||||
imports:
|
||||
- { resource: config.yml }
|
||||
|
||||
framework:
|
||||
router:
|
||||
resource: '%kernel.project_dir%/app/config/routing_dev.yml'
|
||||
strict_requirements: true
|
||||
profiler: { only_exceptions: false }
|
||||
|
||||
web_profiler:
|
||||
toolbar: true
|
||||
intercept_redirects: false
|
||||
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: stream
|
||||
path: '%kernel.logs_dir%/%kernel.environment%.log'
|
||||
level: debug
|
||||
channels: ['!event']
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
||||
channels: ['!event', '!doctrine', '!console']
|
||||
# To follow logs in real time, execute the following command:
|
||||
# `bin/console server:log -vv`
|
||||
server_log:
|
||||
type: server_log
|
||||
process_psr_3_messages: false
|
||||
host: 127.0.0.1:9911
|
||||
# uncomment to get logging in your browser
|
||||
# you may have to allow bigger header sizes in your Web server configuration
|
||||
#firephp:
|
||||
# type: firephp
|
||||
# level: info
|
||||
#chromephp:
|
||||
# type: chromephp
|
||||
# level: info
|
||||
|
||||
#swiftmailer:
|
||||
# delivery_addresses: ['me@example.com']
|
22
app/config/config_prod.yml
Normal file
22
app/config/config_prod.yml
Normal file
@ -0,0 +1,22 @@
|
||||
imports:
|
||||
- { resource: config.yml }
|
||||
|
||||
#doctrine:
|
||||
# orm:
|
||||
# metadata_cache_driver: apc
|
||||
# result_cache_driver: apc
|
||||
# query_cache_driver: apc
|
||||
|
||||
monolog:
|
||||
handlers:
|
||||
main:
|
||||
type: fingers_crossed
|
||||
action_level: error
|
||||
handler: nested
|
||||
nested:
|
||||
type: stream
|
||||
path: '%kernel.logs_dir%/%kernel.environment%.log'
|
||||
level: debug
|
||||
console:
|
||||
type: console
|
||||
process_psr_3_messages: false
|
16
app/config/config_test.yml
Normal file
16
app/config/config_test.yml
Normal file
@ -0,0 +1,16 @@
|
||||
imports:
|
||||
- { resource: config_dev.yml }
|
||||
|
||||
framework:
|
||||
test: ~
|
||||
session:
|
||||
storage_id: session.storage.mock_file
|
||||
profiler:
|
||||
collect: false
|
||||
|
||||
web_profiler:
|
||||
toolbar: false
|
||||
intercept_redirects: false
|
||||
|
||||
swiftmailer:
|
||||
disable_delivery: true
|
19
app/config/parameters.yml.dist
Normal file
19
app/config/parameters.yml.dist
Normal file
@ -0,0 +1,19 @@
|
||||
# This file is a "template" of what your parameters.yml file should look like
|
||||
# Set parameters here that may be different on each deployment target of the app, e.g. development, staging, production.
|
||||
# https://symfony.com/doc/current/best_practices/configuration.html#infrastructure-related-configuration
|
||||
parameters:
|
||||
database_host: 127.0.0.1
|
||||
database_port: ~
|
||||
database_name: symfony
|
||||
database_user: root
|
||||
database_password: ~
|
||||
# You should uncomment this if you want to use pdo_sqlite
|
||||
#database_path: '%kernel.project_dir%/var/data/data.sqlite'
|
||||
|
||||
mailer_transport: smtp
|
||||
mailer_host: 127.0.0.1
|
||||
mailer_user: ~
|
||||
mailer_password: ~
|
||||
|
||||
# A secret key that's used to generate certain security-related tokens
|
||||
secret: ThisTokenIsNotSoSecretChangeIt
|
3
app/config/routing.yml
Normal file
3
app/config/routing.yml
Normal file
@ -0,0 +1,3 @@
|
||||
app:
|
||||
resource: '@CameraBundle/Controller/'
|
||||
type: annotation
|
14
app/config/routing_dev.yml
Normal file
14
app/config/routing_dev.yml
Normal file
@ -0,0 +1,14 @@
|
||||
_wdt:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/wdt.xml'
|
||||
prefix: /_wdt
|
||||
|
||||
_profiler:
|
||||
resource: '@WebProfilerBundle/Resources/config/routing/profiler.xml'
|
||||
prefix: /_profiler
|
||||
|
||||
_errors:
|
||||
resource: '@TwigBundle/Resources/config/routing/errors.xml'
|
||||
prefix: /_error
|
||||
|
||||
_main:
|
||||
resource: routing.yml
|
24
app/config/security.yml
Normal file
24
app/config/security.yml
Normal file
@ -0,0 +1,24 @@
|
||||
# To get started with security, check out the documentation:
|
||||
# https://symfony.com/doc/current/security.html
|
||||
security:
|
||||
|
||||
# https://symfony.com/doc/current/security.html#b-configuring-how-users-are-loaded
|
||||
providers:
|
||||
in_memory:
|
||||
memory: ~
|
||||
|
||||
firewalls:
|
||||
# disables authentication for assets and the profiler, adapt it according to your needs
|
||||
dev:
|
||||
pattern: ^/(_(profiler|wdt)|css|images|js)/
|
||||
security: false
|
||||
|
||||
main:
|
||||
anonymous: ~
|
||||
# activate different ways to authenticate
|
||||
|
||||
# https://symfony.com/doc/current/security.html#a-configuring-how-your-users-will-authenticate
|
||||
#http_basic: ~
|
||||
|
||||
# https://symfony.com/doc/current/security/form_login_setup.html
|
||||
#form_login: ~
|
35
app/config/services.yml
Normal file
35
app/config/services.yml
Normal file
@ -0,0 +1,35 @@
|
||||
# Learn more about services, parameters and containers at
|
||||
# https://symfony.com/doc/current/service_container.html
|
||||
parameters:
|
||||
#parameter_name: value
|
||||
|
||||
services:
|
||||
# default configuration for services in *this* file
|
||||
_defaults:
|
||||
# automatically injects dependencies in your services
|
||||
autowire: true
|
||||
# automatically registers your services as commands, event subscribers, etc.
|
||||
autoconfigure: true
|
||||
# this means you cannot fetch services directly from the container via $container->get()
|
||||
# if you need to do this, you can override this setting on individual services
|
||||
public: false
|
||||
|
||||
# makes classes in src/CameraBundle available to be used as services
|
||||
# this creates a service per class whose id is the fully-qualified class name
|
||||
CameraBundle\:
|
||||
resource: '../../src/CameraBundle/*'
|
||||
# you can exclude directories or files
|
||||
# but if a service is unused, it's removed anyway
|
||||
exclude: '../../src/CameraBundle/{Entity,Repository,Tests}'
|
||||
|
||||
# controllers are imported separately to make sure they're public
|
||||
# and have a tag that allows actions to type-hint services
|
||||
CameraBundle\Controller\:
|
||||
resource: '../../src/CameraBundle/Controller'
|
||||
public: true
|
||||
tags: ['controller.service_arguments']
|
||||
|
||||
# add more services, or override services that need manual wiring
|
||||
# CameraBundle\Service\ExampleService:
|
||||
# arguments:
|
||||
# $someArgument: 'some_value'
|
27
bin/console
Executable file
27
bin/console
Executable file
@ -0,0 +1,27 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
use Symfony\Bundle\FrameworkBundle\Console\Application;
|
||||
use Symfony\Component\Console\Input\ArgvInput;
|
||||
use Symfony\Component\Debug\Debug;
|
||||
|
||||
// if you don't want to setup permissions the proper way, just uncomment the following PHP line
|
||||
// read https://symfony.com/doc/current/setup.html#checking-symfony-application-configuration-and-setup
|
||||
// for more information
|
||||
//umask(0000);
|
||||
|
||||
set_time_limit(0);
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
$input = new ArgvInput();
|
||||
$env = $input->getParameterOption(['--env', '-e'], getenv('SYMFONY_ENV') ?: 'dev');
|
||||
$debug = getenv('SYMFONY_DEBUG') !== '0' && !$input->hasParameterOption(['--no-debug', '']) && $env !== 'prod';
|
||||
|
||||
if ($debug) {
|
||||
Debug::enable();
|
||||
}
|
||||
|
||||
$kernel = new AppKernel($env, $debug);
|
||||
$application = new Application($kernel);
|
||||
$application->run($input);
|
146
bin/symfony_requirements
Executable file
146
bin/symfony_requirements
Executable file
@ -0,0 +1,146 @@
|
||||
#!/usr/bin/env php
|
||||
<?php
|
||||
|
||||
require_once dirname(__FILE__).'/../var/SymfonyRequirements.php';
|
||||
|
||||
$lineSize = 70;
|
||||
$symfonyRequirements = new SymfonyRequirements();
|
||||
$iniPath = $symfonyRequirements->getPhpIniConfigPath();
|
||||
|
||||
echo_title('Symfony Requirements Checker');
|
||||
|
||||
echo '> PHP is using the following php.ini file:'.PHP_EOL;
|
||||
if ($iniPath) {
|
||||
echo_style('green', ' '.$iniPath);
|
||||
} else {
|
||||
echo_style('yellow', ' WARNING: No configuration file (php.ini) used by PHP!');
|
||||
}
|
||||
|
||||
echo PHP_EOL.PHP_EOL;
|
||||
|
||||
echo '> Checking Symfony requirements:'.PHP_EOL.' ';
|
||||
|
||||
$messages = array();
|
||||
foreach ($symfonyRequirements->getRequirements() as $req) {
|
||||
if ($helpText = get_error_message($req, $lineSize)) {
|
||||
echo_style('red', 'E');
|
||||
$messages['error'][] = $helpText;
|
||||
} else {
|
||||
echo_style('green', '.');
|
||||
}
|
||||
}
|
||||
|
||||
$checkPassed = empty($messages['error']);
|
||||
|
||||
foreach ($symfonyRequirements->getRecommendations() as $req) {
|
||||
if ($helpText = get_error_message($req, $lineSize)) {
|
||||
echo_style('yellow', 'W');
|
||||
$messages['warning'][] = $helpText;
|
||||
} else {
|
||||
echo_style('green', '.');
|
||||
}
|
||||
}
|
||||
|
||||
if ($checkPassed) {
|
||||
echo_block('success', 'OK', 'Your system is ready to run Symfony projects');
|
||||
} else {
|
||||
echo_block('error', 'ERROR', 'Your system is not ready to run Symfony projects');
|
||||
|
||||
echo_title('Fix the following mandatory requirements', 'red');
|
||||
|
||||
foreach ($messages['error'] as $helpText) {
|
||||
echo ' * '.$helpText.PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
if (!empty($messages['warning'])) {
|
||||
echo_title('Optional recommendations to improve your setup', 'yellow');
|
||||
|
||||
foreach ($messages['warning'] as $helpText) {
|
||||
echo ' * '.$helpText.PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
echo PHP_EOL;
|
||||
echo_style('title', 'Note');
|
||||
echo ' The command console could use a different php.ini file'.PHP_EOL;
|
||||
echo_style('title', '~~~~');
|
||||
echo ' than the one used with your web server. To be on the'.PHP_EOL;
|
||||
echo ' safe side, please check the requirements from your web'.PHP_EOL;
|
||||
echo ' server using the ';
|
||||
echo_style('yellow', 'web/config.php');
|
||||
echo ' script.'.PHP_EOL;
|
||||
echo PHP_EOL;
|
||||
|
||||
exit($checkPassed ? 0 : 1);
|
||||
|
||||
function get_error_message(Requirement $requirement, $lineSize)
|
||||
{
|
||||
if ($requirement->isFulfilled()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$errorMessage = wordwrap($requirement->getTestMessage(), $lineSize - 3, PHP_EOL.' ').PHP_EOL;
|
||||
$errorMessage .= ' > '.wordwrap($requirement->getHelpText(), $lineSize - 5, PHP_EOL.' > ').PHP_EOL;
|
||||
|
||||
return $errorMessage;
|
||||
}
|
||||
|
||||
function echo_title($title, $style = null)
|
||||
{
|
||||
$style = $style ?: 'title';
|
||||
|
||||
echo PHP_EOL;
|
||||
echo_style($style, $title.PHP_EOL);
|
||||
echo_style($style, str_repeat('~', strlen($title)).PHP_EOL);
|
||||
echo PHP_EOL;
|
||||
}
|
||||
|
||||
function echo_style($style, $message)
|
||||
{
|
||||
// ANSI color codes
|
||||
$styles = array(
|
||||
'reset' => "\033[0m",
|
||||
'red' => "\033[31m",
|
||||
'green' => "\033[32m",
|
||||
'yellow' => "\033[33m",
|
||||
'error' => "\033[37;41m",
|
||||
'success' => "\033[37;42m",
|
||||
'title' => "\033[34m",
|
||||
);
|
||||
$supports = has_color_support();
|
||||
|
||||
echo($supports ? $styles[$style] : '').$message.($supports ? $styles['reset'] : '');
|
||||
}
|
||||
|
||||
function echo_block($style, $title, $message)
|
||||
{
|
||||
$message = ' '.trim($message).' ';
|
||||
$width = strlen($message);
|
||||
|
||||
echo PHP_EOL.PHP_EOL;
|
||||
|
||||
echo_style($style, str_repeat(' ', $width));
|
||||
echo PHP_EOL;
|
||||
echo_style($style, str_pad(' ['.$title.']', $width, ' ', STR_PAD_RIGHT));
|
||||
echo PHP_EOL;
|
||||
echo_style($style, $message);
|
||||
echo PHP_EOL;
|
||||
echo_style($style, str_repeat(' ', $width));
|
||||
echo PHP_EOL;
|
||||
}
|
||||
|
||||
function has_color_support()
|
||||
{
|
||||
static $support;
|
||||
|
||||
if (null === $support) {
|
||||
if (DIRECTORY_SEPARATOR == '\\') {
|
||||
$support = false !== getenv('ANSICON') || 'ON' === getenv('ConEmuANSI');
|
||||
} else {
|
||||
$support = function_exists('posix_isatty') && @posix_isatty(STDOUT);
|
||||
}
|
||||
}
|
||||
|
||||
return $support;
|
||||
}
|
69
composer.json
Normal file
69
composer.json
Normal file
@ -0,0 +1,69 @@
|
||||
{
|
||||
"name": "aviat/camera_crud",
|
||||
"license": "MIT",
|
||||
"type": "project",
|
||||
"description": "Admin CRUD for managing camera collection",
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"CameraBundle\\": "src/CameraBundle"
|
||||
},
|
||||
"classmap": [ "app/AppKernel.php", "app/AppCache.php" ]
|
||||
},
|
||||
"autoload-dev": {
|
||||
"psr-4": { "Tests\\": "tests/" },
|
||||
"files": [ "vendor/symfony/symfony/src/Symfony/Component/VarDumper/Resources/functions/dump.php" ]
|
||||
},
|
||||
"require": {
|
||||
"php": ">=7.1.0",
|
||||
"doctrine/doctrine-bundle": "^1.6",
|
||||
"doctrine/orm": "^2.5",
|
||||
"incenteev/composer-parameter-handler": "^2.0",
|
||||
"sensio/distribution-bundle": "^5.0.19",
|
||||
"sensio/framework-extra-bundle": "^3.0.2",
|
||||
"symfony/monolog-bundle": "^3.1.0",
|
||||
"symfony/polyfill-apcu": "^1.0",
|
||||
"symfony/swiftmailer-bundle": "^2.3.10",
|
||||
"symfony/symfony": "3.3.*",
|
||||
"twig/twig": "^1.0||^2.0"
|
||||
},
|
||||
"require-dev": {
|
||||
"sensio/generator-bundle": "^3.0",
|
||||
"symfony/phpunit-bridge": "^3.0"
|
||||
},
|
||||
"scripts": {
|
||||
"symfony-scripts": [
|
||||
"Incenteev\\ParameterHandler\\ScriptHandler::buildParameters",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::buildBootstrap",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::clearCache",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installAssets",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::installRequirementsFile",
|
||||
"Sensio\\Bundle\\DistributionBundle\\Composer\\ScriptHandler::prepareDeploymentTarget"
|
||||
],
|
||||
"post-install-cmd": [
|
||||
"@symfony-scripts"
|
||||
],
|
||||
"post-update-cmd": [
|
||||
"@symfony-scripts"
|
||||
]
|
||||
},
|
||||
"config": {
|
||||
"platform": {
|
||||
"php": "7.1.0"
|
||||
},
|
||||
"sort-packages": true
|
||||
},
|
||||
"extra": {
|
||||
"symfony-app-dir": "app",
|
||||
"symfony-bin-dir": "bin",
|
||||
"symfony-var-dir": "var",
|
||||
"symfony-web-dir": "web",
|
||||
"symfony-tests-dir": "tests",
|
||||
"symfony-assets-install": "relative",
|
||||
"incenteev-parameters": {
|
||||
"file": "app/config/parameters.yml"
|
||||
},
|
||||
"branch-alias": {
|
||||
"dev-master": "3.3-dev"
|
||||
}
|
||||
}
|
||||
}
|
3395
composer.lock
generated
Normal file
3395
composer.lock
generated
Normal file
File diff suppressed because it is too large
Load Diff
31
phpunit.xml.dist
Normal file
31
phpunit.xml.dist
Normal file
@ -0,0 +1,31 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
|
||||
<!-- https://phpunit.de/manual/current/en/appendixes.configuration.html -->
|
||||
<phpunit xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:noNamespaceSchemaLocation="http://schema.phpunit.de/4.8/phpunit.xsd"
|
||||
backupGlobals="false"
|
||||
colors="true"
|
||||
bootstrap="vendor/autoload.php"
|
||||
>
|
||||
<php>
|
||||
<ini name="error_reporting" value="-1" />
|
||||
<server name="KERNEL_CLASS" value="AppKernel" />
|
||||
</php>
|
||||
|
||||
<testsuites>
|
||||
<testsuite name="Project Test Suite">
|
||||
<directory>tests</directory>
|
||||
</testsuite>
|
||||
</testsuites>
|
||||
|
||||
<filter>
|
||||
<whitelist>
|
||||
<directory>src</directory>
|
||||
<exclude>
|
||||
<directory>src/*Bundle/Resources</directory>
|
||||
<directory>src/*/*Bundle/Resources</directory>
|
||||
<directory>src/*/Bundle/*Bundle/Resources</directory>
|
||||
</exclude>
|
||||
</whitelist>
|
||||
</filter>
|
||||
</phpunit>
|
7
src/.htaccess
Normal file
7
src/.htaccess
Normal file
@ -0,0 +1,7 @@
|
||||
<IfModule mod_authz_core.c>
|
||||
Require all denied
|
||||
</IfModule>
|
||||
<IfModule !mod_authz_core.c>
|
||||
Order deny,allow
|
||||
Deny from all
|
||||
</IfModule>
|
9
src/CameraBundle/CameraBundle.php
Normal file
9
src/CameraBundle/CameraBundle.php
Normal file
@ -0,0 +1,9 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle;
|
||||
|
||||
use Symfony\Component\HttpKernel\Bundle\Bundle;
|
||||
|
||||
class CameraBundle extends Bundle
|
||||
{
|
||||
}
|
136
src/CameraBundle/Controller/CameraController.php
Normal file
136
src/CameraBundle/Controller/CameraController.php
Normal file
@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Controller;
|
||||
|
||||
use CameraBundle\Entity\Camera;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Camera controller.
|
||||
*
|
||||
* @Route("camera")
|
||||
*/
|
||||
class CameraController extends Controller
|
||||
{
|
||||
/**
|
||||
* Lists all camera entities.
|
||||
*
|
||||
* @Route("/", name="camera_index")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$cameras = $em->getRepository('CameraBundle:Camera')->findAll();
|
||||
|
||||
return $this->render('camera/index.html.twig', array(
|
||||
'cameras' => $cameras,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new camera entity.
|
||||
*
|
||||
* @Route("/new", name="camera_new")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
$camera = new Camera();
|
||||
$form = $this->createForm('CameraBundle\Form\CameraType', $camera);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($camera);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirectToRoute('camera_show', array('id' => $camera->getId()));
|
||||
}
|
||||
|
||||
return $this->render('camera/new.html.twig', array(
|
||||
'camera' => $camera,
|
||||
'form' => $form->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a camera entity.
|
||||
*
|
||||
* @Route("/{id}", name="camera_show")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function showAction(Camera $camera)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($camera);
|
||||
|
||||
return $this->render('camera/show.html.twig', array(
|
||||
'camera' => $camera,
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing camera entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="camera_edit")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function editAction(Request $request, Camera $camera)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($camera);
|
||||
$editForm = $this->createForm('CameraBundle\Form\CameraType', $camera);
|
||||
$editForm->handleRequest($request);
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('camera_edit', array('id' => $camera->getId()));
|
||||
}
|
||||
|
||||
return $this->render('camera/edit.html.twig', array(
|
||||
'camera' => $camera,
|
||||
'edit_form' => $editForm->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a camera entity.
|
||||
*
|
||||
* @Route("/{id}", name="camera_delete")
|
||||
* @Method("DELETE")
|
||||
*/
|
||||
public function deleteAction(Request $request, Camera $camera)
|
||||
{
|
||||
$form = $this->createDeleteForm($camera);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->remove($camera);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('camera_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a form to delete a camera entity.
|
||||
*
|
||||
* @param Camera $camera The camera entity
|
||||
*
|
||||
* @return \Symfony\Component\Form\Form The form
|
||||
*/
|
||||
private function createDeleteForm(Camera $camera)
|
||||
{
|
||||
return $this->createFormBuilder()
|
||||
->setAction($this->generateUrl('camera_delete', array('id' => $camera->getId())))
|
||||
->setMethod('DELETE')
|
||||
->getForm()
|
||||
;
|
||||
}
|
||||
}
|
136
src/CameraBundle/Controller/CameraTypeController.php
Normal file
136
src/CameraBundle/Controller/CameraTypeController.php
Normal file
@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Controller;
|
||||
|
||||
use CameraBundle\Entity\CameraType;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Cameratype controller.
|
||||
*
|
||||
* @Route("camera-type")
|
||||
*/
|
||||
class CameraTypeController extends Controller
|
||||
{
|
||||
/**
|
||||
* Lists all cameraType entities.
|
||||
*
|
||||
* @Route("/", name="camera-type_index")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$cameraTypes = $em->getRepository('CameraBundle:CameraType')->findAll();
|
||||
|
||||
return $this->render('cameratype/index.html.twig', array(
|
||||
'cameraTypes' => $cameraTypes,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new cameraType entity.
|
||||
*
|
||||
* @Route("/new", name="camera-type_new")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
$cameraType = new Cameratype();
|
||||
$form = $this->createForm('CameraBundle\Form\CameraTypeType', $cameraType);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($cameraType);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirectToRoute('camera-type_show', array('id' => $cameraType->getId()));
|
||||
}
|
||||
|
||||
return $this->render('cameratype/new.html.twig', array(
|
||||
'cameraType' => $cameraType,
|
||||
'form' => $form->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a cameraType entity.
|
||||
*
|
||||
* @Route("/{id}", name="camera-type_show")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function showAction(CameraType $cameraType)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($cameraType);
|
||||
|
||||
return $this->render('cameratype/show.html.twig', array(
|
||||
'cameraType' => $cameraType,
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing cameraType entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="camera-type_edit")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function editAction(Request $request, CameraType $cameraType)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($cameraType);
|
||||
$editForm = $this->createForm('CameraBundle\Form\CameraTypeType', $cameraType);
|
||||
$editForm->handleRequest($request);
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('camera-type_edit', array('id' => $cameraType->getId()));
|
||||
}
|
||||
|
||||
return $this->render('cameratype/edit.html.twig', array(
|
||||
'cameraType' => $cameraType,
|
||||
'edit_form' => $editForm->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a cameraType entity.
|
||||
*
|
||||
* @Route("/{id}", name="camera-type_delete")
|
||||
* @Method("DELETE")
|
||||
*/
|
||||
public function deleteAction(Request $request, CameraType $cameraType)
|
||||
{
|
||||
$form = $this->createDeleteForm($cameraType);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->remove($cameraType);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('camera-type_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a form to delete a cameraType entity.
|
||||
*
|
||||
* @param CameraType $cameraType The cameraType entity
|
||||
*
|
||||
* @return \Symfony\Component\Form\Form The form
|
||||
*/
|
||||
private function createDeleteForm(CameraType $cameraType)
|
||||
{
|
||||
return $this->createFormBuilder()
|
||||
->setAction($this->generateUrl('camera-type_delete', array('id' => $cameraType->getId())))
|
||||
->setMethod('DELETE')
|
||||
->getForm()
|
||||
;
|
||||
}
|
||||
}
|
21
src/CameraBundle/Controller/DefaultController.php
Normal file
21
src/CameraBundle/Controller/DefaultController.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Controller;
|
||||
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
class DefaultController extends Controller
|
||||
{
|
||||
/**
|
||||
* @Route("/", name="homepage")
|
||||
*/
|
||||
public function indexAction(Request $request)
|
||||
{
|
||||
// replace this example code with whatever you need
|
||||
return $this->render('default/index.html.twig', [
|
||||
'base_dir' => realpath($this->getParameter('kernel.project_dir')).DIRECTORY_SEPARATOR,
|
||||
]);
|
||||
}
|
||||
}
|
136
src/CameraBundle/Controller/FlashController.php
Normal file
136
src/CameraBundle/Controller/FlashController.php
Normal file
@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Controller;
|
||||
|
||||
use CameraBundle\Entity\Flash;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Flash controller.
|
||||
*
|
||||
* @Route("flash")
|
||||
*/
|
||||
class FlashController extends Controller
|
||||
{
|
||||
/**
|
||||
* Lists all flash entities.
|
||||
*
|
||||
* @Route("/", name="flash_index")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$flashes = $em->getRepository('CameraBundle:Flash')->findAll();
|
||||
|
||||
return $this->render('flash/index.html.twig', array(
|
||||
'flashes' => $flashes,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new flash entity.
|
||||
*
|
||||
* @Route("/new", name="flash_new")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
$flash = new Flash();
|
||||
$form = $this->createForm('CameraBundle\Form\FlashType', $flash);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($flash);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirectToRoute('flash_show', array('id' => $flash->getId()));
|
||||
}
|
||||
|
||||
return $this->render('flash/new.html.twig', array(
|
||||
'flash' => $flash,
|
||||
'form' => $form->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a flash entity.
|
||||
*
|
||||
* @Route("/{id}", name="flash_show")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function showAction(Flash $flash)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($flash);
|
||||
|
||||
return $this->render('flash/show.html.twig', array(
|
||||
'flash' => $flash,
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing flash entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="flash_edit")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function editAction(Request $request, Flash $flash)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($flash);
|
||||
$editForm = $this->createForm('CameraBundle\Form\FlashType', $flash);
|
||||
$editForm->handleRequest($request);
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('flash_edit', array('id' => $flash->getId()));
|
||||
}
|
||||
|
||||
return $this->render('flash/edit.html.twig', array(
|
||||
'flash' => $flash,
|
||||
'edit_form' => $editForm->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a flash entity.
|
||||
*
|
||||
* @Route("/{id}", name="flash_delete")
|
||||
* @Method("DELETE")
|
||||
*/
|
||||
public function deleteAction(Request $request, Flash $flash)
|
||||
{
|
||||
$form = $this->createDeleteForm($flash);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->remove($flash);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('flash_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a form to delete a flash entity.
|
||||
*
|
||||
* @param Flash $flash The flash entity
|
||||
*
|
||||
* @return \Symfony\Component\Form\Form The form
|
||||
*/
|
||||
private function createDeleteForm(Flash $flash)
|
||||
{
|
||||
return $this->createFormBuilder()
|
||||
->setAction($this->generateUrl('flash_delete', array('id' => $flash->getId())))
|
||||
->setMethod('DELETE')
|
||||
->getForm()
|
||||
;
|
||||
}
|
||||
}
|
136
src/CameraBundle/Controller/LensesController.php
Normal file
136
src/CameraBundle/Controller/LensesController.php
Normal file
@ -0,0 +1,136 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Controller;
|
||||
|
||||
use CameraBundle\Entity\Lenses;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Lense controller.
|
||||
*
|
||||
* @Route("lens")
|
||||
*/
|
||||
class LensesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Lists all lense entities.
|
||||
*
|
||||
* @Route("/", name="lens_index")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$lenses = $em->getRepository('CameraBundle:Lenses')->findAll();
|
||||
|
||||
return $this->render('lenses/index.html.twig', array(
|
||||
'lenses' => $lenses,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a new lense entity.
|
||||
*
|
||||
* @Route("/new", name="lens_new")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function newAction(Request $request)
|
||||
{
|
||||
$lense = new Lenses();
|
||||
$form = $this->createForm('CameraBundle\Form\LensesType', $lense);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->persist($lense);
|
||||
$em->flush();
|
||||
|
||||
return $this->redirectToRoute('lens_show', array('id' => $lense->getId()));
|
||||
}
|
||||
|
||||
return $this->render('lenses/new.html.twig', array(
|
||||
'lense' => $lense,
|
||||
'form' => $form->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a lense entity.
|
||||
*
|
||||
* @Route("/{id}", name="lens_show")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function showAction(Lenses $lense)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($lense);
|
||||
|
||||
return $this->render('lenses/show.html.twig', array(
|
||||
'lense' => $lense,
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing lense entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="lens_edit")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function editAction(Request $request, Lenses $lense)
|
||||
{
|
||||
$deleteForm = $this->createDeleteForm($lense);
|
||||
$editForm = $this->createForm('CameraBundle\Form\LensesType', $lense);
|
||||
$editForm->handleRequest($request);
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('lens_edit', array('id' => $lense->getId()));
|
||||
}
|
||||
|
||||
return $this->render('lenses/edit.html.twig', array(
|
||||
'lense' => $lense,
|
||||
'edit_form' => $editForm->createView(),
|
||||
'delete_form' => $deleteForm->createView(),
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Deletes a lense entity.
|
||||
*
|
||||
* @Route("/{id}", name="lens_delete")
|
||||
* @Method("DELETE")
|
||||
*/
|
||||
public function deleteAction(Request $request, Lenses $lense)
|
||||
{
|
||||
$form = $this->createDeleteForm($lense);
|
||||
$form->handleRequest($request);
|
||||
|
||||
if ($form->isSubmitted() && $form->isValid()) {
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
$em->remove($lense);
|
||||
$em->flush();
|
||||
}
|
||||
|
||||
return $this->redirectToRoute('lens_index');
|
||||
}
|
||||
|
||||
/**
|
||||
* Creates a form to delete a lense entity.
|
||||
*
|
||||
* @param Lenses $lense The lense entity
|
||||
*
|
||||
* @return \Symfony\Component\Form\Form The form
|
||||
*/
|
||||
private function createDeleteForm(Lenses $lense)
|
||||
{
|
||||
return $this->createFormBuilder()
|
||||
->setAction($this->generateUrl('lens_delete', array('id' => $lense->getId())))
|
||||
->setMethod('DELETE')
|
||||
->getForm()
|
||||
;
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Controller;
|
||||
|
||||
use CameraBundle\Entity\PreviouslyOwnedCamera;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Previouslyownedcamera controller.
|
||||
*
|
||||
* @Route("previously-owned-camera")
|
||||
*/
|
||||
class PreviouslyOwnedCameraController extends Controller
|
||||
{
|
||||
/**
|
||||
* Lists all previouslyOwnedCamera entities.
|
||||
*
|
||||
* @Route("/", name="previously-owned-camera_index")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$previouslyOwnedCameras = $em->getRepository('CameraBundle:PreviouslyOwnedCamera')->findAll();
|
||||
|
||||
return $this->render('previouslyownedcamera/index.html.twig', array(
|
||||
'previouslyOwnedCameras' => $previouslyOwnedCameras,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a previouslyOwnedCamera entity.
|
||||
*
|
||||
* @Route("/{id}", name="previously-owned-camera_show")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function showAction(PreviouslyOwnedCamera $previouslyOwnedCamera)
|
||||
{
|
||||
return $this->render('previouslyownedcamera/show.html.twig', array(
|
||||
'previouslyOwnedCamera' => $previouslyOwnedCamera,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing previouslyOwnedCamera entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="previously-owned-camera_edit")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function editAction(Request $request, PreviouslyOwnedCamera $previouslyOwnedCamera)
|
||||
{
|
||||
$editForm = $this->createForm('CameraBundle\Form\PreviouslyOwnedCameraType', $previouslyOwnedCamera);
|
||||
$editForm->handleRequest($request);
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('previously-owned-camera_edit', array('id' => $previouslyOwnedCamera->getId()));
|
||||
}
|
||||
|
||||
return $this->render('previouslyownedcamera/edit.html.twig', array(
|
||||
'previouslyOwnedCamera' => $previouslyOwnedCamera,
|
||||
'edit_form' => $editForm->createView(),
|
||||
));
|
||||
}
|
||||
}
|
@ -0,0 +1,70 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Controller;
|
||||
|
||||
use CameraBundle\Entity\PreviouslyOwnedLenses;
|
||||
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
|
||||
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Route;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
/**
|
||||
* Previouslyownedlense controller.
|
||||
*
|
||||
* @Route("previously-owned-lens")
|
||||
*/
|
||||
class PreviouslyOwnedLensesController extends Controller
|
||||
{
|
||||
/**
|
||||
* Lists all previouslyOwnedLense entities.
|
||||
*
|
||||
* @Route("/", name="previously-owned-lens_index")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function indexAction()
|
||||
{
|
||||
$em = $this->getDoctrine()->getManager();
|
||||
|
||||
$previouslyOwnedLenses = $em->getRepository('CameraBundle:PreviouslyOwnedLenses')->findAll();
|
||||
|
||||
return $this->render('previouslyownedlenses/index.html.twig', array(
|
||||
'previouslyOwnedLenses' => $previouslyOwnedLenses,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Finds and displays a previouslyOwnedLense entity.
|
||||
*
|
||||
* @Route("/{id}", name="previously-owned-lens_show")
|
||||
* @Method("GET")
|
||||
*/
|
||||
public function showAction(PreviouslyOwnedLenses $previouslyOwnedLense)
|
||||
{
|
||||
return $this->render('previouslyownedlenses/show.html.twig', array(
|
||||
'previouslyOwnedLense' => $previouslyOwnedLense,
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* Displays a form to edit an existing previouslyOwnedLense entity.
|
||||
*
|
||||
* @Route("/{id}/edit", name="previously-owned-lens_edit")
|
||||
* @Method({"GET", "POST"})
|
||||
*/
|
||||
public function editAction(Request $request, PreviouslyOwnedLenses $previouslyOwnedLense)
|
||||
{
|
||||
$editForm = $this->createForm('CameraBundle\Form\PreviouslyOwnedLensesType', $previouslyOwnedLense);
|
||||
$editForm->handleRequest($request);
|
||||
|
||||
if ($editForm->isSubmitted() && $editForm->isValid()) {
|
||||
$this->getDoctrine()->getManager()->flush();
|
||||
|
||||
return $this->redirectToRoute('previously-owned-lens_edit', array('id' => $previouslyOwnedLense->getId()));
|
||||
}
|
||||
|
||||
return $this->render('previouslyownedlenses/edit.html.twig', array(
|
||||
'previouslyOwnedLense' => $previouslyOwnedLense,
|
||||
'edit_form' => $editForm->createView(),
|
||||
));
|
||||
}
|
||||
}
|
473
src/CameraBundle/Entity/Camera.php
Normal file
473
src/CameraBundle/Entity/Camera.php
Normal file
@ -0,0 +1,473 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera
|
||||
*
|
||||
* @ORM\Table(name="camera", schema="camera", indexes={
|
||||
@ORM\Index(name="IDX_747C826FC54C8C93", columns={"type_id"})
|
||||
})
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Camera
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var \CameraType
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="CameraType")
|
||||
* @ORM\JoinColumns({
|
||||
* @ORM\JoinColumn(name="type_id", referencedColumnName="id")
|
||||
* })
|
||||
*/
|
||||
private $type;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=32, nullable=false)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=255, nullable=false)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_digital", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isDigital;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="crop_factor", type="decimal", precision=10, scale=0, nullable=false)
|
||||
*/
|
||||
private $cropFactor = '1.0';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_working", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isWorking;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=20, nullable=false)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="battery_type", type="string", nullable=true)
|
||||
*/
|
||||
private $batteryType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_format", type="string", nullable=true)
|
||||
*/
|
||||
private $filmFormat = '135';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=true)
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param \CameraBundle\Entity\CameraType $type
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setType(\CameraBundle\Entity\CameraType $type = null)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
*
|
||||
* @return \CameraBundle\Entity\CameraType
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setBrand($brand)
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get brand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrand()
|
||||
{
|
||||
return $this->brand;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mount
|
||||
*
|
||||
* @param string $mount
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setMount($mount)
|
||||
{
|
||||
$this->mount = $mount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMount()
|
||||
{
|
||||
return $this->mount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set model
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setModel($model)
|
||||
{
|
||||
$this->model = $model;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get model
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isDigital
|
||||
*
|
||||
* @param boolean $isDigital
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setIsDigital($isDigital)
|
||||
{
|
||||
$this->isDigital = $isDigital;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isDigital
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsDigital()
|
||||
{
|
||||
return $this->isDigital;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cropFactor
|
||||
*
|
||||
* @param string $cropFactor
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setCropFactor($cropFactor)
|
||||
{
|
||||
$this->cropFactor = $cropFactor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cropFactor
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCropFactor()
|
||||
{
|
||||
return $this->cropFactor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isWorking
|
||||
*
|
||||
* @param boolean $isWorking
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setIsWorking($isWorking)
|
||||
{
|
||||
$this->isWorking = $isWorking;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isWorking
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsWorking()
|
||||
{
|
||||
return $this->isWorking;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set notes
|
||||
*
|
||||
* @param string $notes
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setNotes($notes)
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotes()
|
||||
{
|
||||
return $this->notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set serial
|
||||
*
|
||||
* @param string $serial
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serial
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial()
|
||||
{
|
||||
return $this->serial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set formerlyOwned
|
||||
*
|
||||
* @param boolean $formerlyOwned
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setFormerlyOwned($formerlyOwned)
|
||||
{
|
||||
$this->formerlyOwned = $formerlyOwned;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get formerlyOwned
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFormerlyOwned()
|
||||
{
|
||||
return $this->formerlyOwned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set purchasePrice
|
||||
*
|
||||
* @param string $purchasePrice
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setPurchasePrice($purchasePrice)
|
||||
{
|
||||
$this->purchasePrice = $purchasePrice ?? 0;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get purchasePrice
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchasePrice()
|
||||
{
|
||||
return (double) str_replace('$', '', (string)$this->purchasePrice) ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set batteryType
|
||||
*
|
||||
* @param string $batteryType
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setBatteryType($batteryType)
|
||||
{
|
||||
$this->batteryType = $batteryType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get batteryType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBatteryType()
|
||||
{
|
||||
return $this->batteryType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set filmFormat
|
||||
*
|
||||
* @param string $filmFormat
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setFilmFormat($filmFormat)
|
||||
{
|
||||
$this->filmFormat = $filmFormat;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filmFormat
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilmFormat()
|
||||
{
|
||||
return $this->filmFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set received
|
||||
*
|
||||
* @param boolean $received
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setReceived($received)
|
||||
{
|
||||
$this->received = $received;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get received
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReceived()
|
||||
{
|
||||
return $this->received;
|
||||
}
|
||||
}
|
475
src/CameraBundle/Entity/Camera.php~
Normal file
475
src/CameraBundle/Entity/Camera.php~
Normal file
@ -0,0 +1,475 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera
|
||||
*
|
||||
* @ORM\Table(name="camera", schema="camera", indexes={
|
||||
@ORM\Index(name="IDX_747C826FC54C8C93", columns={"type_id"})
|
||||
})
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Camera
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=32, nullable=false)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=255, nullable=false)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_digital", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isDigital;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="crop_factor", type="decimal", precision=10, scale=0, nullable=false)
|
||||
*/
|
||||
private $cropFactor = '1.0';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_working", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isWorking;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=20, nullable=false)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="battery_type", type="string", nullable=true)
|
||||
*/
|
||||
private $batteryType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_format", type="string", nullable=true)
|
||||
*/
|
||||
private $filmFormat = '135';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=true)
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
/**
|
||||
* @var \CameraType
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="CameraType")
|
||||
* @ORM\JoinColumns({
|
||||
* @ORM\JoinColumn(name="type_id", referencedColumnName="id")
|
||||
* })
|
||||
*/
|
||||
private $type;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setBrand($brand)
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get brand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrand()
|
||||
{
|
||||
return $this->brand;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mount
|
||||
*
|
||||
* @param string $mount
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setMount($mount)
|
||||
{
|
||||
$this->mount = $mount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMount()
|
||||
{
|
||||
return $this->mount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set model
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setModel($model)
|
||||
{
|
||||
$this->model = $model;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get model
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isDigital
|
||||
*
|
||||
* @param boolean $isDigital
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setIsDigital($isDigital)
|
||||
{
|
||||
$this->isDigital = $isDigital;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isDigital
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsDigital()
|
||||
{
|
||||
return $this->isDigital;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cropFactor
|
||||
*
|
||||
* @param string $cropFactor
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setCropFactor($cropFactor)
|
||||
{
|
||||
$this->cropFactor = $cropFactor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cropFactor
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCropFactor()
|
||||
{
|
||||
return $this->cropFactor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isWorking
|
||||
*
|
||||
* @param boolean $isWorking
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setIsWorking($isWorking)
|
||||
{
|
||||
$this->isWorking = $isWorking;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isWorking
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsWorking()
|
||||
{
|
||||
return $this->isWorking;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set notes
|
||||
*
|
||||
* @param string $notes
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setNotes($notes)
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotes()
|
||||
{
|
||||
return $this->notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set serial
|
||||
*
|
||||
* @param string $serial
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serial
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial()
|
||||
{
|
||||
return $this->serial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set formerlyOwned
|
||||
*
|
||||
* @param boolean $formerlyOwned
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setFormerlyOwned($formerlyOwned)
|
||||
{
|
||||
$this->formerlyOwned = $formerlyOwned;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get formerlyOwned
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFormerlyOwned()
|
||||
{
|
||||
return $this->formerlyOwned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set purchasePrice
|
||||
*
|
||||
* @param string $purchasePrice
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setPurchasePrice($purchasePrice)
|
||||
{
|
||||
$this->purchasePrice = $purchasePrice;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get purchasePrice
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getPurchasePrice()
|
||||
{
|
||||
return (float) str_replace('$', '', $this->purchasePrice);
|
||||
}
|
||||
|
||||
/**
|
||||
* Set batteryType
|
||||
*
|
||||
* @param string $batteryType
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setBatteryType($batteryType)
|
||||
{
|
||||
$this->batteryType = $batteryType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get batteryType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBatteryType()
|
||||
{
|
||||
return $this->batteryType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set filmFormat
|
||||
*
|
||||
* @param string $filmFormat
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setFilmFormat($filmFormat)
|
||||
{
|
||||
$this->filmFormat = $filmFormat;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filmFormat
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilmFormat()
|
||||
{
|
||||
return $this->filmFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set received
|
||||
*
|
||||
* @param boolean $received
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setReceived($received)
|
||||
{
|
||||
$this->received = $received;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get received
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReceived()
|
||||
{
|
||||
return $this->received;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param \CameraBundle\Entity\CameraType $type
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setType(\CameraBundle\Entity\CameraType $type = null)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
*
|
||||
* @return \CameraBundle\Entity\CameraType
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
78
src/CameraBundle/Entity/CameraType.php
Normal file
78
src/CameraBundle/Entity/CameraType.php
Normal file
@ -0,0 +1,78 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* CameraType
|
||||
*
|
||||
* @ORM\Table(name="camera_type", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class CameraType
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.camera_type_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="type", type="string", length=255, nullable=false)
|
||||
*/
|
||||
private $type;
|
||||
|
||||
|
||||
/**
|
||||
* Value for serialization
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function __toString()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param string $type
|
||||
*
|
||||
* @return CameraType
|
||||
*/
|
||||
public function setType($type)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
34
src/CameraBundle/Entity/CameraType.php~
Normal file
34
src/CameraBundle/Entity/CameraType.php~
Normal file
@ -0,0 +1,34 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* CameraType
|
||||
*
|
||||
* @ORM\Table(name="camera_type", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class CameraType
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.camera_type_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="type", type="string", length=255, nullable=false)
|
||||
*/
|
||||
private $type;
|
||||
|
||||
|
||||
}
|
||||
|
408
src/CameraBundle/Entity/Flash.php
Normal file
408
src/CameraBundle/Entity/Flash.php
Normal file
@ -0,0 +1,408 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.flash
|
||||
*
|
||||
* @ORM\Table(name="flash", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Flash
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.flash_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", nullable=false)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_auto_flash", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isAutoFlash = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_ttl", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isTtl = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="ttl_type", type="string", nullable=false)
|
||||
*/
|
||||
private $ttlType = 'N / A';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_p_ttl", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isPTtl = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="p_ttl_type", type="string", nullable=false)
|
||||
*/
|
||||
private $pTtlType = 'N / A';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="guide_number", type="string", nullable=true)
|
||||
*/
|
||||
private $guideNumber;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="batteries", type="string", nullable=false)
|
||||
*/
|
||||
private $batteries = '4x AA';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", nullable=true)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setBrand($brand)
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get brand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrand()
|
||||
{
|
||||
return $this->brand;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set model
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setModel($model)
|
||||
{
|
||||
$this->model = $model;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get model
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isAutoFlash
|
||||
*
|
||||
* @param boolean $isAutoFlash
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setIsAutoFlash($isAutoFlash)
|
||||
{
|
||||
$this->isAutoFlash = $isAutoFlash;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isAutoFlash
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsAutoFlash()
|
||||
{
|
||||
return $this->isAutoFlash;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isTtl
|
||||
*
|
||||
* @param boolean $isTtl
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setIsTtl($isTtl)
|
||||
{
|
||||
$this->isTtl = $isTtl;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isTtl
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsTtl()
|
||||
{
|
||||
return $this->isTtl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set ttlType
|
||||
*
|
||||
* @param string $ttlType
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setTtlType($ttlType)
|
||||
{
|
||||
$this->ttlType = $ttlType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get ttlType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getTtlType()
|
||||
{
|
||||
return $this->ttlType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isPTtl
|
||||
*
|
||||
* @param boolean $isPTtl
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setIsPTtl($isPTtl)
|
||||
{
|
||||
$this->isPTtl = $isPTtl;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isPTtl
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsPTtl()
|
||||
{
|
||||
return $this->isPTtl;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set pTtlType
|
||||
*
|
||||
* @param string $pTtlType
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setPTtlType($pTtlType)
|
||||
{
|
||||
$this->pTtlType = $pTtlType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get pTtlType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPTtlType()
|
||||
{
|
||||
return $this->pTtlType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set guideNumber
|
||||
*
|
||||
* @param string $guideNumber
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setGuideNumber($guideNumber)
|
||||
{
|
||||
$this->guideNumber = $guideNumber;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get guideNumber
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getGuideNumber()
|
||||
{
|
||||
return $this->guideNumber;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set purchasePrice
|
||||
*
|
||||
* @param string $purchasePrice
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setPurchasePrice($purchasePrice)
|
||||
{
|
||||
$this->purchasePrice = $purchasePrice;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get purchasePrice
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchasePrice()
|
||||
{
|
||||
return $this->purchasePrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set batteries
|
||||
*
|
||||
* @param string $batteries
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setBatteries($batteries)
|
||||
{
|
||||
$this->batteries = $batteries;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get batteries
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBatteries()
|
||||
{
|
||||
return $this->batteries;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set notes
|
||||
*
|
||||
* @param string $notes
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setNotes($notes)
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotes()
|
||||
{
|
||||
return $this->notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set serial
|
||||
*
|
||||
* @param string $serial
|
||||
*
|
||||
* @return Flash
|
||||
*/
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serial
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial()
|
||||
{
|
||||
return $this->serial;
|
||||
}
|
||||
}
|
111
src/CameraBundle/Entity/Flash.php~
Normal file
111
src/CameraBundle/Entity/Flash.php~
Normal file
@ -0,0 +1,111 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.flash
|
||||
*
|
||||
* @ORM\Table(name="flash", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Flash
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.flash_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", nullable=false)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_auto_flash", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isAutoFlash = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_ttl", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isTtl = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="ttl_type", type="string", nullable=false)
|
||||
*/
|
||||
private $ttlType = 'N / A';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_p_ttl", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isPTtl = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="p_ttl_type", type="string", nullable=false)
|
||||
*/
|
||||
private $pTtlType = 'N / A';
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="guide_number", type="string", nullable=true)
|
||||
*/
|
||||
private $guideNumber;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="batteries", type="string", nullable=false)
|
||||
*/
|
||||
private $batteries;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", nullable=true)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
|
||||
}
|
||||
|
656
src/CameraBundle/Entity/Lenses.php
Normal file
656
src/CameraBundle/Entity/Lenses.php
Normal file
@ -0,0 +1,656 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.lenses
|
||||
*
|
||||
* @ORM\Table(name="lenses", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Lenses
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.lenses_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $coatings;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $productLine;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $minFStop;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*
|
||||
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $maxFStop;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $minFocalLength;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $maxFocalLength;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=40, nullable=true)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=false)
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $frontFilterSize;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $rearFilterSize;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isTeleconverter = false;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designElements;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designGroups;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
|
||||
*/
|
||||
private $apertureBlades;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setBrand($brand)
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get brand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrand()
|
||||
{
|
||||
return $this->brand;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set coatings
|
||||
*
|
||||
* @param string $coatings
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setCoatings($coatings)
|
||||
{
|
||||
$this->coatings = $coatings;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get coatings
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCoatings()
|
||||
{
|
||||
return $this->coatings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set productLine
|
||||
*
|
||||
* @param string $productLine
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setProductLine($productLine)
|
||||
{
|
||||
$this->productLine = $productLine;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get productLine
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProductLine()
|
||||
{
|
||||
return $this->productLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set model
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setModel($model)
|
||||
{
|
||||
$this->model = $model;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get model
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set minFStop
|
||||
*
|
||||
* @param string $minFStop
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setMinFStop($minFStop)
|
||||
{
|
||||
$this->minFStop = $minFStop;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get minFStop
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMinFStop()
|
||||
{
|
||||
return $this->minFStop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set maxFStop
|
||||
*
|
||||
* @param float $maxFStop
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setMaxFStop($maxFStop)
|
||||
{
|
||||
$this->maxFStop = $maxFStop;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get maxFStop
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getMaxFStop()
|
||||
{
|
||||
return $this->maxFStop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set minFocalLength
|
||||
*
|
||||
* @param integer $minFocalLength
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setMinFocalLength($minFocalLength)
|
||||
{
|
||||
$this->minFocalLength = $minFocalLength;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get minFocalLength
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMinFocalLength()
|
||||
{
|
||||
return $this->minFocalLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set maxFocalLength
|
||||
*
|
||||
* @param integer $maxFocalLength
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setMaxFocalLength($maxFocalLength)
|
||||
{
|
||||
$this->maxFocalLength = $maxFocalLength;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get maxFocalLength
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMaxFocalLength()
|
||||
{
|
||||
return $this->maxFocalLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set serial
|
||||
*
|
||||
* @param string $serial
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serial
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial()
|
||||
{
|
||||
return $this->serial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set purchasePrice
|
||||
*
|
||||
* @param string $purchasePrice
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setPurchasePrice($purchasePrice)
|
||||
{
|
||||
$this->purchasePrice = $purchasePrice;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get purchasePrice
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchasePrice()
|
||||
{
|
||||
return $this->purchasePrice;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set notes
|
||||
*
|
||||
* @param string $notes
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setNotes($notes)
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotes()
|
||||
{
|
||||
return $this->notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mount
|
||||
*
|
||||
* @param string $mount
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setMount($mount)
|
||||
{
|
||||
$this->mount = $mount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMount()
|
||||
{
|
||||
return $this->mount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set received
|
||||
*
|
||||
* @param boolean $received
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setReceived($received)
|
||||
{
|
||||
$this->received = $received;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get received
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReceived()
|
||||
{
|
||||
return $this->received;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set formerlyOwned
|
||||
*
|
||||
* @param boolean $formerlyOwned
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setFormerlyOwned($formerlyOwned)
|
||||
{
|
||||
$this->formerlyOwned = $formerlyOwned;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get formerlyOwned
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFormerlyOwned()
|
||||
{
|
||||
return $this->formerlyOwned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set frontFilterSize
|
||||
*
|
||||
* @param string $frontFilterSize
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setFrontFilterSize($frontFilterSize)
|
||||
{
|
||||
$this->frontFilterSize = $frontFilterSize;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get frontFilterSize
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFrontFilterSize()
|
||||
{
|
||||
return $this->frontFilterSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set rearFilterSize
|
||||
*
|
||||
* @param string $rearFilterSize
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setRearFilterSize($rearFilterSize)
|
||||
{
|
||||
$this->rearFilterSize = $rearFilterSize;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get rearFilterSize
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRearFilterSize()
|
||||
{
|
||||
return $this->rearFilterSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isTeleconverter
|
||||
*
|
||||
* @param boolean $isTeleconverter
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setIsTeleconverter($isTeleconverter)
|
||||
{
|
||||
$this->isTeleconverter = $isTeleconverter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isTeleconverter
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsTeleconverter()
|
||||
{
|
||||
return $this->isTeleconverter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set designElements
|
||||
*
|
||||
* @param integer $designElements
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setDesignElements($designElements)
|
||||
{
|
||||
$this->designElements = $designElements;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get designElements
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getDesignElements()
|
||||
{
|
||||
return $this->designElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set designGroups
|
||||
*
|
||||
* @param integer $designGroups
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setDesignGroups($designGroups)
|
||||
{
|
||||
$this->designGroups = $designGroups;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get designGroups
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getDesignGroups()
|
||||
{
|
||||
return $this->designGroups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set apertureBlades
|
||||
*
|
||||
* @param integer $apertureBlades
|
||||
*
|
||||
* @return Lenses
|
||||
*/
|
||||
public function setApertureBlades($apertureBlades)
|
||||
{
|
||||
$this->apertureBlades = $apertureBlades;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get apertureBlades
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getApertureBlades()
|
||||
{
|
||||
return $this->apertureBlades;
|
||||
}
|
||||
}
|
167
src/CameraBundle/Entity/Lenses.php~
Normal file
167
src/CameraBundle/Entity/Lenses.php~
Normal file
@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.lenses
|
||||
*
|
||||
* @ORM\Table(name="lenses", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class Lenses
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.lenses_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $coatings;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $productLine;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $minFStop;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*
|
||||
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $maxFStop;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $minFocalLength;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $maxFocalLength;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=40, nullable=true)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=false)
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $frontFilterSize;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $rearFilterSize;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isTeleconverter = false;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designElements;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designGroups;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
|
||||
*/
|
||||
private $apertureBlades;
|
||||
|
||||
|
||||
}
|
||||
|
473
src/CameraBundle/Entity/PreviouslyOwnedCamera.php
Normal file
473
src/CameraBundle/Entity/PreviouslyOwnedCamera.php
Normal file
@ -0,0 +1,473 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.previouslyOwnedCamera
|
||||
*
|
||||
* @ORM\Table(name="previously_owned_camera", schema="camera", indexes={@ORM\Index(name="IDX_6EF94C6BC54C8C93", columns={"type_id"})})
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class PreviouslyOwnedCamera
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_camera_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=10, nullable=false)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=255, nullable=false)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_digital", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isDigital;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="crop_factor", type="decimal", precision=10, scale=0, nullable=false)
|
||||
*/
|
||||
private $cropFactor = '1.0';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_working", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isWorking;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=20, nullable=false)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="battery_type", type="string", nullable=true)
|
||||
*/
|
||||
private $batteryType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_format", type="string", nullable=true)
|
||||
*/
|
||||
private $filmFormat = '135';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=true)
|
||||
*/
|
||||
private $received = true;
|
||||
|
||||
/**
|
||||
* @var \Camera.cameraType
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="CameraType")
|
||||
* @ORM\JoinColumns({
|
||||
* @ORM\JoinColumn(name="type_id", referencedColumnName="id")
|
||||
* })
|
||||
*/
|
||||
private $type;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setBrand($brand)
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get brand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrand()
|
||||
{
|
||||
return $this->brand;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mount
|
||||
*
|
||||
* @param string $mount
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setMount($mount)
|
||||
{
|
||||
$this->mount = $mount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMount()
|
||||
{
|
||||
return $this->mount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set model
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setModel($model)
|
||||
{
|
||||
$this->model = $model;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get model
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isDigital
|
||||
*
|
||||
* @param boolean $isDigital
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setIsDigital($isDigital)
|
||||
{
|
||||
$this->isDigital = $isDigital;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isDigital
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsDigital()
|
||||
{
|
||||
return $this->isDigital;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set cropFactor
|
||||
*
|
||||
* @param string $cropFactor
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setCropFactor($cropFactor)
|
||||
{
|
||||
$this->cropFactor = $cropFactor;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get cropFactor
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCropFactor()
|
||||
{
|
||||
return $this->cropFactor;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isWorking
|
||||
*
|
||||
* @param boolean $isWorking
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setIsWorking($isWorking)
|
||||
{
|
||||
$this->isWorking = $isWorking;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isWorking
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsWorking()
|
||||
{
|
||||
return $this->isWorking;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set notes
|
||||
*
|
||||
* @param string $notes
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setNotes($notes)
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotes()
|
||||
{
|
||||
return $this->notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set serial
|
||||
*
|
||||
* @param string $serial
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serial
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial()
|
||||
{
|
||||
return $this->serial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set formerlyOwned
|
||||
*
|
||||
* @param boolean $formerlyOwned
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setFormerlyOwned($formerlyOwned)
|
||||
{
|
||||
$this->formerlyOwned = $formerlyOwned;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get formerlyOwned
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFormerlyOwned()
|
||||
{
|
||||
return $this->formerlyOwned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set purchasePrice
|
||||
*
|
||||
* @param string $purchasePrice
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setPurchasePrice($purchasePrice)
|
||||
{
|
||||
$this->purchasePrice = $purchasePrice ?? 0;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get purchasePrice
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchasePrice()
|
||||
{
|
||||
return (double) str_replace('$', '', (string)$this->purchasePrice) ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set batteryType
|
||||
*
|
||||
* @param string $batteryType
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setBatteryType($batteryType)
|
||||
{
|
||||
$this->batteryType = $batteryType;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get batteryType
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBatteryType()
|
||||
{
|
||||
return $this->batteryType;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set filmFormat
|
||||
*
|
||||
* @param string $filmFormat
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setFilmFormat($filmFormat)
|
||||
{
|
||||
$this->filmFormat = $filmFormat;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get filmFormat
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFilmFormat()
|
||||
{
|
||||
return $this->filmFormat;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set received
|
||||
*
|
||||
* @param boolean $received
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setReceived($received)
|
||||
{
|
||||
$this->received = $received;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get received
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReceived()
|
||||
{
|
||||
return $this->received;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set type
|
||||
*
|
||||
* @param \CameraBundle\Entity\CameraType $type
|
||||
*
|
||||
* @return PreviouslyOwnedCamera
|
||||
*/
|
||||
public function setType(\CameraBundle\Entity\CameraType $type = null)
|
||||
{
|
||||
$this->type = $type;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get type
|
||||
*
|
||||
* @return \CameraBundle\Entity\CameraType
|
||||
*/
|
||||
public function getType()
|
||||
{
|
||||
return $this->type;
|
||||
}
|
||||
}
|
128
src/CameraBundle/Entity/PreviouslyOwnedCamera.php~
Normal file
128
src/CameraBundle/Entity/PreviouslyOwnedCamera.php~
Normal file
@ -0,0 +1,128 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.previouslyOwnedCamera
|
||||
*
|
||||
* @ORM\Table(name="previously_owned_camera", schema="camera", indexes={@ORM\Index(name="IDX_6EF94C6BC54C8C93", columns={"type_id"})})
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class PreviouslyOwnedCamera
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_camera_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=false)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=10, nullable=false)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=255, nullable=false)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_digital", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isDigital;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="crop_factor", type="decimal", precision=10, scale=0, nullable=false)
|
||||
*/
|
||||
private $cropFactor = '1.0';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_working", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isWorking;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=20, nullable=false)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="battery_type", type="string", nullable=true)
|
||||
*/
|
||||
private $batteryType;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="film_format", type="string", nullable=true)
|
||||
*/
|
||||
private $filmFormat = '135';
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=true)
|
||||
*/
|
||||
private $received = true;
|
||||
|
||||
/**
|
||||
* @var \Camera.cameraType
|
||||
*
|
||||
* @ORM\ManyToOne(targetEntity="CameraType")
|
||||
* @ORM\JoinColumns({
|
||||
* @ORM\JoinColumn(name="type_id", referencedColumnName="id")
|
||||
* })
|
||||
*/
|
||||
private $type;
|
||||
|
||||
|
||||
}
|
||||
|
656
src/CameraBundle/Entity/PreviouslyOwnedLenses.php
Normal file
656
src/CameraBundle/Entity/PreviouslyOwnedLenses.php
Normal file
@ -0,0 +1,656 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.previouslyOwnedLenses
|
||||
*
|
||||
* @ORM\Table(name="previously_owned_lenses", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class PreviouslyOwnedLenses
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_lenses_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $coatings;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $productLine;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $minFStop;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*
|
||||
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $maxFStop;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $minFocalLength;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $maxFocalLength;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=false)
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $frontFilterSize;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $rearFilterSize;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isTeleconverter = false;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designElements;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designGroups;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
|
||||
*/
|
||||
private $apertureBlades;
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* Get id
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getId()
|
||||
{
|
||||
return $this->id;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set brand
|
||||
*
|
||||
* @param string $brand
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setBrand($brand)
|
||||
{
|
||||
$this->brand = $brand;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get brand
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getBrand()
|
||||
{
|
||||
return $this->brand;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set coatings
|
||||
*
|
||||
* @param string $coatings
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setCoatings($coatings)
|
||||
{
|
||||
$this->coatings = $coatings;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get coatings
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getCoatings()
|
||||
{
|
||||
return $this->coatings;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set productLine
|
||||
*
|
||||
* @param string $productLine
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setProductLine($productLine)
|
||||
{
|
||||
$this->productLine = $productLine;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get productLine
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getProductLine()
|
||||
{
|
||||
return $this->productLine;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set model
|
||||
*
|
||||
* @param string $model
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setModel($model)
|
||||
{
|
||||
$this->model = $model;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get model
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getModel()
|
||||
{
|
||||
return $this->model;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set minFStop
|
||||
*
|
||||
* @param string $minFStop
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setMinFStop($minFStop)
|
||||
{
|
||||
$this->minFStop = $minFStop;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get minFStop
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMinFStop()
|
||||
{
|
||||
return $this->minFStop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set maxFStop
|
||||
*
|
||||
* @param float $maxFStop
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setMaxFStop($maxFStop)
|
||||
{
|
||||
$this->maxFStop = $maxFStop;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get maxFStop
|
||||
*
|
||||
* @return float
|
||||
*/
|
||||
public function getMaxFStop()
|
||||
{
|
||||
return $this->maxFStop;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set minFocalLength
|
||||
*
|
||||
* @param integer $minFocalLength
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setMinFocalLength($minFocalLength)
|
||||
{
|
||||
$this->minFocalLength = $minFocalLength;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get minFocalLength
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMinFocalLength()
|
||||
{
|
||||
return $this->minFocalLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set maxFocalLength
|
||||
*
|
||||
* @param integer $maxFocalLength
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setMaxFocalLength($maxFocalLength)
|
||||
{
|
||||
$this->maxFocalLength = $maxFocalLength;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get maxFocalLength
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getMaxFocalLength()
|
||||
{
|
||||
return $this->maxFocalLength;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set serial
|
||||
*
|
||||
* @param string $serial
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setSerial($serial)
|
||||
{
|
||||
$this->serial = $serial;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get serial
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getSerial()
|
||||
{
|
||||
return $this->serial;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set purchasePrice
|
||||
*
|
||||
* @param string $purchasePrice
|
||||
*
|
||||
* @return Camera
|
||||
*/
|
||||
public function setPurchasePrice($purchasePrice)
|
||||
{
|
||||
$this->purchasePrice = $purchasePrice ?? 0;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get purchasePrice
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getPurchasePrice()
|
||||
{
|
||||
return (double) str_replace('$', '', (string)$this->purchasePrice) ?? 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set notes
|
||||
*
|
||||
* @param string $notes
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setNotes($notes)
|
||||
{
|
||||
$this->notes = $notes;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get notes
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getNotes()
|
||||
{
|
||||
return $this->notes;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set mount
|
||||
*
|
||||
* @param string $mount
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setMount($mount)
|
||||
{
|
||||
$this->mount = $mount;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get mount
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getMount()
|
||||
{
|
||||
return $this->mount;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set received
|
||||
*
|
||||
* @param boolean $received
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setReceived($received)
|
||||
{
|
||||
$this->received = $received;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get received
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getReceived()
|
||||
{
|
||||
return $this->received;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set formerlyOwned
|
||||
*
|
||||
* @param boolean $formerlyOwned
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setFormerlyOwned($formerlyOwned)
|
||||
{
|
||||
$this->formerlyOwned = $formerlyOwned;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get formerlyOwned
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getFormerlyOwned()
|
||||
{
|
||||
return $this->formerlyOwned;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set frontFilterSize
|
||||
*
|
||||
* @param string $frontFilterSize
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setFrontFilterSize($frontFilterSize)
|
||||
{
|
||||
$this->frontFilterSize = $frontFilterSize;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get frontFilterSize
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getFrontFilterSize()
|
||||
{
|
||||
return $this->frontFilterSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set rearFilterSize
|
||||
*
|
||||
* @param string $rearFilterSize
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setRearFilterSize($rearFilterSize)
|
||||
{
|
||||
$this->rearFilterSize = $rearFilterSize;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get rearFilterSize
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function getRearFilterSize()
|
||||
{
|
||||
return $this->rearFilterSize;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set isTeleconverter
|
||||
*
|
||||
* @param boolean $isTeleconverter
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setIsTeleconverter($isTeleconverter)
|
||||
{
|
||||
$this->isTeleconverter = $isTeleconverter;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get isTeleconverter
|
||||
*
|
||||
* @return boolean
|
||||
*/
|
||||
public function getIsTeleconverter()
|
||||
{
|
||||
return $this->isTeleconverter;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set designElements
|
||||
*
|
||||
* @param integer $designElements
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setDesignElements($designElements)
|
||||
{
|
||||
$this->designElements = $designElements;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get designElements
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getDesignElements()
|
||||
{
|
||||
return $this->designElements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set designGroups
|
||||
*
|
||||
* @param integer $designGroups
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setDesignGroups($designGroups)
|
||||
{
|
||||
$this->designGroups = $designGroups;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get designGroups
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getDesignGroups()
|
||||
{
|
||||
return $this->designGroups;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set apertureBlades
|
||||
*
|
||||
* @param integer $apertureBlades
|
||||
*
|
||||
* @return PreviouslyOwnedLenses
|
||||
*/
|
||||
public function setApertureBlades($apertureBlades)
|
||||
{
|
||||
$this->apertureBlades = $apertureBlades;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get apertureBlades
|
||||
*
|
||||
* @return integer
|
||||
*/
|
||||
public function getApertureBlades()
|
||||
{
|
||||
return $this->apertureBlades;
|
||||
}
|
||||
}
|
167
src/CameraBundle/Entity/PreviouslyOwnedLenses.php~
Normal file
167
src/CameraBundle/Entity/PreviouslyOwnedLenses.php~
Normal file
@ -0,0 +1,167 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Entity;
|
||||
|
||||
use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
/**
|
||||
* Camera.previouslyOwnedLenses
|
||||
*
|
||||
* @ORM\Table(name="previously_owned_lenses", schema="camera")
|
||||
* @ORM\Entity
|
||||
*/
|
||||
class PreviouslyOwnedLenses
|
||||
{
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="id", type="integer", nullable=false)
|
||||
* @ORM\Id
|
||||
* @ORM\GeneratedValue(strategy="SEQUENCE")
|
||||
* @ORM\SequenceGenerator(sequenceName="camera.previously_owned_lenses_id_seq", allocationSize=1, initialValue=1)
|
||||
*/
|
||||
private $id;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="brand", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $brand;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="coatings", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $coatings;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="product_line", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $productLine;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="model", type="string", length=64, nullable=true)
|
||||
*/
|
||||
private $model;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="min_f_stop", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $minFStop;
|
||||
|
||||
/**
|
||||
* @var float
|
||||
*
|
||||
* @ORM\Column(name="max_f_stop", type="float", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $maxFStop;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="min_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $minFocalLength;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="max_focal_length", type="integer", nullable=true)
|
||||
*/
|
||||
private $maxFocalLength;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="serial", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $serial;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="purchase_price", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $purchasePrice;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="notes", type="text", nullable=true)
|
||||
*/
|
||||
private $notes;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="mount", type="string", length=10, nullable=true)
|
||||
*/
|
||||
private $mount;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="received", type="boolean", nullable=false)
|
||||
*/
|
||||
private $received = false;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="formerly_owned", type="boolean", nullable=false)
|
||||
*/
|
||||
private $formerlyOwned = false;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="front_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $frontFilterSize;
|
||||
|
||||
/**
|
||||
* @var string
|
||||
*
|
||||
* @ORM\Column(name="rear_filter_size", type="decimal", precision=10, scale=0, nullable=true)
|
||||
*/
|
||||
private $rearFilterSize;
|
||||
|
||||
/**
|
||||
* @var boolean
|
||||
*
|
||||
* @ORM\Column(name="is_teleconverter", type="boolean", nullable=false)
|
||||
*/
|
||||
private $isTeleconverter = false;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_elements", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designElements;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="design_groups", type="smallint", nullable=true)
|
||||
*/
|
||||
private $designGroups;
|
||||
|
||||
/**
|
||||
* @var integer
|
||||
*
|
||||
* @ORM\Column(name="aperture_blades", type="smallint", nullable=true)
|
||||
*/
|
||||
private $apertureBlades;
|
||||
|
||||
|
||||
}
|
||||
|
51
src/CameraBundle/Form/CameraType.php
Normal file
51
src/CameraBundle/Form/CameraType.php
Normal file
@ -0,0 +1,51 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CameraType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('brand')
|
||||
->add('type')
|
||||
->add('isDigital')
|
||||
->add('mount')
|
||||
->add('model')
|
||||
->add('filmFormat')
|
||||
->add('cropFactor')
|
||||
->add('serial')
|
||||
->add('purchasePrice')
|
||||
->add('batteryType')
|
||||
->add('received')
|
||||
->add('isWorking')
|
||||
->add('formerlyOwned')
|
||||
->add('notes');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'CameraBundle\Entity\Camera'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'camerabundle_camera';
|
||||
}
|
||||
|
||||
|
||||
}
|
38
src/CameraBundle/Form/CameraTypeType.php
Normal file
38
src/CameraBundle/Form/CameraTypeType.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class CameraTypeType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('type');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'CameraBundle\Entity\CameraType'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'camerabundle_cameratype';
|
||||
}
|
||||
|
||||
|
||||
}
|
38
src/CameraBundle/Form/FlashType.php
Normal file
38
src/CameraBundle/Form/FlashType.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class FlashType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('brand')->add('model')->add('isAutoFlash')->add('isTtl')->add('ttlType')->add('isPTtl')->add('pTtlType')->add('guideNumber')->add('purchasePrice')->add('batteries')->add('notes')->add('serial');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'CameraBundle\Entity\Flash'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'camerabundle_flash';
|
||||
}
|
||||
|
||||
|
||||
}
|
38
src/CameraBundle/Form/LensesType.php
Normal file
38
src/CameraBundle/Form/LensesType.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class LensesType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('brand')->add('coatings')->add('productLine')->add('model')->add('minFStop')->add('maxFStop')->add('minFocalLength')->add('maxFocalLength')->add('serial')->add('purchasePrice')->add('notes')->add('mount')->add('received')->add('formerlyOwned')->add('frontFilterSize')->add('rearFilterSize')->add('isTeleconverter')->add('designElements')->add('designGroups')->add('apertureBlades');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'CameraBundle\Entity\Lenses'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'camerabundle_lenses';
|
||||
}
|
||||
|
||||
|
||||
}
|
38
src/CameraBundle/Form/PreviouslyOwnedCameraType.php
Normal file
38
src/CameraBundle/Form/PreviouslyOwnedCameraType.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PreviouslyOwnedCameraType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('brand')->add('mount')->add('model')->add('isDigital')->add('cropFactor')->add('isWorking')->add('notes')->add('serial')->add('formerlyOwned')->add('purchasePrice')->add('batteryType')->add('filmFormat')->add('received')->add('type');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'CameraBundle\Entity\PreviouslyOwnedCamera'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'camerabundle_previouslyownedcamera';
|
||||
}
|
||||
|
||||
|
||||
}
|
38
src/CameraBundle/Form/PreviouslyOwnedLensesType.php
Normal file
38
src/CameraBundle/Form/PreviouslyOwnedLensesType.php
Normal file
@ -0,0 +1,38 @@
|
||||
<?php
|
||||
|
||||
namespace CameraBundle\Form;
|
||||
|
||||
use Symfony\Component\Form\AbstractType;
|
||||
use Symfony\Component\Form\FormBuilderInterface;
|
||||
use Symfony\Component\OptionsResolver\OptionsResolver;
|
||||
|
||||
class PreviouslyOwnedLensesType extends AbstractType
|
||||
{
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function buildForm(FormBuilderInterface $builder, array $options)
|
||||
{
|
||||
$builder->add('brand')->add('coatings')->add('productLine')->add('model')->add('minFStop')->add('maxFStop')->add('minFocalLength')->add('maxFocalLength')->add('serial')->add('purchasePrice')->add('notes')->add('mount')->add('received')->add('formerlyOwned')->add('frontFilterSize')->add('rearFilterSize')->add('isTeleconverter')->add('designElements')->add('designGroups')->add('apertureBlades');
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function configureOptions(OptionsResolver $resolver)
|
||||
{
|
||||
$resolver->setDefaults(array(
|
||||
'data_class' => 'CameraBundle\Entity\PreviouslyOwnedLenses'
|
||||
));
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getBlockPrefix()
|
||||
{
|
||||
return 'camerabundle_previouslyownedlenses';
|
||||
}
|
||||
|
||||
|
||||
}
|
817
var/SymfonyRequirements.php
Executable file
817
var/SymfonyRequirements.php
Executable file
@ -0,0 +1,817 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of the Symfony package.
|
||||
*
|
||||
* (c) Fabien Potencier <fabien@symfony.com>
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
/*
|
||||
* Users of PHP 5.2 should be able to run the requirements checks.
|
||||
* This is why the file and all classes must be compatible with PHP 5.2+
|
||||
* (e.g. not using namespaces and closures).
|
||||
*
|
||||
* ************** CAUTION **************
|
||||
*
|
||||
* DO NOT EDIT THIS FILE as it will be overridden by Composer as part of
|
||||
* the installation/update process. The original file resides in the
|
||||
* SensioDistributionBundle.
|
||||
*
|
||||
* ************** CAUTION **************
|
||||
*/
|
||||
|
||||
/**
|
||||
* Represents a single PHP requirement, e.g. an installed extension.
|
||||
* It can be a mandatory requirement or an optional recommendation.
|
||||
* There is a special subclass, named PhpIniRequirement, to check a php.ini configuration.
|
||||
*
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*/
|
||||
class Requirement
|
||||
{
|
||||
private $fulfilled;
|
||||
private $testMessage;
|
||||
private $helpText;
|
||||
private $helpHtml;
|
||||
private $optional;
|
||||
|
||||
/**
|
||||
* Constructor that initializes the requirement.
|
||||
*
|
||||
* @param bool $fulfilled Whether the requirement is fulfilled
|
||||
* @param string $testMessage The message for testing the requirement
|
||||
* @param string $helpHtml The help text formatted in HTML for resolving the problem
|
||||
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
|
||||
* @param bool $optional Whether this is only an optional recommendation not a mandatory requirement
|
||||
*/
|
||||
public function __construct($fulfilled, $testMessage, $helpHtml, $helpText = null, $optional = false)
|
||||
{
|
||||
$this->fulfilled = (bool) $fulfilled;
|
||||
$this->testMessage = (string) $testMessage;
|
||||
$this->helpHtml = (string) $helpHtml;
|
||||
$this->helpText = null === $helpText ? strip_tags($this->helpHtml) : (string) $helpText;
|
||||
$this->optional = (bool) $optional;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether the requirement is fulfilled.
|
||||
*
|
||||
* @return bool true if fulfilled, otherwise false
|
||||
*/
|
||||
public function isFulfilled()
|
||||
{
|
||||
return $this->fulfilled;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the message for testing the requirement.
|
||||
*
|
||||
* @return string The test message
|
||||
*/
|
||||
public function getTestMessage()
|
||||
{
|
||||
return $this->testMessage;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the help text for resolving the problem.
|
||||
*
|
||||
* @return string The help text
|
||||
*/
|
||||
public function getHelpText()
|
||||
{
|
||||
return $this->helpText;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the help text formatted in HTML.
|
||||
*
|
||||
* @return string The HTML help
|
||||
*/
|
||||
public function getHelpHtml()
|
||||
{
|
||||
return $this->helpHtml;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether this is only an optional recommendation and not a mandatory requirement.
|
||||
*
|
||||
* @return bool true if optional, false if mandatory
|
||||
*/
|
||||
public function isOptional()
|
||||
{
|
||||
return $this->optional;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Represents a PHP requirement in form of a php.ini configuration.
|
||||
*
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*/
|
||||
class PhpIniRequirement extends Requirement
|
||||
{
|
||||
/**
|
||||
* Constructor that initializes the requirement.
|
||||
*
|
||||
* @param string $cfgName The configuration name used for ini_get()
|
||||
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
|
||||
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
|
||||
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
|
||||
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
|
||||
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
|
||||
* @param string|null $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
|
||||
* @param string|null $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
|
||||
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
|
||||
* @param bool $optional Whether this is only an optional recommendation not a mandatory requirement
|
||||
*/
|
||||
public function __construct($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null, $optional = false)
|
||||
{
|
||||
$cfgValue = ini_get($cfgName);
|
||||
|
||||
if (is_callable($evaluation)) {
|
||||
if (null === $testMessage || null === $helpHtml) {
|
||||
throw new InvalidArgumentException('You must provide the parameters testMessage and helpHtml for a callback evaluation.');
|
||||
}
|
||||
|
||||
$fulfilled = call_user_func($evaluation, $cfgValue);
|
||||
} else {
|
||||
if (null === $testMessage) {
|
||||
$testMessage = sprintf('%s %s be %s in php.ini',
|
||||
$cfgName,
|
||||
$optional ? 'should' : 'must',
|
||||
$evaluation ? 'enabled' : 'disabled'
|
||||
);
|
||||
}
|
||||
|
||||
if (null === $helpHtml) {
|
||||
$helpHtml = sprintf('Set <strong>%s</strong> to <strong>%s</strong> in php.ini<a href="#phpini">*</a>.',
|
||||
$cfgName,
|
||||
$evaluation ? 'on' : 'off'
|
||||
);
|
||||
}
|
||||
|
||||
$fulfilled = $evaluation == $cfgValue;
|
||||
}
|
||||
|
||||
parent::__construct($fulfilled || ($approveCfgAbsence && false === $cfgValue), $testMessage, $helpHtml, $helpText, $optional);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* A RequirementCollection represents a set of Requirement instances.
|
||||
*
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
*/
|
||||
class RequirementCollection implements IteratorAggregate
|
||||
{
|
||||
/**
|
||||
* @var Requirement[]
|
||||
*/
|
||||
private $requirements = array();
|
||||
|
||||
/**
|
||||
* Gets the current RequirementCollection as an Iterator.
|
||||
*
|
||||
* @return Traversable A Traversable interface
|
||||
*/
|
||||
public function getIterator()
|
||||
{
|
||||
return new ArrayIterator($this->requirements);
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a Requirement.
|
||||
*
|
||||
* @param Requirement $requirement A Requirement instance
|
||||
*/
|
||||
public function add(Requirement $requirement)
|
||||
{
|
||||
$this->requirements[] = $requirement;
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a mandatory requirement.
|
||||
*
|
||||
* @param bool $fulfilled Whether the requirement is fulfilled
|
||||
* @param string $testMessage The message for testing the requirement
|
||||
* @param string $helpHtml The help text formatted in HTML for resolving the problem
|
||||
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
|
||||
*/
|
||||
public function addRequirement($fulfilled, $testMessage, $helpHtml, $helpText = null)
|
||||
{
|
||||
$this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an optional recommendation.
|
||||
*
|
||||
* @param bool $fulfilled Whether the recommendation is fulfilled
|
||||
* @param string $testMessage The message for testing the recommendation
|
||||
* @param string $helpHtml The help text formatted in HTML for resolving the problem
|
||||
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
|
||||
*/
|
||||
public function addRecommendation($fulfilled, $testMessage, $helpHtml, $helpText = null)
|
||||
{
|
||||
$this->add(new Requirement($fulfilled, $testMessage, $helpHtml, $helpText, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a mandatory requirement in form of a php.ini configuration.
|
||||
*
|
||||
* @param string $cfgName The configuration name used for ini_get()
|
||||
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
|
||||
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
|
||||
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
|
||||
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
|
||||
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
|
||||
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
|
||||
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
|
||||
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
|
||||
*/
|
||||
public function addPhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
|
||||
{
|
||||
$this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, false));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds an optional recommendation in form of a php.ini configuration.
|
||||
*
|
||||
* @param string $cfgName The configuration name used for ini_get()
|
||||
* @param bool|callback $evaluation Either a boolean indicating whether the configuration should evaluate to true or false,
|
||||
* or a callback function receiving the configuration value as parameter to determine the fulfillment of the requirement
|
||||
* @param bool $approveCfgAbsence If true the Requirement will be fulfilled even if the configuration option does not exist, i.e. ini_get() returns false.
|
||||
* This is helpful for abandoned configs in later PHP versions or configs of an optional extension, like Suhosin.
|
||||
* Example: You require a config to be true but PHP later removes this config and defaults it to true internally.
|
||||
* @param string $testMessage The message for testing the requirement (when null and $evaluation is a boolean a default message is derived)
|
||||
* @param string $helpHtml The help text formatted in HTML for resolving the problem (when null and $evaluation is a boolean a default help is derived)
|
||||
* @param string|null $helpText The help text (when null, it will be inferred from $helpHtml, i.e. stripped from HTML tags)
|
||||
*/
|
||||
public function addPhpIniRecommendation($cfgName, $evaluation, $approveCfgAbsence = false, $testMessage = null, $helpHtml = null, $helpText = null)
|
||||
{
|
||||
$this->add(new PhpIniRequirement($cfgName, $evaluation, $approveCfgAbsence, $testMessage, $helpHtml, $helpText, true));
|
||||
}
|
||||
|
||||
/**
|
||||
* Adds a requirement collection to the current set of requirements.
|
||||
*
|
||||
* @param RequirementCollection $collection A RequirementCollection instance
|
||||
*/
|
||||
public function addCollection(RequirementCollection $collection)
|
||||
{
|
||||
$this->requirements = array_merge($this->requirements, $collection->all());
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns both requirements and recommendations.
|
||||
*
|
||||
* @return Requirement[]
|
||||
*/
|
||||
public function all()
|
||||
{
|
||||
return $this->requirements;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all mandatory requirements.
|
||||
*
|
||||
* @return Requirement[]
|
||||
*/
|
||||
public function getRequirements()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($this->requirements as $req) {
|
||||
if (!$req->isOptional()) {
|
||||
$array[] = $req;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the mandatory requirements that were not met.
|
||||
*
|
||||
* @return Requirement[]
|
||||
*/
|
||||
public function getFailedRequirements()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($this->requirements as $req) {
|
||||
if (!$req->isFulfilled() && !$req->isOptional()) {
|
||||
$array[] = $req;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns all optional recommendations.
|
||||
*
|
||||
* @return Requirement[]
|
||||
*/
|
||||
public function getRecommendations()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($this->requirements as $req) {
|
||||
if ($req->isOptional()) {
|
||||
$array[] = $req;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the recommendations that were not met.
|
||||
*
|
||||
* @return Requirement[]
|
||||
*/
|
||||
public function getFailedRecommendations()
|
||||
{
|
||||
$array = array();
|
||||
foreach ($this->requirements as $req) {
|
||||
if (!$req->isFulfilled() && $req->isOptional()) {
|
||||
$array[] = $req;
|
||||
}
|
||||
}
|
||||
|
||||
return $array;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns whether a php.ini configuration is not correct.
|
||||
*
|
||||
* @return bool php.ini configuration problem?
|
||||
*/
|
||||
public function hasPhpIniConfigIssue()
|
||||
{
|
||||
foreach ($this->requirements as $req) {
|
||||
if (!$req->isFulfilled() && $req instanceof PhpIniRequirement) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Returns the PHP configuration file (php.ini) path.
|
||||
*
|
||||
* @return string|false php.ini file path
|
||||
*/
|
||||
public function getPhpIniConfigPath()
|
||||
{
|
||||
return get_cfg_var('cfg_file_path');
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* This class specifies all requirements and optional recommendations that
|
||||
* are necessary to run the Symfony Standard Edition.
|
||||
*
|
||||
* @author Tobias Schultze <http://tobion.de>
|
||||
* @author Fabien Potencier <fabien@symfony.com>
|
||||
*/
|
||||
class SymfonyRequirements extends RequirementCollection
|
||||
{
|
||||
const LEGACY_REQUIRED_PHP_VERSION = '5.3.3';
|
||||
const REQUIRED_PHP_VERSION = '5.5.9';
|
||||
|
||||
/**
|
||||
* Constructor that initializes the requirements.
|
||||
*/
|
||||
public function __construct()
|
||||
{
|
||||
/* mandatory requirements follow */
|
||||
|
||||
$installedPhpVersion = phpversion();
|
||||
$requiredPhpVersion = $this->getPhpRequiredVersion();
|
||||
|
||||
$this->addRecommendation(
|
||||
$requiredPhpVersion,
|
||||
'Vendors should be installed in order to check all requirements.',
|
||||
'Run the <code>composer install</code> command.',
|
||||
'Run the "composer install" command.'
|
||||
);
|
||||
|
||||
if (false !== $requiredPhpVersion) {
|
||||
$this->addRequirement(
|
||||
version_compare($installedPhpVersion, $requiredPhpVersion, '>='),
|
||||
sprintf('PHP version must be at least %s (%s installed)', $requiredPhpVersion, $installedPhpVersion),
|
||||
sprintf('You are running PHP version "<strong>%s</strong>", but Symfony needs at least PHP "<strong>%s</strong>" to run.
|
||||
Before using Symfony, upgrade your PHP installation, preferably to the latest version.',
|
||||
$installedPhpVersion, $requiredPhpVersion),
|
||||
sprintf('Install PHP %s or newer (installed version is %s)', $requiredPhpVersion, $installedPhpVersion)
|
||||
);
|
||||
}
|
||||
|
||||
$this->addRequirement(
|
||||
version_compare($installedPhpVersion, '5.3.16', '!='),
|
||||
'PHP version must not be 5.3.16 as Symfony won\'t work properly with it',
|
||||
'Install PHP 5.3.17 or newer (or downgrade to an earlier PHP version)'
|
||||
);
|
||||
|
||||
$this->addRequirement(
|
||||
is_dir(__DIR__.'/../vendor/composer'),
|
||||
'Vendor libraries must be installed',
|
||||
'Vendor libraries are missing. Install composer following instructions from <a href="http://getcomposer.org/">http://getcomposer.org/</a>. '.
|
||||
'Then run "<strong>php composer.phar install</strong>" to install them.'
|
||||
);
|
||||
|
||||
$cacheDir = is_dir(__DIR__.'/../var/cache') ? __DIR__.'/../var/cache' : __DIR__.'/cache';
|
||||
|
||||
$this->addRequirement(
|
||||
is_writable($cacheDir),
|
||||
'app/cache/ or var/cache/ directory must be writable',
|
||||
'Change the permissions of either "<strong>app/cache/</strong>" or "<strong>var/cache/</strong>" directory so that the web server can write into it.'
|
||||
);
|
||||
|
||||
$logsDir = is_dir(__DIR__.'/../var/logs') ? __DIR__.'/../var/logs' : __DIR__.'/logs';
|
||||
|
||||
$this->addRequirement(
|
||||
is_writable($logsDir),
|
||||
'app/logs/ or var/logs/ directory must be writable',
|
||||
'Change the permissions of either "<strong>app/logs/</strong>" or "<strong>var/logs/</strong>" directory so that the web server can write into it.'
|
||||
);
|
||||
|
||||
if (version_compare($installedPhpVersion, '7.0.0', '<')) {
|
||||
$this->addPhpIniRequirement(
|
||||
'date.timezone', true, false,
|
||||
'date.timezone setting must be set',
|
||||
'Set the "<strong>date.timezone</strong>" setting in php.ini<a href="#phpini">*</a> (like Europe/Paris).'
|
||||
);
|
||||
}
|
||||
|
||||
if (false !== $requiredPhpVersion && version_compare($installedPhpVersion, $requiredPhpVersion, '>=')) {
|
||||
$timezones = array();
|
||||
foreach (DateTimeZone::listAbbreviations() as $abbreviations) {
|
||||
foreach ($abbreviations as $abbreviation) {
|
||||
$timezones[$abbreviation['timezone_id']] = true;
|
||||
}
|
||||
}
|
||||
|
||||
$this->addRequirement(
|
||||
isset($timezones[@date_default_timezone_get()]),
|
||||
sprintf('Configured default timezone "%s" must be supported by your installation of PHP', @date_default_timezone_get()),
|
||||
'Your default timezone is not supported by PHP. Check for typos in your <strong>php.ini</strong> file and have a look at the list of deprecated timezones at <a href="http://php.net/manual/en/timezones.others.php">http://php.net/manual/en/timezones.others.php</a>.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->addRequirement(
|
||||
function_exists('iconv'),
|
||||
'iconv() must be available',
|
||||
'Install and enable the <strong>iconv</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRequirement(
|
||||
function_exists('json_encode'),
|
||||
'json_encode() must be available',
|
||||
'Install and enable the <strong>JSON</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRequirement(
|
||||
function_exists('session_start'),
|
||||
'session_start() must be available',
|
||||
'Install and enable the <strong>session</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRequirement(
|
||||
function_exists('ctype_alpha'),
|
||||
'ctype_alpha() must be available',
|
||||
'Install and enable the <strong>ctype</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRequirement(
|
||||
function_exists('token_get_all'),
|
||||
'token_get_all() must be available',
|
||||
'Install and enable the <strong>Tokenizer</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRequirement(
|
||||
function_exists('simplexml_import_dom'),
|
||||
'simplexml_import_dom() must be available',
|
||||
'Install and enable the <strong>SimpleXML</strong> extension.'
|
||||
);
|
||||
|
||||
if (function_exists('apc_store') && ini_get('apc.enabled')) {
|
||||
if (version_compare($installedPhpVersion, '5.4.0', '>=')) {
|
||||
$this->addRequirement(
|
||||
version_compare(phpversion('apc'), '3.1.13', '>='),
|
||||
'APC version must be at least 3.1.13 when using PHP 5.4',
|
||||
'Upgrade your <strong>APC</strong> extension (3.1.13+).'
|
||||
);
|
||||
} else {
|
||||
$this->addRequirement(
|
||||
version_compare(phpversion('apc'), '3.0.17', '>='),
|
||||
'APC version must be at least 3.0.17',
|
||||
'Upgrade your <strong>APC</strong> extension (3.0.17+).'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->addPhpIniRequirement('detect_unicode', false);
|
||||
|
||||
if (extension_loaded('suhosin')) {
|
||||
$this->addPhpIniRequirement(
|
||||
'suhosin.executor.include.whitelist',
|
||||
create_function('$cfgValue', 'return false !== stripos($cfgValue, "phar");'),
|
||||
false,
|
||||
'suhosin.executor.include.whitelist must be configured correctly in php.ini',
|
||||
'Add "<strong>phar</strong>" to <strong>suhosin.executor.include.whitelist</strong> in php.ini<a href="#phpini">*</a>.'
|
||||
);
|
||||
}
|
||||
|
||||
if (extension_loaded('xdebug')) {
|
||||
$this->addPhpIniRequirement(
|
||||
'xdebug.show_exception_trace', false, true
|
||||
);
|
||||
|
||||
$this->addPhpIniRequirement(
|
||||
'xdebug.scream', false, true
|
||||
);
|
||||
|
||||
$this->addPhpIniRecommendation(
|
||||
'xdebug.max_nesting_level',
|
||||
create_function('$cfgValue', 'return $cfgValue > 100;'),
|
||||
true,
|
||||
'xdebug.max_nesting_level should be above 100 in php.ini',
|
||||
'Set "<strong>xdebug.max_nesting_level</strong>" to e.g. "<strong>250</strong>" in php.ini<a href="#phpini">*</a> to stop Xdebug\'s infinite recursion protection erroneously throwing a fatal error in your project.'
|
||||
);
|
||||
}
|
||||
|
||||
$pcreVersion = defined('PCRE_VERSION') ? (float) PCRE_VERSION : null;
|
||||
|
||||
$this->addRequirement(
|
||||
null !== $pcreVersion,
|
||||
'PCRE extension must be available',
|
||||
'Install the <strong>PCRE</strong> extension (version 8.0+).'
|
||||
);
|
||||
|
||||
if (extension_loaded('mbstring')) {
|
||||
$this->addPhpIniRequirement(
|
||||
'mbstring.func_overload',
|
||||
create_function('$cfgValue', 'return (int) $cfgValue === 0;'),
|
||||
true,
|
||||
'string functions should not be overloaded',
|
||||
'Set "<strong>mbstring.func_overload</strong>" to <strong>0</strong> in php.ini<a href="#phpini">*</a> to disable function overloading by the mbstring extension.'
|
||||
);
|
||||
}
|
||||
|
||||
/* optional recommendations follow */
|
||||
|
||||
if (file_exists(__DIR__.'/../vendor/composer')) {
|
||||
require_once __DIR__.'/../vendor/autoload.php';
|
||||
|
||||
try {
|
||||
$r = new ReflectionClass('Sensio\Bundle\DistributionBundle\SensioDistributionBundle');
|
||||
|
||||
$contents = file_get_contents(dirname($r->getFileName()).'/Resources/skeleton/app/SymfonyRequirements.php');
|
||||
} catch (ReflectionException $e) {
|
||||
$contents = '';
|
||||
}
|
||||
$this->addRecommendation(
|
||||
file_get_contents(__FILE__) === $contents,
|
||||
'Requirements file should be up-to-date',
|
||||
'Your requirements file is outdated. Run composer install and re-check your configuration.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->addRecommendation(
|
||||
version_compare($installedPhpVersion, '5.3.4', '>='),
|
||||
'You should use at least PHP 5.3.4 due to PHP bug #52083 in earlier versions',
|
||||
'Your project might malfunction randomly due to PHP bug #52083 ("Notice: Trying to get property of non-object"). Install PHP 5.3.4 or newer.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
version_compare($installedPhpVersion, '5.3.8', '>='),
|
||||
'When using annotations you should have at least PHP 5.3.8 due to PHP bug #55156',
|
||||
'Install PHP 5.3.8 or newer if your project uses annotations.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
version_compare($installedPhpVersion, '5.4.0', '!='),
|
||||
'You should not use PHP 5.4.0 due to the PHP bug #61453',
|
||||
'Your project might not work properly due to the PHP bug #61453 ("Cannot dump definitions which have method calls"). Install PHP 5.4.1 or newer.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
version_compare($installedPhpVersion, '5.4.11', '>='),
|
||||
'When using the logout handler from the Symfony Security Component, you should have at least PHP 5.4.11 due to PHP bug #63379 (as a workaround, you can also set invalidate_session to false in the security logout handler configuration)',
|
||||
'Install PHP 5.4.11 or newer if your project uses the logout handler from the Symfony Security Component.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
(version_compare($installedPhpVersion, '5.3.18', '>=') && version_compare($installedPhpVersion, '5.4.0', '<'))
|
||||
||
|
||||
version_compare($installedPhpVersion, '5.4.8', '>='),
|
||||
'You should use PHP 5.3.18+ or PHP 5.4.8+ to always get nice error messages for fatal errors in the development environment due to PHP bug #61767/#60909',
|
||||
'Install PHP 5.3.18+ or PHP 5.4.8+ if you want nice error messages for all fatal errors in the development environment.'
|
||||
);
|
||||
|
||||
if (null !== $pcreVersion) {
|
||||
$this->addRecommendation(
|
||||
$pcreVersion >= 8.0,
|
||||
sprintf('PCRE extension should be at least version 8.0 (%s installed)', $pcreVersion),
|
||||
'<strong>PCRE 8.0+</strong> is preconfigured in PHP since 5.3.2 but you are using an outdated version of it. Symfony probably works anyway but it is recommended to upgrade your PCRE extension.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->addRecommendation(
|
||||
class_exists('DomDocument'),
|
||||
'PHP-DOM and PHP-XML modules should be installed',
|
||||
'Install and enable the <strong>PHP-DOM</strong> and the <strong>PHP-XML</strong> modules.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
function_exists('mb_strlen'),
|
||||
'mb_strlen() should be available',
|
||||
'Install and enable the <strong>mbstring</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
function_exists('utf8_decode'),
|
||||
'utf8_decode() should be available',
|
||||
'Install and enable the <strong>XML</strong> extension.'
|
||||
);
|
||||
|
||||
$this->addRecommendation(
|
||||
function_exists('filter_var'),
|
||||
'filter_var() should be available',
|
||||
'Install and enable the <strong>filter</strong> extension.'
|
||||
);
|
||||
|
||||
if (!defined('PHP_WINDOWS_VERSION_BUILD')) {
|
||||
$this->addRecommendation(
|
||||
function_exists('posix_isatty'),
|
||||
'posix_isatty() should be available',
|
||||
'Install and enable the <strong>php_posix</strong> extension (used to colorize the CLI output).'
|
||||
);
|
||||
}
|
||||
|
||||
$this->addRecommendation(
|
||||
extension_loaded('intl'),
|
||||
'intl extension should be available',
|
||||
'Install and enable the <strong>intl</strong> extension (used for validators).'
|
||||
);
|
||||
|
||||
if (extension_loaded('intl')) {
|
||||
// in some WAMP server installations, new Collator() returns null
|
||||
$this->addRecommendation(
|
||||
null !== new Collator('fr_FR'),
|
||||
'intl extension should be correctly configured',
|
||||
'The intl extension does not behave properly. This problem is typical on PHP 5.3.X x64 WIN builds.'
|
||||
);
|
||||
|
||||
// check for compatible ICU versions (only done when you have the intl extension)
|
||||
if (defined('INTL_ICU_VERSION')) {
|
||||
$version = INTL_ICU_VERSION;
|
||||
} else {
|
||||
$reflector = new ReflectionExtension('intl');
|
||||
|
||||
ob_start();
|
||||
$reflector->info();
|
||||
$output = strip_tags(ob_get_clean());
|
||||
|
||||
preg_match('/^ICU version +(?:=> )?(.*)$/m', $output, $matches);
|
||||
$version = $matches[1];
|
||||
}
|
||||
|
||||
$this->addRecommendation(
|
||||
version_compare($version, '4.0', '>='),
|
||||
'intl ICU version should be at least 4+',
|
||||
'Upgrade your <strong>intl</strong> extension with a newer ICU version (4+).'
|
||||
);
|
||||
|
||||
if (class_exists('Symfony\Component\Intl\Intl')) {
|
||||
$this->addRecommendation(
|
||||
\Symfony\Component\Intl\Intl::getIcuDataVersion() <= \Symfony\Component\Intl\Intl::getIcuVersion(),
|
||||
sprintf('intl ICU version installed on your system is outdated (%s) and does not match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
|
||||
'To get the latest internationalization data upgrade the ICU system package and the intl PHP extension.'
|
||||
);
|
||||
if (\Symfony\Component\Intl\Intl::getIcuDataVersion() <= \Symfony\Component\Intl\Intl::getIcuVersion()) {
|
||||
$this->addRecommendation(
|
||||
\Symfony\Component\Intl\Intl::getIcuDataVersion() === \Symfony\Component\Intl\Intl::getIcuVersion(),
|
||||
sprintf('intl ICU version installed on your system (%s) does not match the ICU data bundled with Symfony (%s)', \Symfony\Component\Intl\Intl::getIcuVersion(), \Symfony\Component\Intl\Intl::getIcuDataVersion()),
|
||||
'To avoid internationalization data inconsistencies upgrade the symfony/intl component.'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
$this->addPhpIniRecommendation(
|
||||
'intl.error_level',
|
||||
create_function('$cfgValue', 'return (int) $cfgValue === 0;'),
|
||||
true,
|
||||
'intl.error_level should be 0 in php.ini',
|
||||
'Set "<strong>intl.error_level</strong>" to "<strong>0</strong>" in php.ini<a href="#phpini">*</a> to inhibit the messages when an error occurs in ICU functions.'
|
||||
);
|
||||
}
|
||||
|
||||
$accelerator =
|
||||
(extension_loaded('eaccelerator') && ini_get('eaccelerator.enable'))
|
||||
||
|
||||
(extension_loaded('apc') && ini_get('apc.enabled'))
|
||||
||
|
||||
(extension_loaded('Zend Optimizer+') && ini_get('zend_optimizerplus.enable'))
|
||||
||
|
||||
(extension_loaded('Zend OPcache') && ini_get('opcache.enable'))
|
||||
||
|
||||
(extension_loaded('xcache') && ini_get('xcache.cacher'))
|
||||
||
|
||||
(extension_loaded('wincache') && ini_get('wincache.ocenabled'))
|
||||
;
|
||||
|
||||
$this->addRecommendation(
|
||||
$accelerator,
|
||||
'a PHP accelerator should be installed',
|
||||
'Install and/or enable a <strong>PHP accelerator</strong> (highly recommended).'
|
||||
);
|
||||
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
$this->addRecommendation(
|
||||
$this->getRealpathCacheSize() >= 5 * 1024 * 1024,
|
||||
'realpath_cache_size should be at least 5M in php.ini',
|
||||
'Setting "<strong>realpath_cache_size</strong>" to e.g. "<strong>5242880</strong>" or "<strong>5M</strong>" in php.ini<a href="#phpini">*</a> may improve performance on Windows significantly in some cases.'
|
||||
);
|
||||
}
|
||||
|
||||
$this->addPhpIniRecommendation('short_open_tag', false);
|
||||
|
||||
$this->addPhpIniRecommendation('magic_quotes_gpc', false, true);
|
||||
|
||||
$this->addPhpIniRecommendation('register_globals', false, true);
|
||||
|
||||
$this->addPhpIniRecommendation('session.auto_start', false);
|
||||
|
||||
$this->addRecommendation(
|
||||
class_exists('PDO'),
|
||||
'PDO should be installed',
|
||||
'Install <strong>PDO</strong> (mandatory for Doctrine).'
|
||||
);
|
||||
|
||||
if (class_exists('PDO')) {
|
||||
$drivers = PDO::getAvailableDrivers();
|
||||
$this->addRecommendation(
|
||||
count($drivers) > 0,
|
||||
sprintf('PDO should have some drivers installed (currently available: %s)', count($drivers) ? implode(', ', $drivers) : 'none'),
|
||||
'Install <strong>PDO drivers</strong> (mandatory for Doctrine).'
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Loads realpath_cache_size from php.ini and converts it to int.
|
||||
*
|
||||
* (e.g. 16k is converted to 16384 int)
|
||||
*
|
||||
* @return int
|
||||
*/
|
||||
protected function getRealpathCacheSize()
|
||||
{
|
||||
$size = ini_get('realpath_cache_size');
|
||||
$size = trim($size);
|
||||
$unit = '';
|
||||
if (!ctype_digit($size)) {
|
||||
$unit = strtolower(substr($size, -1, 1));
|
||||
$size = (int) substr($size, 0, -1);
|
||||
}
|
||||
switch ($unit) {
|
||||
case 'g':
|
||||
return $size * 1024 * 1024 * 1024;
|
||||
case 'm':
|
||||
return $size * 1024 * 1024;
|
||||
case 'k':
|
||||
return $size * 1024;
|
||||
default:
|
||||
return (int) $size;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Defines PHP required version from Symfony version.
|
||||
*
|
||||
* @return string|false The PHP required version or false if it could not be guessed
|
||||
*/
|
||||
protected function getPhpRequiredVersion()
|
||||
{
|
||||
if (!file_exists($path = __DIR__.'/../composer.lock')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
$composerLock = json_decode(file_get_contents($path), true);
|
||||
foreach ($composerLock['packages'] as $package) {
|
||||
$name = $package['name'];
|
||||
if ('symfony/symfony' !== $name && 'symfony/http-kernel' !== $name) {
|
||||
continue;
|
||||
}
|
||||
|
||||
return (int) $package['version'][1] > 2 ? self::REQUIRED_PHP_VERSION : self::LEGACY_REQUIRED_PHP_VERSION;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
}
|
0
var/cache/.gitkeep
vendored
Executable file
0
var/cache/.gitkeep
vendored
Executable file
0
var/logs/.gitkeep
Executable file
0
var/logs/.gitkeep
Executable file
0
var/sessions/.gitkeep
Executable file
0
var/sessions/.gitkeep
Executable file
68
web/.htaccess
Normal file
68
web/.htaccess
Normal file
@ -0,0 +1,68 @@
|
||||
# Use the front controller as index file. It serves as a fallback solution when
|
||||
# every other rewrite/redirect fails (e.g. in an aliased environment without
|
||||
# mod_rewrite). Additionally, this reduces the matching process for the
|
||||
# start page (path "/") because otherwise Apache will apply the rewriting rules
|
||||
# to each configured DirectoryIndex file (e.g. index.php, index.html, index.pl).
|
||||
DirectoryIndex app.php
|
||||
|
||||
# By default, Apache does not evaluate symbolic links if you did not enable this
|
||||
# feature in your server configuration. Uncomment the following line if you
|
||||
# install assets as symlinks or if you experience problems related to symlinks
|
||||
# when compiling LESS/Sass/CoffeScript assets.
|
||||
# Options FollowSymlinks
|
||||
|
||||
# Disabling MultiViews prevents unwanted negotiation, e.g. "/app" should not resolve
|
||||
# to the front controller "/app.php" but be rewritten to "/app.php/app".
|
||||
<IfModule mod_negotiation.c>
|
||||
Options -MultiViews
|
||||
</IfModule>
|
||||
|
||||
<IfModule mod_rewrite.c>
|
||||
RewriteEngine On
|
||||
|
||||
# Determine the RewriteBase automatically and set it as environment variable.
|
||||
# If you are using Apache aliases to do mass virtual hosting or installed the
|
||||
# project in a subdirectory, the base path will be prepended to allow proper
|
||||
# resolution of the app.php file and to redirect to the correct URI. It will
|
||||
# work in environments without path prefix as well, providing a safe, one-size
|
||||
# fits all solution. But as you do not need it in this case, you can comment
|
||||
# the following 2 lines to eliminate the overhead.
|
||||
RewriteCond %{REQUEST_URI}::$1 ^(/.+)/(.*)::\2$
|
||||
RewriteRule ^(.*) - [E=BASE:%1]
|
||||
|
||||
# Sets the HTTP_AUTHORIZATION header removed by Apache
|
||||
RewriteCond %{HTTP:Authorization} .
|
||||
RewriteRule ^ - [E=HTTP_AUTHORIZATION:%{HTTP:Authorization}]
|
||||
|
||||
# Redirect to URI without front controller to prevent duplicate content
|
||||
# (with and without `/app.php`). Only do this redirect on the initial
|
||||
# rewrite by Apache and not on subsequent cycles. Otherwise we would get an
|
||||
# endless redirect loop (request -> rewrite to front controller ->
|
||||
# redirect -> request -> ...).
|
||||
# So in case you get a "too many redirects" error or you always get redirected
|
||||
# to the start page because your Apache does not expose the REDIRECT_STATUS
|
||||
# environment variable, you have 2 choices:
|
||||
# - disable this feature by commenting the following 2 lines or
|
||||
# - use Apache >= 2.3.9 and replace all L flags by END flags and remove the
|
||||
# following RewriteCond (best solution)
|
||||
RewriteCond %{ENV:REDIRECT_STATUS} ^$
|
||||
RewriteRule ^app\.php(?:/(.*)|$) %{ENV:BASE}/$1 [R=301,L]
|
||||
|
||||
# If the requested filename exists, simply serve it.
|
||||
# We only want to let Apache serve files and not directories.
|
||||
RewriteCond %{REQUEST_FILENAME} -f
|
||||
RewriteRule ^ - [L]
|
||||
|
||||
# Rewrite all other queries to the front controller.
|
||||
RewriteRule ^ %{ENV:BASE}/app.php [L]
|
||||
</IfModule>
|
||||
|
||||
<IfModule !mod_rewrite.c>
|
||||
<IfModule mod_alias.c>
|
||||
# When mod_rewrite is not available, we instruct a temporary redirect of
|
||||
# the start page to the front controller explicitly so that the website
|
||||
# and the generated links can still be used.
|
||||
RedirectMatch 302 ^/$ /app.php/
|
||||
# RedirectTemp cannot be used instead
|
||||
</IfModule>
|
||||
</IfModule>
|
21
web/app.php
Normal file
21
web/app.php
Normal file
@ -0,0 +1,21 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
if (PHP_VERSION_ID < 70000) {
|
||||
include_once __DIR__.'/../var/bootstrap.php.cache';
|
||||
}
|
||||
|
||||
$kernel = new AppKernel('prod', false);
|
||||
if (PHP_VERSION_ID < 70000) {
|
||||
$kernel->loadClassCache();
|
||||
}
|
||||
//$kernel = new AppCache($kernel);
|
||||
|
||||
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
|
||||
//Request::enableHttpMethodParameterOverride();
|
||||
$request = Request::createFromGlobals();
|
||||
$response = $kernel->handle($request);
|
||||
$response->send();
|
||||
$kernel->terminate($request, $response);
|
16
web/app_dev.php
Normal file
16
web/app_dev.php
Normal file
@ -0,0 +1,16 @@
|
||||
<?php
|
||||
|
||||
use Symfony\Component\Debug\Debug;
|
||||
use Symfony\Component\HttpFoundation\Request;
|
||||
|
||||
require __DIR__.'/../vendor/autoload.php';
|
||||
Debug::enable();
|
||||
|
||||
$kernel = new AppKernel('dev', true);
|
||||
if (PHP_VERSION_ID < 70000) {
|
||||
$kernel->loadClassCache();
|
||||
}
|
||||
$request = Request::createFromGlobals();
|
||||
$response = $kernel->handle($request);
|
||||
$response->send();
|
||||
$kernel->terminate($request, $response);
|
BIN
web/apple-touch-icon.png
Normal file
BIN
web/apple-touch-icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 2.0 KiB |
422
web/config.php
Normal file
422
web/config.php
Normal file
@ -0,0 +1,422 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* ************** CAUTION **************
|
||||
*
|
||||
* DO NOT EDIT THIS FILE as it will be overridden by Composer as part of
|
||||
* the installation/update process. The original file resides in the
|
||||
* SensioDistributionBundle.
|
||||
*
|
||||
* ************** CAUTION **************
|
||||
*/
|
||||
|
||||
if (!isset($_SERVER['HTTP_HOST'])) {
|
||||
exit("This script cannot be run from the CLI. Run it from a browser.\n");
|
||||
}
|
||||
|
||||
if (!in_array(@$_SERVER['REMOTE_ADDR'], array(
|
||||
'127.0.0.1',
|
||||
'::1',
|
||||
))) {
|
||||
header('HTTP/1.0 403 Forbidden');
|
||||
exit('This script is only accessible from localhost.');
|
||||
}
|
||||
|
||||
require_once dirname(__FILE__).'/../var/SymfonyRequirements.php';
|
||||
|
||||
$symfonyRequirements = new SymfonyRequirements();
|
||||
|
||||
$majorProblems = $symfonyRequirements->getFailedRequirements();
|
||||
$minorProblems = $symfonyRequirements->getFailedRecommendations();
|
||||
$hasMajorProblems = (bool) count($majorProblems);
|
||||
$hasMinorProblems = (bool) count($minorProblems);
|
||||
|
||||
?>
|
||||
<!DOCTYPE html>
|
||||
<html>
|
||||
<head>
|
||||
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"/>
|
||||
<meta name="robots" content="noindex,nofollow" />
|
||||
<title>Symfony Configuration Checker</title>
|
||||
<style>
|
||||
/* styles copied from symfony framework bundle */
|
||||
html {
|
||||
background: #eee;
|
||||
}
|
||||
body {
|
||||
font: 11px Verdana, Arial, sans-serif;
|
||||
color: #333;
|
||||
}
|
||||
.sf-reset, .sf-reset .block, .sf-reset #message {
|
||||
margin: auto;
|
||||
}
|
||||
img {
|
||||
border: 0;
|
||||
}
|
||||
.clear {
|
||||
clear: both;
|
||||
height: 0;
|
||||
font-size: 0;
|
||||
line-height: 0;
|
||||
}
|
||||
.clear-fix:after {
|
||||
content: "\0020";
|
||||
display: block;
|
||||
height: 0;
|
||||
clear: both;
|
||||
visibility: hidden;
|
||||
}
|
||||
.clear-fix {
|
||||
display: inline-block;
|
||||
}
|
||||
* html .clear-fix {
|
||||
height: 1%;
|
||||
}
|
||||
.clear-fix {
|
||||
display: block;
|
||||
}
|
||||
.header {
|
||||
padding: 30px 30px 20px 30px;
|
||||
}
|
||||
.header-logo {
|
||||
float: left;
|
||||
}
|
||||
.search {
|
||||
float: right;
|
||||
padding-top: 20px;
|
||||
}
|
||||
.search label {
|
||||
line-height: 28px;
|
||||
vertical-align: middle;
|
||||
}
|
||||
.search input {
|
||||
width: 195px;
|
||||
font-size: 12px;
|
||||
border: 1px solid #dadada;
|
||||
background: #fff url(data:image/gif;base64,R0lGODlhAQAFAKIAAPX19e/v7/39/fr6+urq6gAAAAAAAAAAACH5BAAAAAAALAAAAAABAAUAAAMESAEjCQA7) repeat-x left top;
|
||||
padding: 5px 6px;
|
||||
color: #565656;
|
||||
}
|
||||
.search input[type="search"] {
|
||||
-webkit-appearance: textfield;
|
||||
}
|
||||
#content {
|
||||
width: 970px;
|
||||
margin: 0 auto;
|
||||
}
|
||||
#content pre {
|
||||
white-space: normal;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
|
||||
/*
|
||||
Copyright (c) 2010, Yahoo! Inc. All rights reserved.
|
||||
Code licensed under the BSD License:
|
||||
http://developer.yahoo.com/yui/license.html
|
||||
version: 3.1.2
|
||||
build: 56
|
||||
*/
|
||||
.sf-reset div,.sf-reset dl,.sf-reset dt,.sf-reset dd,.sf-reset ul,.sf-reset ol,.sf-reset li,.sf-reset h1,.sf-reset h2,.sf-reset h3,.sf-reset h4,.sf-reset h5,.sf-reset h6,.sf-reset pre,.sf-reset code,.sf-reset form,.sf-reset fieldset,.sf-reset legend,.sf-reset input,.sf-reset textarea,.sf-reset p,.sf-reset blockquote,.sf-reset th,.sf-reset td{margin:0;padding:0;}.sf-reset table{border-collapse:collapse;border-spacing:0;}.sf-reset fieldset,.sf-reset img{border:0;}.sf-reset address,.sf-reset caption,.sf-reset cite,.sf-reset code,.sf-reset dfn,.sf-reset em,.sf-reset strong,.sf-reset th,.sf-reset var{font-style:normal;font-weight:normal;}.sf-reset li{list-style:none;}.sf-reset caption,.sf-reset th{text-align:left;}.sf-reset h1,.sf-reset h2,.sf-reset h3,.sf-reset h4,.sf-reset h5,.sf-reset h6{font-size:100%;font-weight:normal;}.sf-reset q:before,.sf-reset q:after{content:'';}.sf-reset abbr,.sf-reset acronym{border:0;font-variant:normal;}.sf-reset sup{vertical-align:text-top;}.sf-reset sub{vertical-align:text-bottom;}.sf-reset input,.sf-reset textarea,.sf-reset select{font-family:inherit;font-size:inherit;font-weight:inherit;}.sf-reset input,.sf-reset textarea,.sf-reset select{font-size:100%;}.sf-reset legend{color:#000;}
|
||||
.sf-reset abbr {
|
||||
border-bottom: 1px dotted #000;
|
||||
cursor: help;
|
||||
}
|
||||
.sf-reset p {
|
||||
font-size: 14px;
|
||||
line-height: 20px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.sf-reset strong {
|
||||
color: #313131;
|
||||
font-weight: bold;
|
||||
}
|
||||
.sf-reset a {
|
||||
color: #6c6159;
|
||||
}
|
||||
.sf-reset a img {
|
||||
border: none;
|
||||
}
|
||||
.sf-reset a:hover {
|
||||
text-decoration: underline;
|
||||
}
|
||||
.sf-reset em {
|
||||
font-style: italic;
|
||||
}
|
||||
.sf-reset h2,
|
||||
.sf-reset h3 {
|
||||
font-weight: bold;
|
||||
}
|
||||
.sf-reset h1 {
|
||||
font-family: Georgia, "Times New Roman", Times, serif;
|
||||
font-size: 20px;
|
||||
color: #313131;
|
||||
word-wrap: break-word;
|
||||
}
|
||||
.sf-reset li {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.sf-reset .block {
|
||||
-moz-border-radius: 16px;
|
||||
-webkit-border-radius: 16px;
|
||||
border-radius: 16px;
|
||||
margin-bottom: 20px;
|
||||
background-color: #FFFFFF;
|
||||
border: 1px solid #dfdfdf;
|
||||
padding: 40px 50px;
|
||||
word-break: break-all;
|
||||
}
|
||||
.sf-reset h2 {
|
||||
font-size: 16px;
|
||||
font-family: Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.sf-reset li a {
|
||||
background: none;
|
||||
color: #868686;
|
||||
text-decoration: none;
|
||||
}
|
||||
.sf-reset li a:hover {
|
||||
background: none;
|
||||
color: #313131;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.sf-reset ol {
|
||||
padding: 10px 0;
|
||||
}
|
||||
.sf-reset ol li {
|
||||
list-style: decimal;
|
||||
margin-left: 20px;
|
||||
padding: 2px;
|
||||
padding-bottom: 20px;
|
||||
}
|
||||
.sf-reset ol ol li {
|
||||
list-style-position: inside;
|
||||
margin-left: 0;
|
||||
white-space: nowrap;
|
||||
font-size: 12px;
|
||||
padding-bottom: 0;
|
||||
}
|
||||
.sf-reset li .selected {
|
||||
background-color: #ffd;
|
||||
}
|
||||
.sf-button {
|
||||
display: -moz-inline-box;
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
vertical-align: middle;
|
||||
border: 0;
|
||||
background: transparent none;
|
||||
text-transform: uppercase;
|
||||
cursor: pointer;
|
||||
font: bold 11px Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.sf-button span {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
height: 28px;
|
||||
float: left;
|
||||
}
|
||||
.sf-button .border-l {
|
||||
text-decoration: none;
|
||||
display: block;
|
||||
height: 28px;
|
||||
float: left;
|
||||
padding: 0 0 0 7px;
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAcCAYAAACtQ6WLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAQtJREFUeNpiPHnyJAMakARiByDWYEGT8ADiYGVlZStubm5xlv///4MEQYoKZGRkQkRERLRYWVl5wYJQyXBZWdkwCQkJUxAHKgaWlAHSLqKiosb//v1DsYMFKGCvoqJiDmQzwXTAJYECulxcXNLoumCSoszMzDzoumDGghQwYZUECWIzkrAkSIIGOmlkLI10AiX//P379x8jIyMTNmPf/v79+ysLCwsvuiQoNi5//fr1Kch4dAyS3P/gwYMTQBP+wxwHw0xA4gkQ73v9+vUZdJ2w1Lf82bNn4iCHCQoKasHsZw4ODgbRIL8c+/Lly5M3b978Y2dn5wC6npkFLXnsAOKLjx49AmUHLYAAAwBoQubG016R5wAAAABJRU5ErkJggg==) no-repeat top left;
|
||||
}
|
||||
.sf-button .border-r {
|
||||
padding: 0 7px 0 0;
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAcCAYAAACtQ6WLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAR1JREFUeNpiPHnyZCMDA8MNID5gZmb2nAEJMH7//v3N169fX969e/cYkL8WqGAHXPLv37//QYzfv39/fvPmzbUnT56sAXInmJub/2H5/x8sx8DCwsIrISFhDmQyPX78+CmQXs70798/BmQsKipqBNTgdvz4cWkmkE5kDATMioqKZkCFdiwg1eiAi4tLGqhQF24nMmBmZuYEigth1QkEbEBxTlySYPvJkwSJ00AnjYylgU6gxB8g/oFVEphkvgLF32KNMmCCewYUv4qhEyj47+HDhyeBzIMYOoEp8CxQw56wsLAncJ1//vz5/P79+2svX74EJc2V4BT58+fPd8CE/QKYHMGJOiIiAp6oWW7evDkNSF8DZYfIyEiU7AAQYACJ2vxVdJW4eQAAAABJRU5ErkJggg==) right top no-repeat;
|
||||
}
|
||||
.sf-button .btn-bg {
|
||||
padding: 0 14px;
|
||||
color: #636363;
|
||||
line-height: 28px;
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAcCAYAAACgXdXMAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAClJREFUeNpiPnny5EKGf//+/Wf6//8/A4QAcrGzKCZwGc9sa2urBBBgAIbDUoYVp9lmAAAAAElFTkSuQmCC) repeat-x top left;
|
||||
}
|
||||
.sf-button:hover .border-l,
|
||||
.sf-button-selected .border-l {
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAcCAYAAACtQ6WLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAR9JREFUeNpi/P//PwMyOHfunDqQSgNiexZkibNnzxYBqZa3HOs5v7PcYQBLnjlzhg1IbfzIdsTjA/t+ht9Mr8GKwZL//v3r+sB+0OMN+zqIEf8gFMvJkyd1gXTOa9YNDP//otrPAtSV/Jp9HfPff78Z0AEL0LUeXxivMfxD0wXTqfjj/2ugkf+wSrL9/YtpJEyS4S8WI5Ek/+GR/POPFjr//cenE6/kP9q4Fo/kr39/mdj+M/zFkGQCSj5i+ccPjLJ/GBgkuYOHQR1sNDpmAkb2LBmWwL///zKCIxwZM0VHR18G6p4uxeLLAA4tJMwEshiou1iMxXaHLGswA+t/YbhORuQUv2DBAnCifvxzI+enP3dQJUFg/vz5sOzgBBBgAPxX9j0YnH4JAAAAAElFTkSuQmCC) no-repeat top left;
|
||||
}
|
||||
.sf-button:hover .border-r,
|
||||
.sf-button-selected .border-r {
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAcAAAAcCAYAAACtQ6WLAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAT5JREFUeNpiPHv27BkGBoaDQDzLyMjoJgMSYHrM3WX8hn1d0f///88DFRYhSzIuv2X5H8Rg/SfKIPDTkYH/l80OINffxMTkF9O/f/8ZQPgnwyuGl+wrGd6x7vf49+9fO9jYf3+Bkkj4NesmBqAV+SdPntQC6vzHgIz//gOawbqOGchOxtAJwp8Zr4F0e7D8/fuPAR38/P8eZIo0yz8skv8YvoIk+YE6/zNgAyD7sRqLkPzzjxY6/+HS+R+fTkZ8djLh08lCUCcuSWawJGbwMTGwg7zyBatX2Bj5QZKPsBrLzaICktzN8g/NWEYGZgYZjoC/wMiei5FMpFh8QPSU6Ojoy3Cd7EwiDBJsDgxiLNY7gLrKQGIsHAxSDHxAO2TZ/b8D+TVxcXF9MCtYtLiKLgDpfUDVsxITE1GyA0CAAQA2E/N8VuHyAAAAAABJRU5ErkJggg==) right top no-repeat;
|
||||
}
|
||||
.sf-button:hover .btn-bg,
|
||||
.sf-button-selected .btn-bg {
|
||||
color: #FFFFFF;
|
||||
text-shadow:0 1px 1px #6b9311;
|
||||
background: transparent url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAAcCAIAAAAvP0KbAAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAEFJREFUeNpiPnv2LNMdvlymf///M/37B8R/QfQ/MP33L4j+B6Qh7L9//sHpf2h8MA1V+w/KRjYLaDaLCU8vQIABAFO3TxZriO4yAAAAAElFTkSuQmCC) repeat-x top left;
|
||||
}
|
||||
|
||||
/* styles copied from bundles/sensiodistribution/webconfigurator/css/install.css */
|
||||
body {
|
||||
font-size: 14px;
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
|
||||
}
|
||||
.sf-reset h1.title {
|
||||
font-size: 45px;
|
||||
padding-bottom: 30px;
|
||||
}
|
||||
.sf-reset h2 {
|
||||
font-weight: bold;
|
||||
color: #FFFFFF;
|
||||
/* Font is reset to sans-serif (like body) */
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
|
||||
margin-bottom: 10px;
|
||||
background-color: #aacd4e;
|
||||
padding: 2px 4px;
|
||||
display: inline-block;
|
||||
text-transform: uppercase;
|
||||
}
|
||||
.sf-reset ul a,
|
||||
.sf-reset ul a:hover {
|
||||
background: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAUAAAAICAYAAAAx8TU7AAAAGXRFWHRTb2Z0d2FyZQBBZG9iZSBJbWFnZVJlYWR5ccllPAAAAFdJREFUeNpiYACBjjOhDEiACSggCKTLgXQ5TJARqhIkcReIKxgqTGYxwvV0nDEGkmeAOIwJySiQ4HsgvseIpGo3ELsCtZ9lRDIvDCiwhwHJPEFkJwEEGACq6hdnax8y1AAAAABJRU5ErkJggg==) no-repeat right 7px;
|
||||
padding-right: 10px;
|
||||
}
|
||||
.sf-reset ul, ol {
|
||||
padding-left: 20px;
|
||||
}
|
||||
.sf-reset li {
|
||||
padding-bottom: 18px;
|
||||
}
|
||||
.sf-reset ol li {
|
||||
list-style-type: decimal;
|
||||
}
|
||||
.sf-reset ul li {
|
||||
list-style-type: none;
|
||||
}
|
||||
.sf-reset .symfony-blocks-install {
|
||||
overflow: hidden;
|
||||
}
|
||||
.sf-reset .symfony-install-continue {
|
||||
font-size: 0.95em;
|
||||
padding-left: 0;
|
||||
}
|
||||
.sf-reset .symfony-install-continue li {
|
||||
padding-bottom: 10px;
|
||||
}
|
||||
.sf-reset .ok {
|
||||
color: #fff;
|
||||
font-family: "Lucida Sans Unicode", "Lucida Grande", Verdana, Arial, Helvetica, sans-serif;
|
||||
background-color: #6d6;
|
||||
padding: 10px;
|
||||
margin-bottom: 20px;
|
||||
}
|
||||
.sf-reset .ko {
|
||||
background-color: #d66;
|
||||
}
|
||||
.sf-reset p.help {
|
||||
padding: 12px 16px;
|
||||
word-break: break-word;
|
||||
}
|
||||
.version {
|
||||
text-align: right;
|
||||
font-size: 10px;
|
||||
margin-right: 20px;
|
||||
}
|
||||
.sf-reset a,
|
||||
.sf-reset li a {
|
||||
color: #08C;
|
||||
text-decoration: none;
|
||||
}
|
||||
.sf-reset a:hover,
|
||||
.sf-reset li a:hover {
|
||||
color: #08C;
|
||||
text-decoration: underline;
|
||||
}
|
||||
.sf-reset textarea {
|
||||
padding: 7px;
|
||||
}
|
||||
</style>
|
||||
</head>
|
||||
<body>
|
||||
<div id="content">
|
||||
<div class="header clear-fix">
|
||||
<div class="header-logo">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAALYAAAA+CAMAAACxzRGDAAAAUVBMVEX////Ly8yko6WLioxkYmVXVVkwLjLl5eWxsLJKSEzy8vJxcHLY2Ni+vb89Oz9XVVh+fH+Yl5n///+xsbLY2Nlxb3KkpKWXlph+fX+LiYy+vr/IZP61AAAAAXRSTlMAQObYZgAABRBJREFUeNrVmtuWoyAQRS1FEEQSzQU7//+hYxUiXsKQZLJWM+chsUloN+WhCuguYoKyYqzmvGasKqH4HyRKxndipcgcumH8qViTM7TkUclcwaHmf5XM0eWq4km1KjdqXfMXJHVe1J3hL8lk5fCGv6wmT+o0d87U+XNrk0Y9nfv+7LM6ZJH5ZBL6LAbSxQ3Q5FDr22Skr8PQSy4n7isnsQxSX4r6pobhjCHHeDNOKrO3yGmCvZOjV9jmt8ulTdXFKdbKLNh+kOMvBzuVRa4Y7MUsdEUSWQe7xxCfZmcwjHU83LqzFvSbJQOXQvptbPnEFoyZtUUGwTeKuLuTHyT1kaP0P6cR01OKvv448gtl61dqZfmJezQmU/t+1R2fJLtBwXV6uWGwB9SZPrn0fKO2WAvQN1PUhHjTom3xgXYTkvlSKHs19OhslETq6X3HrXbjt8XbGj9b4Gi+lUAnL6XxQj8Pyk9N4Bt1xUrsLVN/3isYMug8rODMdbgOvoHs8uAb2fcANIAzkKCLYy+AXRpSU8sr1r4P67xhLgPp7vM32zlqt7Bhq2fI1Hwp+VgANxok59SsGV3oqdUL0YVDMRY7Yg8QLbVUU4NZNoOq5hJHuxEM28Sh/IyUZ8D3reR+yc58EGvOy2U0HQL6G9V+kWyEWHmzaMx6t4o9RhOm/riUiYrzqij4Ptqkn7AaCXqc+F47m04ahfde7YIz8RHEBN6BdVwdIGRVdNbKqYu1Hc0x0wBY4wqC8+XUgBGnj81SZsQB+0yAS1x/BlI/6ebHHk0lauQLuPDpu6EwAVJ7T0rl2uXa23jcqNyOZekhqYHRz3JOANrF4wCCmEs1f9D1lUe0n4NAATed80Y5e0Q7CO2TezM/BR6wKdgQzKbCF4uOQC3Bk0fKAzbFlyRWg3gksA/gmm7eOjrpaKX7fHlEW2xLbE6GZsPiCiShVzN7RG2xTz2G+OJtEqzdJ7APxy3MrSsV0VukXbKMp9lhs5BN6dr3CN+sySUaoxGwfRUM3I/gdPYONgVU+PLX4vUWm32AvUySarbONvcpV2RQEPKKjEBHFk01kQDGRblnn8ZuE9g+JUl8OWAPbkFK2K6JxhJVvF47FzYYnAN22ttwxKYCoH36rheEB7KG/HF/YUaa2G5JF+55tpyrl7B1WHM39HuP2N2EXPl1UBu8vbj4OjvD+NoTE4ssF+ScARgaJY1N7+u8bY/Y9BSM5PKwJbvMVab32YP5FB5TtcYVrGoASolVLTzI7kVsYVxRtAb5n2JXq1vCdtd47XtYItynrN0835PasLg0y13aOPbmPI+on2Lr9e5tjSHvgkAvclUjL3Fsdaw03IzgTR62yYClk7QMah4IQ0qSsoYYbOix6zJR1ZGDNMOY3Bb6W5S6jiyovep3t7bUPyoq7OkjYumrfESp8zSBc/OLosVf+nTnnKjsqR16++WDwpI8FxJWRFTlI6NKnqYJaL96TqjAbo9Toi5QiWBDcmfdFV+T8dkvFe5bItgstbM2X6QG2mVun+cazfRwOS0eiaeRRJKgLfc3BQAqfnhJyz8lfR6580SF/FXVu83Nz1xrrnFqqXL6Qxl47DNSm4RFflvN5sABDD8peouqLLKQXVdGbnqf+qIpOxON4ZyYdJEJ6sy4zS2c5eRPTT4Jyp46qDE5/ptAWqJOQ9e6yE82FXBbZCk1/tXVoshVoopE3CB0zmraI3nbqCJ/gW3ZMgtbC5nh/QHlOoOZBxQCRgAAAABJRU5ErkJggg==" alt="Symfony" />
|
||||
</div>
|
||||
|
||||
<div class="search">
|
||||
<form method="get" action="http://symfony.com/search">
|
||||
<div class="form-row">
|
||||
|
||||
<label for="search-id">
|
||||
<img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAABAAAAAQCAQAAAC1+jfqAAABUElEQVQoz2NgAIJ29iBdD0d7X2cPb+tY2f9MDMjgP2O2hKu7vS8CBlisZUNSMJ3fxRMkXO61wm2ue6I3iB1q8Z8ZriDZFCS03fm/wX+1/xp/TBo8QPxeqf+MUAW+QIFKj/+q/wX/c/3n/i/6Qd/bx943z/Q/K1SBI1D9fKv/AhCn/Wf5L5EHdFGKw39OqAIXoPpOMziX4T9/DFBBnuN/HqhAEtCKCNf/XDA/rZRyAmrpsvrPDVUw3wrkqCiLaewg6TohX1d7X0ffs5r/OaAKfinmgt3t4ulr4+Xg4ANip3j+l/zPArNT4LNOD0pAgWCSOUIBy3+h/+pXbBa5tni0eMx23+/mB1YSYnENroT5Pw/QSOX/mkCo+l/jgo0v2KJA643s8PgAmsMBDCbu/5xALHPB2husxN9uCzsDOgAq5kAoaZVnYMCh5Ky1r88Eh/+iABM8jUk7ClYIAAAAAElFTkSuQmCC" alt="Search on Symfony website" />
|
||||
</label>
|
||||
|
||||
<input name="q" id="search-id" type="search" placeholder="Search on Symfony website" />
|
||||
|
||||
<button type="submit" class="sf-button">
|
||||
<span class="border-l">
|
||||
<span class="border-r">
|
||||
<span class="btn-bg">OK</span>
|
||||
</span>
|
||||
</span>
|
||||
</button>
|
||||
</div>
|
||||
</form>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
<div class="sf-reset">
|
||||
<div class="block">
|
||||
<div class="symfony-block-content">
|
||||
<h1 class="title">Configuration Checker</h1>
|
||||
<p>
|
||||
This script analyzes your system to check whether is
|
||||
ready to run Symfony applications.
|
||||
</p>
|
||||
|
||||
<?php if ($hasMajorProblems): ?>
|
||||
<h2 class="ko">Major problems</h2>
|
||||
<p>Major problems have been detected and <strong>must</strong> be fixed before continuing:</p>
|
||||
<ol>
|
||||
<?php foreach ($majorProblems as $problem): ?>
|
||||
<li><?php echo $problem->getTestMessage() ?>
|
||||
<p class="help"><em><?php echo $problem->getHelpHtml() ?></em></p>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($hasMinorProblems): ?>
|
||||
<h2>Recommendations</h2>
|
||||
<p>
|
||||
<?php if ($hasMajorProblems): ?>Additionally, to<?php else: ?>To<?php endif; ?> enhance your Symfony experience,
|
||||
it’s recommended that you fix the following:
|
||||
</p>
|
||||
<ol>
|
||||
<?php foreach ($minorProblems as $problem): ?>
|
||||
<li><?php echo $problem->getTestMessage() ?>
|
||||
<p class="help"><em><?php echo $problem->getHelpHtml() ?></em></p>
|
||||
</li>
|
||||
<?php endforeach; ?>
|
||||
</ol>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if ($symfonyRequirements->hasPhpIniConfigIssue()): ?>
|
||||
<p id="phpini">*
|
||||
<?php if ($symfonyRequirements->getPhpIniConfigPath()): ?>
|
||||
Changes to the <strong>php.ini</strong> file must be done in "<strong><?php echo $symfonyRequirements->getPhpIniConfigPath() ?></strong>".
|
||||
<?php else: ?>
|
||||
To change settings, create a "<strong>php.ini</strong>".
|
||||
<?php endif; ?>
|
||||
</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<?php if (!$hasMajorProblems && !$hasMinorProblems): ?>
|
||||
<p class="ok">All checks passed successfully. Your system is ready to run Symfony applications.</p>
|
||||
<?php endif; ?>
|
||||
|
||||
<ul class="symfony-install-continue">
|
||||
<?php if ($hasMajorProblems || $hasMinorProblems): ?>
|
||||
<li><a href="config.php">Re-check configuration</a></li>
|
||||
<?php endif; ?>
|
||||
</ul>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div class="version">Symfony Standard Edition</div>
|
||||
</div>
|
||||
</body>
|
||||
</html>
|
7
web/css/app.css
Normal file
7
web/css/app.css
Normal file
@ -0,0 +1,7 @@
|
||||
.page-pad {
|
||||
margin: 1rem 2rem;
|
||||
}
|
||||
|
||||
table {
|
||||
overflow: scroll;
|
||||
}
|
5749
web/css/foundation.css
vendored
Normal file
5749
web/css/foundation.css
vendored
Normal file
File diff suppressed because it is too large
Load Diff
1
web/css/foundation.min.css
vendored
Normal file
1
web/css/foundation.min.css
vendored
Normal file
File diff suppressed because one or more lines are too long
BIN
web/favicon.ico
Normal file
BIN
web/favicon.ico
Normal file
Binary file not shown.
After Width: | Height: | Size: 6.4 KiB |
1
web/js/app.js
Normal file
1
web/js/app.js
Normal file
@ -0,0 +1 @@
|
||||
$(document).foundation()
|
11729
web/js/vendor/foundation.js
vendored
Normal file
11729
web/js/vendor/foundation.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
5
web/js/vendor/foundation.min.js
vendored
Normal file
5
web/js/vendor/foundation.min.js
vendored
Normal file
File diff suppressed because one or more lines are too long
10253
web/js/vendor/jquery.js
vendored
Normal file
10253
web/js/vendor/jquery.js
vendored
Normal file
File diff suppressed because it is too large
Load Diff
361
web/js/vendor/what-input.js
vendored
Normal file
361
web/js/vendor/what-input.js
vendored
Normal file
@ -0,0 +1,361 @@
|
||||
/**
|
||||
* what-input - A global utility for tracking the current input method (mouse, keyboard or touch).
|
||||
* @version v4.2.0
|
||||
* @link https://github.com/ten1seven/what-input
|
||||
* @license MIT
|
||||
*/
|
||||
(function webpackUniversalModuleDefinition(root, factory) {
|
||||
if(typeof exports === 'object' && typeof module === 'object')
|
||||
module.exports = factory();
|
||||
else if(typeof define === 'function' && define.amd)
|
||||
define("whatInput", [], factory);
|
||||
else if(typeof exports === 'object')
|
||||
exports["whatInput"] = factory();
|
||||
else
|
||||
root["whatInput"] = factory();
|
||||
})(this, function() {
|
||||
return /******/ (function(modules) { // webpackBootstrap
|
||||
/******/ // The module cache
|
||||
/******/ var installedModules = {};
|
||||
|
||||
/******/ // The require function
|
||||
/******/ function __webpack_require__(moduleId) {
|
||||
|
||||
/******/ // Check if module is in cache
|
||||
/******/ if(installedModules[moduleId])
|
||||
/******/ return installedModules[moduleId].exports;
|
||||
|
||||
/******/ // Create a new module (and put it into the cache)
|
||||
/******/ var module = installedModules[moduleId] = {
|
||||
/******/ exports: {},
|
||||
/******/ id: moduleId,
|
||||
/******/ loaded: false
|
||||
/******/ };
|
||||
|
||||
/******/ // Execute the module function
|
||||
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
||||
|
||||
/******/ // Flag the module as loaded
|
||||
/******/ module.loaded = true;
|
||||
|
||||
/******/ // Return the exports of the module
|
||||
/******/ return module.exports;
|
||||
/******/ }
|
||||
|
||||
|
||||
/******/ // expose the modules object (__webpack_modules__)
|
||||
/******/ __webpack_require__.m = modules;
|
||||
|
||||
/******/ // expose the module cache
|
||||
/******/ __webpack_require__.c = installedModules;
|
||||
|
||||
/******/ // __webpack_public_path__
|
||||
/******/ __webpack_require__.p = "";
|
||||
|
||||
/******/ // Load entry module and return exports
|
||||
/******/ return __webpack_require__(0);
|
||||
/******/ })
|
||||
/************************************************************************/
|
||||
/******/ ([
|
||||
/* 0 */
|
||||
/***/ (function(module, exports) {
|
||||
|
||||
'use strict';
|
||||
|
||||
module.exports = function () {
|
||||
/*
|
||||
* variables
|
||||
*/
|
||||
|
||||
// last used input type
|
||||
var currentInput = 'initial';
|
||||
|
||||
// last used input intent
|
||||
var currentIntent = null;
|
||||
|
||||
// cache document.documentElement
|
||||
var doc = document.documentElement;
|
||||
|
||||
// form input types
|
||||
var formInputs = ['input', 'select', 'textarea'];
|
||||
|
||||
var functionList = [];
|
||||
|
||||
// list of modifier keys commonly used with the mouse and
|
||||
// can be safely ignored to prevent false keyboard detection
|
||||
var ignoreMap = [16, // shift
|
||||
17, // control
|
||||
18, // alt
|
||||
91, // Windows key / left Apple cmd
|
||||
93 // Windows menu / right Apple cmd
|
||||
];
|
||||
|
||||
// list of keys for which we change intent even for form inputs
|
||||
var changeIntentMap = [9 // tab
|
||||
];
|
||||
|
||||
// mapping of events to input types
|
||||
var inputMap = {
|
||||
keydown: 'keyboard',
|
||||
mousedown: 'mouse',
|
||||
mousemove: 'mouse',
|
||||
MSPointerDown: 'pointer',
|
||||
MSPointerMove: 'pointer',
|
||||
pointerdown: 'pointer',
|
||||
pointermove: 'pointer',
|
||||
touchstart: 'touch'
|
||||
};
|
||||
|
||||
// array of all used input types
|
||||
var inputTypes = [];
|
||||
|
||||
// boolean: true if touch buffer is active
|
||||
var isBuffering = false;
|
||||
|
||||
// boolean: true if the page is being scrolled
|
||||
var isScrolling = false;
|
||||
|
||||
// store current mouse position
|
||||
var mousePos = {
|
||||
x: null,
|
||||
y: null
|
||||
};
|
||||
|
||||
// map of IE 10 pointer events
|
||||
var pointerMap = {
|
||||
2: 'touch',
|
||||
3: 'touch', // treat pen like touch
|
||||
4: 'mouse'
|
||||
};
|
||||
|
||||
var supportsPassive = false;
|
||||
|
||||
try {
|
||||
var opts = Object.defineProperty({}, 'passive', {
|
||||
get: function get() {
|
||||
supportsPassive = true;
|
||||
}
|
||||
});
|
||||
|
||||
window.addEventListener('test', null, opts);
|
||||
} catch (e) {}
|
||||
|
||||
/*
|
||||
* set up
|
||||
*/
|
||||
|
||||
var setUp = function setUp() {
|
||||
// add correct mouse wheel event mapping to `inputMap`
|
||||
inputMap[detectWheel()] = 'mouse';
|
||||
|
||||
addListeners();
|
||||
setInput();
|
||||
};
|
||||
|
||||
/*
|
||||
* events
|
||||
*/
|
||||
|
||||
var addListeners = function addListeners() {
|
||||
// `pointermove`, `MSPointerMove`, `mousemove` and mouse wheel event binding
|
||||
// can only demonstrate potential, but not actual, interaction
|
||||
// and are treated separately
|
||||
|
||||
// pointer events (mouse, pen, touch)
|
||||
if (window.PointerEvent) {
|
||||
doc.addEventListener('pointerdown', updateInput);
|
||||
doc.addEventListener('pointermove', setIntent);
|
||||
} else if (window.MSPointerEvent) {
|
||||
doc.addEventListener('MSPointerDown', updateInput);
|
||||
doc.addEventListener('MSPointerMove', setIntent);
|
||||
} else {
|
||||
// mouse events
|
||||
doc.addEventListener('mousedown', updateInput);
|
||||
doc.addEventListener('mousemove', setIntent);
|
||||
|
||||
// touch events
|
||||
if ('ontouchstart' in window) {
|
||||
doc.addEventListener('touchstart', touchBuffer);
|
||||
doc.addEventListener('touchend', touchBuffer);
|
||||
}
|
||||
}
|
||||
|
||||
// mouse wheel
|
||||
doc.addEventListener(detectWheel(), setIntent, supportsPassive ? { passive: true } : false);
|
||||
|
||||
// keyboard events
|
||||
doc.addEventListener('keydown', updateInput);
|
||||
};
|
||||
|
||||
// checks conditions before updating new input
|
||||
var updateInput = function updateInput(event) {
|
||||
// only execute if the touch buffer timer isn't running
|
||||
if (!isBuffering) {
|
||||
var eventKey = event.which;
|
||||
var value = inputMap[event.type];
|
||||
if (value === 'pointer') value = pointerType(event);
|
||||
|
||||
if (currentInput !== value || currentIntent !== value) {
|
||||
var activeElem = document.activeElement;
|
||||
var activeInput = false;
|
||||
var notFormInput = activeElem && activeElem.nodeName && formInputs.indexOf(activeElem.nodeName.toLowerCase()) === -1;
|
||||
|
||||
if (notFormInput || changeIntentMap.indexOf(eventKey) !== -1) {
|
||||
activeInput = true;
|
||||
}
|
||||
|
||||
if (value === 'touch' ||
|
||||
// ignore mouse modifier keys
|
||||
value === 'mouse' ||
|
||||
// don't switch if the current element is a form input
|
||||
value === 'keyboard' && eventKey && activeInput && ignoreMap.indexOf(eventKey) === -1) {
|
||||
// set the current and catch-all variable
|
||||
currentInput = currentIntent = value;
|
||||
|
||||
setInput();
|
||||
}
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// updates the doc and `inputTypes` array with new input
|
||||
var setInput = function setInput() {
|
||||
doc.setAttribute('data-whatinput', currentInput);
|
||||
doc.setAttribute('data-whatintent', currentInput);
|
||||
|
||||
if (inputTypes.indexOf(currentInput) === -1) {
|
||||
inputTypes.push(currentInput);
|
||||
doc.className += ' whatinput-types-' + currentInput;
|
||||
}
|
||||
|
||||
fireFunctions('input');
|
||||
};
|
||||
|
||||
// updates input intent for `mousemove` and `pointermove`
|
||||
var setIntent = function setIntent(event) {
|
||||
// test to see if `mousemove` happened relative to the screen
|
||||
// to detect scrolling versus mousemove
|
||||
if (mousePos['x'] !== event.screenX || mousePos['y'] !== event.screenY) {
|
||||
isScrolling = false;
|
||||
|
||||
mousePos['x'] = event.screenX;
|
||||
mousePos['y'] = event.screenY;
|
||||
} else {
|
||||
isScrolling = true;
|
||||
}
|
||||
|
||||
// only execute if the touch buffer timer isn't running
|
||||
// or scrolling isn't happening
|
||||
if (!isBuffering && !isScrolling) {
|
||||
var value = inputMap[event.type];
|
||||
if (value === 'pointer') value = pointerType(event);
|
||||
|
||||
if (currentIntent !== value) {
|
||||
currentIntent = value;
|
||||
|
||||
doc.setAttribute('data-whatintent', currentIntent);
|
||||
|
||||
fireFunctions('intent');
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
// buffers touch events because they frequently also fire mouse events
|
||||
var touchBuffer = function touchBuffer(event) {
|
||||
if (event.type === 'touchstart') {
|
||||
isBuffering = false;
|
||||
|
||||
// set the current input
|
||||
updateInput(event);
|
||||
} else {
|
||||
isBuffering = true;
|
||||
}
|
||||
};
|
||||
|
||||
var fireFunctions = function fireFunctions(type) {
|
||||
for (var i = 0, len = functionList.length; i < len; i++) {
|
||||
if (functionList[i].type === type) {
|
||||
functionList[i].function.call(undefined, currentIntent);
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
/*
|
||||
* utilities
|
||||
*/
|
||||
|
||||
var pointerType = function pointerType(event) {
|
||||
if (typeof event.pointerType === 'number') {
|
||||
return pointerMap[event.pointerType];
|
||||
} else {
|
||||
// treat pen like touch
|
||||
return event.pointerType === 'pen' ? 'touch' : event.pointerType;
|
||||
}
|
||||
};
|
||||
|
||||
// detect version of mouse wheel event to use
|
||||
// via https://developer.mozilla.org/en-US/docs/Web/Events/wheel
|
||||
var detectWheel = function detectWheel() {
|
||||
var wheelType = void 0;
|
||||
|
||||
// Modern browsers support "wheel"
|
||||
if ('onwheel' in document.createElement('div')) {
|
||||
wheelType = 'wheel';
|
||||
} else {
|
||||
// Webkit and IE support at least "mousewheel"
|
||||
// or assume that remaining browsers are older Firefox
|
||||
wheelType = document.onmousewheel !== undefined ? 'mousewheel' : 'DOMMouseScroll';
|
||||
}
|
||||
|
||||
return wheelType;
|
||||
};
|
||||
|
||||
/*
|
||||
* init
|
||||
*/
|
||||
|
||||
// don't start script unless browser cuts the mustard
|
||||
// (also passes if polyfills are used)
|
||||
if ('addEventListener' in window && Array.prototype.indexOf) {
|
||||
setUp();
|
||||
}
|
||||
|
||||
/*
|
||||
* api
|
||||
*/
|
||||
|
||||
return {
|
||||
// returns string: the current input type
|
||||
// opt: 'loose'|'strict'
|
||||
// 'strict' (default): returns the same value as the `data-whatinput` attribute
|
||||
// 'loose': includes `data-whatintent` value if it's more current than `data-whatinput`
|
||||
ask: function ask(opt) {
|
||||
return opt === 'loose' ? currentIntent : currentInput;
|
||||
},
|
||||
|
||||
// returns array: all the detected input types
|
||||
types: function types() {
|
||||
return inputTypes;
|
||||
},
|
||||
|
||||
// overwrites ignored keys with provided array
|
||||
ignoreKeys: function ignoreKeys(arr) {
|
||||
ignoreMap = arr;
|
||||
},
|
||||
|
||||
// attach functions to input and intent "events"
|
||||
// funct: function to fire on change
|
||||
// eventType: 'input'|'intent'
|
||||
onChange: function onChange(funct, eventType) {
|
||||
functionList.push({
|
||||
function: funct,
|
||||
type: eventType
|
||||
});
|
||||
}
|
||||
};
|
||||
}();
|
||||
|
||||
/***/ })
|
||||
/******/ ])
|
||||
});
|
||||
;
|
5
web/robots.txt
Normal file
5
web/robots.txt
Normal file
@ -0,0 +1,5 @@
|
||||
# www.robotstxt.org/
|
||||
# www.google.com/support/webmasters/bin/answer.py?hl=en&answer=156449
|
||||
|
||||
User-agent: *
|
||||
Disallow:
|
Loading…
Reference in New Issue
Block a user