Commit b4cf1ea1 authored by Mat's avatar Mat
Browse files

Offre, ajoute un champ 'sorted', initialise un tableau sérialisé

parent a5dc53bc
......@@ -56,6 +56,13 @@ class Offre
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private $updatedAt;
/**
* @var \DateTime
*
* @ORM\Column(name="ended_at", type="datetime")
*/
private $endedAt;
/**
* @var string
......@@ -63,13 +70,12 @@ class Offre
* @ORM\Column(name="status", type="string", columnDefinition="enum('draft', 'current', 'closed', 'trash')")
*/
private $status;
/**
* @var \DateTime
*
* @ORM\Column(name="ended_at", type="datetime")
* @var array
* @ORM\Column(name="sorted", type="array")
*/
private $endedAt;
private $sorted;
/**
......@@ -101,6 +107,7 @@ class Offre
$this->lettres = new ArrayCollection();
$this->status = 'draft';
$this->reference = $reference;
$this->sorted = array();
}
......@@ -315,4 +322,30 @@ class Offre
{
return $this->lettres;
}
/**
* Set sorted
*
* @param array $sorted
*
* @return Offre
*/
public function setSorted(array $sorted)
{
$this->sorted = $sorted;
return $this;
}
/**
* Get sorted
*
* @return array
*/
public function getSorted()
{
return $this->sorted;
}
}
......@@ -3,7 +3,7 @@
-- https://www.phpmyadmin.net/
--
-- Hôte : 172.17.0.1
-- Généré le : lun. 11 juin 2018 à 12:57
-- Généré le : mer. 13 juin 2018 à 09:34
-- Version du serveur : 10.0.34-MariaDB-1~jessie
-- Version de PHP : 7.2.2
......@@ -50,7 +50,38 @@ CREATE TABLE `fos_user` (
--
INSERT INTO `fos_user` (`id`, `username`, `username_canonical`, `email`, `email_canonical`, `enabled`, `salt`, `password`, `last_login`, `confirmation_token`, `password_requested_at`, `roles`) VALUES
(1, 'mathieu', 'mathieu', 'jaum_mathieu@collectifs.net', 'jaum_mathieu@collectifs.net', 1, NULL, '$2y$13$YM5GI53uRu0k32kIL8aZyeOSqkiZIEdXA5t2vdmchfPBMWcso3eJa', '2018-06-11 13:51:14', NULL, NULL, 'a:1:{i:0;s:10:\"ROLE_ADMIN\";}');
(1, 'mathieu', 'mathieu', 'jaum_mathieu@collectifs.net', 'jaum_mathieu@collectifs.net', 1, NULL, '$2y$13$YM5GI53uRu0k32kIL8aZyeOSqkiZIEdXA5t2vdmchfPBMWcso3eJa', '2018-06-13 11:13:36', NULL, NULL, 'a:1:{i:0;s:10:\"ROLE_ADMIN\";}'),
(2, 'mat', 'mat', 'mat@collectifs.net', 'mat@collectifs.net', 1, NULL, '$2y$13$IhUYgHA5XrRixToyyDVwMuJeKIFh7eVlSEM0k2p/BJyQMmPytdjXe', '2018-06-13 10:46:16', NULL, NULL, 'a:0:{}');
-- --------------------------------------------------------
--
-- Structure de la table `info`
--
CREATE TABLE `info` (
`id` int(11) NOT NULL,
`title` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`subtitle` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`text` longtext COLLATE utf8_unicode_ci NOT NULL,
`is_post` tinyint(1) NOT NULL,
`status` enum('draft','posted','trash') COLLATE utf8_unicode_ci DEFAULT NULL,
`color` varchar(10) COLLATE utf8_unicode_ci NOT NULL,
`posted_at` datetime DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Structure de la table `infos_lettres`
--
CREATE TABLE `infos_lettres` (
`id_info` int(11) NOT NULL,
`id_lettre` int(11) NOT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
......@@ -116,6 +147,25 @@ INSERT INTO `legume` (`id`, `nom`, `description`, `origine`, `unite`, `quantite_
-- --------------------------------------------------------
--
-- Structure de la table `lettre`
--
CREATE TABLE `lettre` (
`id` int(11) NOT NULL,
`id_offre` int(11) NOT NULL,
`id_groupe` int(11) NOT NULL,
`reference` varchar(16) COLLATE utf8_unicode_ci NOT NULL,
`subject` varchar(150) COLLATE utf8_unicode_ci NOT NULL,
`started_at` datetime NOT NULL,
`ended_at` datetime NOT NULL,
`status` enum('draft','current','sent','closed','trash') COLLATE utf8_unicode_ci DEFAULT NULL,
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
-- --------------------------------------------------------
--
-- Structure de la table `offre`
--
......@@ -126,28 +176,30 @@ CREATE TABLE `offre` (
`created_at` datetime NOT NULL,
`updated_at` datetime DEFAULT NULL,
`ended_at` datetime NOT NULL,
`status` enum('draft','current','closed','trash') COLLATE utf8_unicode_ci DEFAULT NULL
`status` enum('draft','current','closed','trash') COLLATE utf8_unicode_ci DEFAULT NULL,
`sorted` longtext COLLATE utf8_unicode_ci COMMENT '(DC2Type:array)'
) ENGINE=InnoDB DEFAULT CHARSET=utf8 COLLATE=utf8_unicode_ci;
--
-- Déchargement des données de la table `offre`
--
INSERT INTO `offre` (`id`, `reference`, `created_at`, `updated_at`, `ended_at`, `status`) VALUES
(1, 'OF18060601', '2018-06-05 23:50:00', '2018-06-05 23:50:00', '2018-06-05 23:50:00', 'closed'),
(2, 'OF18060602', '2018-06-05 23:50:00', '2018-06-05 23:50:00', '2018-06-05 23:50:00', 'closed'),
(3, 'OF18060503', '2018-06-05 23:50:00', '2018-06-07 19:19:15', '2018-06-05 23:50:00', 'closed'),
(4, 'OF18060703', '2018-06-07 12:07:19', '2018-06-07 19:19:23', '2013-01-01 00:00:00', 'closed'),
(5, 'OF18060704', '2018-06-07 12:32:36', '2018-06-07 19:41:53', '2018-06-20 12:00:00', 'closed'),
(6, 'OF18060705', '2018-06-07 13:23:21', '2018-06-07 19:44:45', '2018-08-04 00:00:00', 'closed'),
(7, 'OF18060706', '2018-06-07 13:42:32', '2018-06-07 19:54:11', '2018-06-30 00:00:00', 'closed'),
(8, 'OF18060707', '2018-06-07 14:14:20', '2018-06-07 19:57:08', '2018-06-15 00:00:00', 'closed'),
(19, 'OF18060813', '2018-06-08 19:38:03', '0000-00-00 00:00:00', '2018-06-16 12:00:00', 'draft'),
(20, 'OF18060814', '2018-06-08 19:41:20', '2018-06-10 18:39:13', '2018-06-27 12:00:00', 'current'),
(21, 'OF18060901', '2018-06-09 09:56:05', '2018-06-10 16:59:52', '2018-06-12 12:00:00', 'current'),
(22, 'OF18061001', '2018-06-10 18:35:53', '0000-00-00 00:00:00', '2018-06-25 12:00:00', 'draft'),
(23, 'OF18061002', '2018-06-10 20:29:54', '2018-06-10 22:46:54', '2018-07-18 12:00:00', 'current'),
(25, 'OF18061102', '2018-06-11 11:33:48', '0000-00-00 00:00:00', '2018-06-20 12:00:00', 'draft');
INSERT INTO `offre` (`id`, `reference`, `created_at`, `updated_at`, `ended_at`, `status`, `sorted`) VALUES
(1, 'OF18060601', '2018-06-05 23:50:00', '2018-06-05 23:50:00', '2018-06-05 23:50:00', 'closed', 'a:0:{}'),
(2, 'OF18060602', '2018-06-05 23:50:00', '2018-06-05 23:50:00', '2018-06-05 23:50:00', 'closed', 'a:0:{}'),
(3, 'OF18060503', '2018-06-05 23:50:00', '2018-06-07 19:19:15', '2018-06-05 23:50:00', 'closed', 'a:0:{}'),
(4, 'OF18060703', '2018-06-07 12:07:19', '2018-06-07 19:19:23', '2013-01-01 00:00:00', 'closed', 'a:0:{}'),
(5, 'OF18060704', '2018-06-07 12:32:36', '2018-06-07 19:41:53', '2018-06-20 12:00:00', 'closed', 'a:0:{}'),
(6, 'OF18060705', '2018-06-07 13:23:21', '2018-06-07 19:44:45', '2018-08-04 00:00:00', 'closed', 'a:0:{}'),
(7, 'OF18060706', '2018-06-07 13:42:32', '2018-06-07 19:54:11', '2018-06-30 00:00:00', 'closed', 'a:0:{}'),
(8, 'OF18060707', '2018-06-07 14:14:20', '2018-06-07 19:57:08', '2018-06-15 00:00:00', 'closed', 'a:0:{}'),
(19, 'OF18060813', '2018-06-08 19:38:03', '2018-06-12 08:35:49', '2018-06-16 12:00:00', 'current', 'a:0:{}'),
(20, 'OF18060814', '2018-06-08 19:41:20', '2018-06-10 18:39:13', '2018-06-27 12:00:00', 'current', 'a:0:{}'),
(21, 'OF18060901', '2018-06-09 09:56:05', '2018-06-10 16:59:52', '2018-06-12 12:00:00', 'current', 'a:0:{}'),
(22, 'OF18061001', '2018-06-10 18:35:53', '0000-00-00 00:00:00', '2018-06-25 12:00:00', 'draft', 'a:0:{}'),
(23, 'OF18061002', '2018-06-10 20:29:54', '2018-06-10 22:46:54', '2018-07-18 12:00:00', 'current', 'a:0:{}'),
(27, 'OF18061301', '2018-06-13 10:58:30', NULL, '2018-06-13 12:00:00', 'draft', 'a:0:{}'),
(28, 'OF18061302', '2018-06-13 11:27:54', NULL, '2018-06-30 12:00:00', 'draft', 'a:0:{}');
-- --------------------------------------------------------
......@@ -225,12 +277,34 @@ ALTER TABLE `fos_user`
ADD UNIQUE KEY `UNIQ_957A6479A0D96FBF` (`email_canonical`),
ADD UNIQUE KEY `UNIQ_957A6479C05FB297` (`confirmation_token`);
--
-- Index pour la table `info`
--
ALTER TABLE `info`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `infos_lettres`
--
ALTER TABLE `infos_lettres`
ADD PRIMARY KEY (`id_info`,`id_lettre`),
ADD KEY `IDX_E007FE3840A92D55` (`id_info`),
ADD KEY `IDX_E007FE382E655AB6` (`id_lettre`);
--
-- Index pour la table `legume`
--
ALTER TABLE `legume`
ADD PRIMARY KEY (`id`);
--
-- Index pour la table `lettre`
--
ALTER TABLE `lettre`
ADD PRIMARY KEY (`id`),
ADD UNIQUE KEY `UNIQ_852EF5BAEA34913` (`reference`),
ADD KEY `IDX_852EF5B4103C75F` (`id_offre`);
--
-- Index pour la table `offre`
--
......@@ -253,7 +327,13 @@ ALTER TABLE `offre_legumes`
-- AUTO_INCREMENT pour la table `fos_user`
--
ALTER TABLE `fos_user`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=2;
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=3;
--
-- AUTO_INCREMENT pour la table `info`
--
ALTER TABLE `info`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `legume`
......@@ -261,11 +341,17 @@ ALTER TABLE `fos_user`
ALTER TABLE `legume`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=34;
--
-- AUTO_INCREMENT pour la table `lettre`
--
ALTER TABLE `lettre`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT;
--
-- AUTO_INCREMENT pour la table `offre`
--
ALTER TABLE `offre`
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=26;
MODIFY `id` int(11) NOT NULL AUTO_INCREMENT, AUTO_INCREMENT=29;
--
-- AUTO_INCREMENT pour la table `offre_legumes`
......@@ -277,6 +363,19 @@ ALTER TABLE `offre_legumes`
-- Contraintes pour les tables déchargées
--
--
-- Contraintes pour la table `infos_lettres`
--
ALTER TABLE `infos_lettres`
ADD CONSTRAINT `FK_E007FE382E655AB6` FOREIGN KEY (`id_lettre`) REFERENCES `info` (`id`),
ADD CONSTRAINT `FK_E007FE3840A92D55` FOREIGN KEY (`id_info`) REFERENCES `lettre` (`id`);
--
-- Contraintes pour la table `lettre`
--
ALTER TABLE `lettre`
ADD CONSTRAINT `FK_852EF5B4103C75F` FOREIGN KEY (`id_offre`) REFERENCES `offre` (`id`);
--
-- Contraintes pour la table `offre_legumes`
--
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment