diff --git a/bin/orcamentos b/bin/orcamentos
index b999f3e..66b33a0 100755
--- a/bin/orcamentos
+++ b/bin/orcamentos
@@ -1,17 +1,4 @@
#!/usr/bin/env php
setHelperSet(include 'cli-config.php');
-$application->add(new Orcamentos\Console\InitializeCommand);
-$application->add(new Orcamentos\Console\ResetPasswordCommand);
-
-ConsoleRunner::addCommands($application);
-
-$application->run();
+include "orcamentos.php";
diff --git a/bin/orcamentos.php b/bin/orcamentos.php
new file mode 100644
index 0000000..5e38ba1
--- /dev/null
+++ b/bin/orcamentos.php
@@ -0,0 +1,98 @@
+setProxyDir(sys_get_temp_dir() . '/' . md5(__DIR__));
+$config->setProxyNamespace('Proxies');
+$config->setAutoGenerateProxyClasses(true);
+$config->setMetadataDriverImpl($driver);
+$config->setMetadataCacheImpl($cache);
+
+// EntityManager
+$em = EntityManager::create($configValues['db.options'], $config);
+
+// Console
+$console = new ConsoleApplication('Gerenciamento de Orçamentos', '1.0.0');
+$console->setCatchExceptions(true);
+$console->setHelperSet(new HelperSet([
+ new ConnectionHelper($em->getConnection()),
+ new EntityManagerHelper($em),
+ $console->getHelperSet()->get('dialog'),
+ $console->getHelperSet()->get('progress'),
+ $console->getHelperSet()->get('table'),
+ new FormatterHelper(),
+ new DebugFormatterHelper(),
+ new ProcessHelper(),
+ new QuestionHelper()
+]));
+
+$console->addCommands(array(
+ // DBAL Commands
+ new \Doctrine\DBAL\Tools\Console\Command\RunSqlCommand(),
+ new \Doctrine\DBAL\Tools\Console\Command\ImportCommand(),
+
+ // ORM Commands
+ new \Doctrine\ORM\Tools\Console\Command\ClearCache\MetadataCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ClearCache\ResultCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ClearCache\QueryCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\SchemaTool\CreateCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\SchemaTool\UpdateCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\SchemaTool\DropCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\EnsureProductionSettingsCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ConvertDoctrine1SchemaCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\GenerateRepositoriesCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\GenerateEntitiesCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\GenerateProxiesCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ConvertMappingCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\RunDqlCommand(),
+ new \Doctrine\ORM\Tools\Console\Command\ValidateSchemaCommand(),
+
+ // Migrations Commands
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\DiffCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\ExecuteCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\GenerateCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\LatestCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\MigrateCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\StatusCommand(),
+ new \Doctrine\DBAL\Migrations\Tools\Console\Command\VersionCommand(),
+
+ // Orcamentos Commands
+ new Orcamentos\Console\InitializeCommand(),
+ new Orcamentos\Console\ResetPasswordCommand()
+));
+$console->run();
diff --git a/bootstrap.php b/bootstrap.php
deleted file mode 100644
index 61b6e8d..0000000
--- a/bootstrap.php
+++ /dev/null
@@ -1,29 +0,0 @@
-setQueryCacheImpl($cache);
-$config->setProxyDir('/tmp');
-$config->setProxyNamespace('EntityProxy');
-$config->setAutoGenerateProxyClasses(true);
-
-//mapping (example uses annotations, could be any of XML/YAML or plain PHP)
-AnnotationRegistry::registerFile(__DIR__ . DS . 'vendor' . DS . 'doctrine' . DS . 'orm' . DS . 'lib' . DS . 'Doctrine' . DS . 'ORM' . DS . 'Mapping' . DS . 'Driver' . DS . 'DoctrineAnnotations.php');
-
-$driver = new Doctrine\ORM\Mapping\Driver\AnnotationDriver(
- new Doctrine\Common\Annotations\AnnotationReader(),
- array(__DIR__ . DS . 'src' . DS . 'Orcamentos' . DS . 'Model')
-);
-$config->setMetadataDriverImpl($driver);
-$config->setMetadataCacheImpl($cache);
diff --git a/cli-config.php b/cli-config.php
deleted file mode 100644
index 9ee19e4..0000000
--- a/cli-config.php
+++ /dev/null
@@ -1,56 +0,0 @@
-add('Orcamentos', __DIR__.'/src');
-
-$configValues = require __DIR__ . '/config/config.php';
-
-use Doctrine\ORM\Tools\Setup;
-use Doctrine\ORM\EntityManager;
-use Doctrine\Common\Annotations\AnnotationRegistry;
-use Symfony\Component\Console\Helper\DebugFormatterHelper;
-use Symfony\Component\Console\Helper\ProcessHelper;
-use Symfony\Component\Console\Helper\QuestionHelper;
-use Symfony\Component\Console\Helper\HelperSet;
-use Symfony\Component\Console\Helper\FormatterHelper;
-use Symfony\Component\Console\Helper\DialogHelper;
-use Symfony\Component\Console\Helper\ProgressHelper;
-use Symfony\Component\Console\Helper\TableHelper;
-
-
-AnnotationRegistry::registerFile(__DIR__.'/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php');
-
-// configuration (2)
-$config = new \Doctrine\ORM\Configuration();
-
-// Proxies (3)
-$config->setProxyDir(sys_get_temp_dir() . '/' . md5(__DIR__));
-$config->setProxyNamespace('Proxies');
-$config->setAutoGenerateProxyClasses(true);
-
-// Driver (4)
-$driverImpl = new Doctrine\ORM\Mapping\Driver\AnnotationDriver(
- new Doctrine\Common\Annotations\AnnotationReader(),
- array(__DIR__.'/src/Orcamentos/Model')
-);
-$config->setMetadataDriverImpl($driverImpl);
-
-$cache = new \Doctrine\Common\Cache\ApcCache();
-
-$config->setMetadataCacheImpl($cache);
-
-$connectionOptions = $configValues['db.options'];
-
-$em = \Doctrine\ORM\EntityManager::create($connectionOptions, $config);
-
-return $helperSet = new \Symfony\Component\Console\Helper\HelperSet(array(
- 'db' => new \Doctrine\DBAL\Tools\Console\Helper\ConnectionHelper($em->getConnection()),
- 'em' => new \Doctrine\ORM\Tools\Console\Helper\EntityManagerHelper($em),
- new FormatterHelper(),
- new DialogHelper(),
- new ProgressHelper(),
- new TableHelper(),
- new DebugFormatterHelper(),
- new ProcessHelper(),
- new QuestionHelper()
-));
diff --git a/composer.json b/composer.json
index caab39a..e225e56 100644
--- a/composer.json
+++ b/composer.json
@@ -24,8 +24,9 @@
},
"autoload": {
"psr-4": {
- "Orcamentos\\": "src/Orcamentos"
- }
- },
- "minimum-stability": "dev"
+ "Orcamentos\\": "src/Orcamentos",
+ "Orcamentos\\Migrations\\": "migrations"
+ }
+ },
+ "minimum-stability": "dev"
}
diff --git a/migrations.yml b/migrations.yml
new file mode 100644
index 0000000..5412e00
--- /dev/null
+++ b/migrations.yml
@@ -0,0 +1,4 @@
+name: Gerenciamento de Orçamentos - Migrations
+migrations_namespace: Orcamentos\Migrations
+table_name: doctrine_migration_versions
+migrations_directory: migrations
diff --git a/migrations/Version20140807204731.php b/migrations/Version20140807204731.php
new file mode 100644
index 0000000..b4b2ded
--- /dev/null
+++ b/migrations/Version20140807204731.php
@@ -0,0 +1,77 @@
+abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
+
+ $this->addSql("CREATE TABLE client (id INT AUTO_INCREMENT NOT NULL, company_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, cnpj VARCHAR(14) NOT NULL, corporateName VARCHAR(255) DEFAULT NULL, email VARCHAR(255) DEFAULT NULL, logotype VARCHAR(255) DEFAULT NULL, telephone VARCHAR(255) DEFAULT NULL, responsable VARCHAR(255) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_C7440455979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE company (id INT AUTO_INCREMENT NOT NULL, plan_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, city VARCHAR(255) DEFAULT NULL, taxes DOUBLE PRECISION NOT NULL, email VARCHAR(255) NOT NULL, telephone VARCHAR(255) NOT NULL, site VARCHAR(255) DEFAULT NULL, logotype VARCHAR(255) DEFAULT NULL, responsable VARCHAR(255) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_4FBF094FE899029B (plan_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE type (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, type VARCHAR(255) NOT NULL, contractType VARCHAR(255) DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE plan (id INT AUTO_INCREMENT NOT NULL, name VARCHAR(255) NOT NULL, price DOUBLE PRECISION DEFAULT NULL, quoteLimit INT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE privatenote (id INT AUTO_INCREMENT NOT NULL, project_id INT DEFAULT NULL, user_id INT DEFAULT NULL, note LONGTEXT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_FFBFCCE1166D1F9C (project_id), INDEX IDX_FFBFCCE1A76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE project (id INT AUTO_INCREMENT NOT NULL, client_id INT DEFAULT NULL, company_id INT DEFAULT NULL, name VARCHAR(255) NOT NULL, description LONGTEXT DEFAULT NULL, tags VARCHAR(255) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_2FB3D0EE19EB6921 (client_id), INDEX IDX_2FB3D0EE979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE quote (id INT AUTO_INCREMENT NOT NULL, project_id INT DEFAULT NULL, dueDate DATETIME DEFAULT NULL, taxes DOUBLE PRECISION NOT NULL, version VARCHAR(150) NOT NULL, status INT NOT NULL, profit DOUBLE PRECISION NOT NULL, commission DOUBLE PRECISION NOT NULL, privateNotes LONGTEXT DEFAULT NULL, deadline LONGTEXT DEFAULT NULL, priceDescription LONGTEXT DEFAULT NULL, paymentType LONGTEXT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_6B71CBF4166D1F9C (project_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE resource (id INT AUTO_INCREMENT NOT NULL, company_id INT DEFAULT NULL, type_id INT DEFAULT NULL, name VARCHAR(150) NOT NULL, cost DOUBLE PRECISION NOT NULL, equipmentLife INT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_BC91F416979B1AD6 (company_id), INDEX IDX_BC91F416C54C8C93 (type_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE resourcequote (id INT AUTO_INCREMENT NOT NULL, resource_id INT DEFAULT NULL, quote_id INT DEFAULT NULL, amount DOUBLE PRECISION NOT NULL, value DOUBLE PRECISION NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_39741B5589329D25 (resource_id), INDEX IDX_39741B55DB805178 (quote_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE share (id INT AUTO_INCREMENT NOT NULL, quote_id INT DEFAULT NULL, email VARCHAR(150) NOT NULL, hash VARCHAR(255) NOT NULL, shortUrl VARCHAR(255) NOT NULL, sent TINYINT(1) NOT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_EF069D5ADB805178 (quote_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE sharenote (id INT AUTO_INCREMENT NOT NULL, share_id INT DEFAULT NULL, note LONGTEXT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_F829661E2AE63FDB (share_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE user (id INT AUTO_INCREMENT NOT NULL, company_id INT DEFAULT NULL, name VARCHAR(150) NOT NULL, email VARCHAR(150) NOT NULL, password VARCHAR(100) NOT NULL, admin TINYINT(1) DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, UNIQUE INDEX UNIQ_8D93D649E7927C74 (email), INDEX IDX_8D93D649979B1AD6 (company_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE view (id INT AUTO_INCREMENT NOT NULL, share_id INT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME DEFAULT NULL, INDEX IDX_FEFDAB8E2AE63FDB (share_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("ALTER TABLE client ADD CONSTRAINT FK_C7440455979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)");
+ $this->addSql("ALTER TABLE company ADD CONSTRAINT FK_4FBF094FE899029B FOREIGN KEY (plan_id) REFERENCES plan (id)");
+ $this->addSql("ALTER TABLE privatenote ADD CONSTRAINT FK_FFBFCCE1166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)");
+ $this->addSql("ALTER TABLE privatenote ADD CONSTRAINT FK_FFBFCCE1A76ED395 FOREIGN KEY (user_id) REFERENCES user (id)");
+ $this->addSql("ALTER TABLE project ADD CONSTRAINT FK_2FB3D0EE19EB6921 FOREIGN KEY (client_id) REFERENCES client (id)");
+ $this->addSql("ALTER TABLE project ADD CONSTRAINT FK_2FB3D0EE979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)");
+ $this->addSql("ALTER TABLE quote ADD CONSTRAINT FK_6B71CBF4166D1F9C FOREIGN KEY (project_id) REFERENCES project (id)");
+ $this->addSql("ALTER TABLE resource ADD CONSTRAINT FK_BC91F416979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)");
+ $this->addSql("ALTER TABLE resource ADD CONSTRAINT FK_BC91F416C54C8C93 FOREIGN KEY (type_id) REFERENCES type (id)");
+ $this->addSql("ALTER TABLE resourcequote ADD CONSTRAINT FK_39741B5589329D25 FOREIGN KEY (resource_id) REFERENCES resource (id)");
+ $this->addSql("ALTER TABLE resourcequote ADD CONSTRAINT FK_39741B55DB805178 FOREIGN KEY (quote_id) REFERENCES quote (id)");
+ $this->addSql("ALTER TABLE share ADD CONSTRAINT FK_EF069D5ADB805178 FOREIGN KEY (quote_id) REFERENCES quote (id)");
+ $this->addSql("ALTER TABLE sharenote ADD CONSTRAINT FK_F829661E2AE63FDB FOREIGN KEY (share_id) REFERENCES share (id)");
+ $this->addSql("ALTER TABLE user ADD CONSTRAINT FK_8D93D649979B1AD6 FOREIGN KEY (company_id) REFERENCES company (id)");
+ $this->addSql("ALTER TABLE view ADD CONSTRAINT FK_FEFDAB8E2AE63FDB FOREIGN KEY (share_id) REFERENCES share (id)");
+ }
+
+ public function down(Schema $schema)
+ {
+ $this->abortIf($this->connection->getDatabasePlatform()->getName() != "mysql", "Migration can only be executed safely on 'mysql'.");
+
+ $this->addSql("ALTER TABLE project DROP FOREIGN KEY FK_2FB3D0EE19EB6921");
+ $this->addSql("ALTER TABLE client DROP FOREIGN KEY FK_C7440455979B1AD6");
+ $this->addSql("ALTER TABLE project DROP FOREIGN KEY FK_2FB3D0EE979B1AD6");
+ $this->addSql("ALTER TABLE resource DROP FOREIGN KEY FK_BC91F416979B1AD6");
+ $this->addSql("ALTER TABLE user DROP FOREIGN KEY FK_8D93D649979B1AD6");
+ $this->addSql("ALTER TABLE resource DROP FOREIGN KEY FK_BC91F416C54C8C93");
+ $this->addSql("ALTER TABLE company DROP FOREIGN KEY FK_4FBF094FE899029B");
+ $this->addSql("ALTER TABLE privatenote DROP FOREIGN KEY FK_FFBFCCE1166D1F9C");
+ $this->addSql("ALTER TABLE quote DROP FOREIGN KEY FK_6B71CBF4166D1F9C");
+ $this->addSql("ALTER TABLE resourcequote DROP FOREIGN KEY FK_39741B55DB805178");
+ $this->addSql("ALTER TABLE share DROP FOREIGN KEY FK_EF069D5ADB805178");
+ $this->addSql("ALTER TABLE resourcequote DROP FOREIGN KEY FK_39741B5589329D25");
+ $this->addSql("ALTER TABLE sharenote DROP FOREIGN KEY FK_F829661E2AE63FDB");
+ $this->addSql("ALTER TABLE view DROP FOREIGN KEY FK_FEFDAB8E2AE63FDB");
+ $this->addSql("ALTER TABLE privatenote DROP FOREIGN KEY FK_FFBFCCE1A76ED395");
+ $this->addSql("DROP TABLE client");
+ $this->addSql("DROP TABLE company");
+ $this->addSql("DROP TABLE type");
+ $this->addSql("DROP TABLE plan");
+ $this->addSql("DROP TABLE privatenote");
+ $this->addSql("DROP TABLE project");
+ $this->addSql("DROP TABLE quote");
+ $this->addSql("DROP TABLE resource");
+ $this->addSql("DROP TABLE resourcequote");
+ $this->addSql("DROP TABLE share");
+ $this->addSql("DROP TABLE sharenote");
+ $this->addSql("DROP TABLE user");
+ $this->addSql("DROP TABLE view");
+ }
+}
diff --git a/phpunit.xml b/phpunit.xml
index 08db8c0..9d85f71 100644
--- a/phpunit.xml
+++ b/phpunit.xml
@@ -7,19 +7,21 @@
convertWarningsToExceptions="true"
processIsolation="false"
stopOnFailure="false"
- syntaxCheck="false"
- bootstrap="phpunit_bootstrap.php"
->
-
+ syntaxCheck="false">
+
+
+
+
+
-
- src/
+
+ ./tests/
-
-
+
+
./src/
@@ -29,7 +31,8 @@
-
+
-
\ No newline at end of file
+
diff --git a/phpunit_bootstrap.php b/phpunit_bootstrap.php
deleted file mode 100644
index d60316a..0000000
--- a/phpunit_bootstrap.php
+++ /dev/null
@@ -1,6 +0,0 @@
-price = $price;
}
+
+ public function setDescription($description)
+ {
+ $this->description = $description;
+ }
+
+ public function getDescription()
+ {
+ return $this->description;
+ }
+
}
diff --git a/src/Orcamentos/Model/PrivateNote.php b/src/Orcamentos/Model/PrivateNote.php
index dee62ea..e5947da 100644
--- a/src/Orcamentos/Model/PrivateNote.php
+++ b/src/Orcamentos/Model/PrivateNote.php
@@ -2,11 +2,10 @@
namespace Orcamentos\Model;
use Doctrine\ORM\Mapping as ORM;
-use DateTime;
/**
* @ORM\Entity
- * @ORM\Table(name="PrivateNote")
+ * @ORM\Table(name="privatenote")
*/
class PrivateNote extends Entity
{
@@ -28,7 +27,7 @@ class PrivateNote extends Entity
/**
* @ORM\Column(type="text", nullable=true)
*
- * @var text
+ * @var string
*/
private $note;
diff --git a/src/Orcamentos/Model/Project.php b/src/Orcamentos/Model/Project.php
index cca4181..c4cc143 100644
--- a/src/Orcamentos/Model/Project.php
+++ b/src/Orcamentos/Model/Project.php
@@ -5,7 +5,7 @@
/**
* @ORM\Entity
- * @ORM\Table(name="Project")
+ * @ORM\Table(name="project")
*/
class Project extends Entity
{
@@ -20,7 +20,7 @@ class Project extends Entity
/**
* @ORM\Column(type="text", nullable=true)
*
- * @var text
+ * @var string
*/
private $description;
@@ -48,14 +48,14 @@ class Project extends Entity
/**
* @ORM\OneToMany(targetEntity="Quote", mappedBy="project", cascade={"all"}, orphanRemoval=true, fetch="LAZY")
*
- * @var Doctrine\Common\Collections\Collection
+ * @var \Doctrine\Common\Collections\Collection
*/
protected $quoteCollection;
/**
* @ORM\OneToMany(targetEntity="PrivateNote", mappedBy="project", cascade={"all"}, orphanRemoval=true, fetch="LAZY")
* @ORM\OrderBy({"created" = "DESC"})
- * @var Doctrine\Common\Collections\Collection
+ * @var \Doctrine\Common\Collections\Collection
*/
protected $privateNotesCollection;
@@ -93,16 +93,6 @@ public function setDescription($description)
{
return $this->description = $description;
}
-
- public function getClientNotes()
- {
- return $this->clientNotes;
- }
-
- public function setClientNotes($clientNotes)
- {
- return $this->clientNotes = $clientNotes;
- }
public function getTags()
{
diff --git a/src/Orcamentos/Model/Quote.php b/src/Orcamentos/Model/Quote.php
index 8f6294d..02c3d6a 100644
--- a/src/Orcamentos/Model/Quote.php
+++ b/src/Orcamentos/Model/Quote.php
@@ -6,13 +6,13 @@
/**
* @ORM\Entity
- * @ORM\Table(name="Quote")
+ * @ORM\Table(name="quote")
*/
class Quote extends Entity
{
/**
* @ORM\Column(type="datetime",nullable=true)
- * @var datetime
+ * @var \DateTime
*/
protected $dueDate;
@@ -54,28 +54,28 @@ class Quote extends Entity
/**
* @ORM\Column(type="text",nullable=true)
*
- * @var text
+ * @var string
*/
private $privateNotes;
/**
* @ORM\Column(type="text",nullable=true)
*
- * @var text
+ * @var string
*/
private $deadline;
/**
* @ORM\Column(type="text",nullable=true)
*
- * @var text
+ * @var string
*/
private $priceDescription;
/**
* @ORM\Column(type="text",nullable=true)
*
- * @var text
+ * @var string
*/
private $paymentType;
@@ -89,14 +89,14 @@ class Quote extends Entity
/**
* @ORM\OneToMany(targetEntity="ResourceQuote", mappedBy="quote", cascade={"all"}, orphanRemoval=true, fetch="LAZY")
*
- * @var Doctrine\Common\Collections\Collection
+ * @var \Doctrine\Common\Collections\Collection
*/
protected $resourceQuoteCollection;
/**
* @ORM\OneToMany(targetEntity="Share", mappedBy="quote", cascade={"all"}, orphanRemoval=true, fetch="LAZY")
*
- * @var Doctrine\Common\Collections\Collection
+ * @var \Doctrine\Common\Collections\Collection
*/
protected $shareCollection;
diff --git a/src/Orcamentos/Model/Resource.php b/src/Orcamentos/Model/Resource.php
index 213ba62..56156a2 100644
--- a/src/Orcamentos/Model/Resource.php
+++ b/src/Orcamentos/Model/Resource.php
@@ -5,7 +5,7 @@
/**
* @ORM\Entity
- * @ORM\Table(name="Resource")
+ * @ORM\Table(name="resource")
*/
class Resource extends Entity
{
@@ -47,7 +47,7 @@ class Resource extends Entity
/**
* @ORM\OneToMany(targetEntity="ResourceQuote", mappedBy="resource", cascade={"all"}, orphanRemoval=true, fetch="LAZY")
*
- * @var Doctrine\Common\Collections\Collection
+ * @var \Doctrine\Common\Collections\Collection
*/
protected $resourceQuoteCollection;
@@ -95,46 +95,6 @@ public function setCompany($company)
{
return $this->company = $company;
}
-
- public function getPrivateNotes()
- {
- return $this->privateNotes;
- }
-
- public function setPrivateNotes($privateNotes)
- {
- return $this->privateNotes = $privateNotes;
- }
-
- public function getDescription()
- {
- return $this->description;
- }
-
- public function setDescription($description)
- {
- return $this->description = $description;
- }
-
- public function getClientNotes()
- {
- return $this->clientNotes;
- }
-
- public function setClientNotes($clientNotes)
- {
- return $this->clientNotes = $clientNotes;
- }
-
- public function getTags()
- {
- return $this->tags;
- }
-
- public function setTags($tags)
- {
- return $this->tags = $tags;
- }
public function getType()
{
diff --git a/src/Orcamentos/Model/ResourceQuote.php b/src/Orcamentos/Model/ResourceQuote.php
index 6c84169..7419f48 100644
--- a/src/Orcamentos/Model/ResourceQuote.php
+++ b/src/Orcamentos/Model/ResourceQuote.php
@@ -5,7 +5,7 @@
/**
* @ORM\Entity
- * @ORM\Table(name="ResourceQuote")
+ * @ORM\Table(name="resourcequote")
*/
class ResourceQuote extends Entity
{
diff --git a/src/Orcamentos/Model/Share.php b/src/Orcamentos/Model/Share.php
index 377bfef..178e7f4 100644
--- a/src/Orcamentos/Model/Share.php
+++ b/src/Orcamentos/Model/Share.php
@@ -5,7 +5,7 @@
/**
* @ORM\Entity
- * @ORM\Table(name="Share")
+ * @ORM\Table(name="share")
*/
class Share extends Entity
{
@@ -47,14 +47,14 @@ class Share extends Entity
/**
* @ORM\OneToMany(targetEntity="View", mappedBy="share", cascade={"all"}, orphanRemoval=true, fetch="LAZY")
*
- * @var Doctrine\Common\Collections\Collection
+ * @var \Doctrine\Common\Collections\Collection
*/
protected $viewCollection;
/**
* @ORM\OneToMany(targetEntity="ShareNote", mappedBy="share", cascade={"all"}, orphanRemoval=true, fetch="LAZY")
* @ORM\OrderBy({"created" = "DESC"})
- * @var Doctrine\Common\Collections\Collection
+ * @var \Doctrine\Common\Collections\Collection
*/
protected $shareNotesCollection;
diff --git a/src/Orcamentos/Model/ShareNote.php b/src/Orcamentos/Model/ShareNote.php
index ff3ac63..9769d25 100644
--- a/src/Orcamentos/Model/ShareNote.php
+++ b/src/Orcamentos/Model/ShareNote.php
@@ -2,11 +2,10 @@
namespace Orcamentos\Model;
use Doctrine\ORM\Mapping as ORM;
-use DateTime;
/**
* @ORM\Entity
- * @ORM\Table(name="ShareNote")
+ * @ORM\Table(name="sharenote")
*/
class ShareNote extends Entity
{
@@ -20,7 +19,7 @@ class ShareNote extends Entity
/**
* @ORM\Column(type="text", nullable=true)
*
- * @var text
+ * @var string
*/
private $note;
@@ -49,13 +48,4 @@ public function setNote($note)
return $this->note = $note;
}
- public function getShareNotesCollection()
- {
- return $this->shareNotesCollection;
- }
-
- public function setShareNotesCollection($shareNotesCollection)
- {
- return $this->shareNotesCollection = $shareNotesCollection;
- }
}
diff --git a/src/Orcamentos/Model/Type.php b/src/Orcamentos/Model/Type.php
index a9417d3..f36f6d8 100644
--- a/src/Orcamentos/Model/Type.php
+++ b/src/Orcamentos/Model/Type.php
@@ -1,18 +1,20 @@
-name;
}
-
+
public function setName($name)
{
return $this->name = filter_var($name, FILTER_SANITIZE_STRING);
diff --git a/src/Orcamentos/Model/User.php b/src/Orcamentos/Model/User.php
index e7952f3..f4ba465 100644
--- a/src/Orcamentos/Model/User.php
+++ b/src/Orcamentos/Model/User.php
@@ -5,7 +5,7 @@
/**
* @ORM\Entity
- * @ORM\Table(name="User")
+ * @ORM\Table(name="user")
*/
class User extends Entity
{
diff --git a/src/Orcamentos/Model/View.php b/src/Orcamentos/Model/View.php
index 1892eb3..1463be6 100644
--- a/src/Orcamentos/Model/View.php
+++ b/src/Orcamentos/Model/View.php
@@ -5,7 +5,7 @@
/**
* @ORM\Entity
- * @ORM\Table(name="View")
+ * @ORM\Table(name="view")
*/
class View extends Entity
{