@@ -23,192 +23,192 @@ |
||
23 | 23 | |
24 | 24 | class Api |
25 | 25 | { |
26 | - /** |
|
27 | - * @var ContainerInterface |
|
28 | - */ |
|
29 | - private $container; |
|
30 | - |
|
31 | - /** |
|
32 | - * @var EntityManagerInterface |
|
33 | - */ |
|
34 | - private $em; |
|
35 | - |
|
36 | - /** |
|
37 | - * @var SessionInterface |
|
38 | - */ |
|
39 | - private $session; |
|
40 | - |
|
41 | - /** |
|
42 | - * @var Account |
|
43 | - */ |
|
44 | - private $account; |
|
45 | - |
|
46 | - /** |
|
47 | - * @var Request|null |
|
48 | - */ |
|
49 | - private $request; |
|
50 | - |
|
51 | - /** |
|
52 | - * Api constructor. |
|
53 | - * @param ContainerInterface $container |
|
54 | - * @param EntityManagerInterface $em |
|
55 | - * @param SessionInterface $session |
|
56 | - * @param RequestStack $request_stack |
|
57 | - */ |
|
58 | - public function __construct(ContainerInterface $container, EntityManagerInterface $em, SessionInterface $session, RequestStack $request_stack) |
|
59 | - { |
|
60 | - $this->container = $container; |
|
61 | - $this->em = $em; |
|
62 | - $this->session = $session; |
|
63 | - $this->request = $request_stack->getCurrentRequest(); |
|
64 | - } |
|
65 | - |
|
66 | - /** |
|
67 | - * this method is used to test jwt and if the account is ok else send false |
|
68 | - * @param string $infos_jwt |
|
69 | - * @param string $token |
|
70 | - * @return bool |
|
71 | - * @throws Exception |
|
72 | - */ |
|
73 | - public function userIslogged(string $infos_jwt, string $token): bool |
|
74 | - { |
|
75 | - $em = $this->em; |
|
76 | - $jwt = Jwt::decode($infos_jwt, $token); |
|
77 | - |
|
78 | - if ($jwt === false) { |
|
79 | - return false; |
|
80 | - } |
|
81 | - |
|
82 | - $account_token_search = [ |
|
83 | - "token" => $token, |
|
84 | - "userAgent" => $this->request->server->get("HTTP_USER_AGENT"), |
|
85 | - "ip" => $this->request->server->get("REMOTE_ADDR") |
|
86 | - ]; |
|
87 | - if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$this->request->server->get("HTTP_USER_AGENT"))||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($this->request->server->get("HTTP_USER_AGENT"),0,4))) { |
|
88 | - $account_token_search = [ |
|
89 | - "token" => $token, |
|
90 | - "userAgent" => $this->request->server->get("HTTP_USER_AGENT"), |
|
91 | - ]; |
|
92 | - } |
|
93 | - |
|
94 | - $account_token = $em->getRepository(AccountToken::class)->findOneBy($account_token_search); |
|
95 | - |
|
96 | - if (!$account_token) { |
|
97 | - return false; |
|
98 | - } |
|
99 | - |
|
100 | - $this->account = $em->getRepository(Account::class)->findOneBy([ |
|
101 | - "id" => $account_token->getAccount()->getId(), |
|
102 | - "isActive" => true, |
|
103 | - ]); |
|
104 | - |
|
105 | - if (!$this->account) { |
|
106 | - return false; |
|
107 | - } |
|
108 | - |
|
109 | - $this->account->setLastConnection(new \DateTime()); |
|
110 | - $em->persist($this->account); |
|
111 | - $em->flush(); |
|
112 | - |
|
113 | - $this->getToken($this->account); |
|
114 | - $this->session->set("jwt_infos", $jwt); |
|
115 | - $this->session->set("account", $this->account); |
|
116 | - $this->session->set("account_token", $account_token); |
|
117 | - |
|
118 | - return true; |
|
119 | - } |
|
120 | - |
|
121 | - /** |
|
122 | - * method that return the token for a account |
|
123 | - * @param Account $account |
|
124 | - * @return string |
|
125 | - * @throws Exception |
|
126 | - */ |
|
127 | - public function getToken(Account $account): string |
|
128 | - { |
|
129 | - $account_token = $this->em->getRepository(AccountToken::class)->findOneBy([ |
|
130 | - "account" => $account, |
|
131 | - "userAgent" => $this->request->server->get("HTTP_USER_AGENT"), |
|
132 | - "ip" => $this->request->server->get("REMOTE_ADDR") |
|
133 | - ]); |
|
134 | - |
|
135 | - $token = $account_token ? $account_token->getToken() : null; |
|
136 | - $now = new \DateTime(); |
|
137 | - |
|
138 | - if ($token === null || $account_token->getEndToken() < $now) { |
|
139 | - return $this->setToken($account, $account_token); |
|
140 | - } |
|
141 | - |
|
142 | - return $token; |
|
143 | - } |
|
144 | - |
|
145 | - /** |
|
146 | - * @param Account $account |
|
147 | - * @param $account_token |
|
148 | - * @return string |
|
149 | - * method that set a token for the account |
|
150 | - * @throws Exception |
|
151 | - */ |
|
152 | - public function setToken(Account $account, $account_token): string |
|
153 | - { |
|
154 | - $token = $this->generateToken(); |
|
155 | - $now = new \DateTime(); |
|
156 | - $end_token = $now->add(new \DateInterval("PT".$this->container->getParameter("ribs_admin")["api_token_duration"]."M")); |
|
157 | - |
|
158 | - if (!$account_token) { |
|
159 | - $account_token = new AccountToken(); |
|
160 | - } |
|
161 | - |
|
162 | - $account_token->setToken($token); |
|
163 | - $account_token->setUserAgent($this->request->server->get("HTTP_USER_AGENT")); |
|
164 | - $account_token->setIp($this->request->server->get("REMOTE_ADDR")); |
|
165 | - $account_token->setEndToken($end_token); |
|
166 | - $account_token->setAccount($account); |
|
167 | - $this->em->persist($account_token); |
|
168 | - $this->em->flush(); |
|
169 | - |
|
170 | - $this->account = $account; |
|
171 | - $this->session->set("account", $this->account); |
|
172 | - $this->session->set("account_token", $account_token); |
|
173 | - |
|
174 | - return $token; |
|
175 | - } |
|
176 | - |
|
177 | - /** |
|
178 | - * generate a token for api |
|
179 | - * @param int $length |
|
180 | - * @return string |
|
181 | - */ |
|
182 | - public function generateToken(int $length = 200): string |
|
183 | - { |
|
184 | - $string = "abcdefghijklmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789"; |
|
185 | - $token = ""; |
|
186 | - srand((double)microtime() * 1000000); |
|
187 | - for ($i = 0; $i < $length; $i++) { |
|
188 | - $token .= $string[rand() % strlen($string)]; |
|
189 | - } |
|
190 | - |
|
191 | - return $token; |
|
192 | - } |
|
193 | - |
|
194 | - /** |
|
195 | - * method that encode an object to a json |
|
196 | - * @param $object |
|
197 | - * @param string $type |
|
198 | - * @return mixed |
|
199 | - * @throws ExceptionInterface |
|
200 | - * @throws AnnotationException |
|
201 | - */ |
|
202 | - public function serializeObject($object, $type = "json") |
|
203 | - { |
|
204 | - $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())); |
|
205 | - $serializer = new Serializer([new DateTimeNormalizer(), new ObjectNormalizer($classMetadataFactory)], [new XmlEncoder(), new JsonEncoder()]); |
|
206 | - |
|
207 | - return $serializer->normalize($object, $type, [ |
|
208 | - 'circular_reference_handler' => function ($object) { |
|
209 | - return $object->getId(); |
|
210 | - }, |
|
211 | - 'groups' => 'main' |
|
212 | - ]); |
|
213 | - } |
|
26 | + /** |
|
27 | + * @var ContainerInterface |
|
28 | + */ |
|
29 | + private $container; |
|
30 | + |
|
31 | + /** |
|
32 | + * @var EntityManagerInterface |
|
33 | + */ |
|
34 | + private $em; |
|
35 | + |
|
36 | + /** |
|
37 | + * @var SessionInterface |
|
38 | + */ |
|
39 | + private $session; |
|
40 | + |
|
41 | + /** |
|
42 | + * @var Account |
|
43 | + */ |
|
44 | + private $account; |
|
45 | + |
|
46 | + /** |
|
47 | + * @var Request|null |
|
48 | + */ |
|
49 | + private $request; |
|
50 | + |
|
51 | + /** |
|
52 | + * Api constructor. |
|
53 | + * @param ContainerInterface $container |
|
54 | + * @param EntityManagerInterface $em |
|
55 | + * @param SessionInterface $session |
|
56 | + * @param RequestStack $request_stack |
|
57 | + */ |
|
58 | + public function __construct(ContainerInterface $container, EntityManagerInterface $em, SessionInterface $session, RequestStack $request_stack) |
|
59 | + { |
|
60 | + $this->container = $container; |
|
61 | + $this->em = $em; |
|
62 | + $this->session = $session; |
|
63 | + $this->request = $request_stack->getCurrentRequest(); |
|
64 | + } |
|
65 | + |
|
66 | + /** |
|
67 | + * this method is used to test jwt and if the account is ok else send false |
|
68 | + * @param string $infos_jwt |
|
69 | + * @param string $token |
|
70 | + * @return bool |
|
71 | + * @throws Exception |
|
72 | + */ |
|
73 | + public function userIslogged(string $infos_jwt, string $token): bool |
|
74 | + { |
|
75 | + $em = $this->em; |
|
76 | + $jwt = Jwt::decode($infos_jwt, $token); |
|
77 | + |
|
78 | + if ($jwt === false) { |
|
79 | + return false; |
|
80 | + } |
|
81 | + |
|
82 | + $account_token_search = [ |
|
83 | + "token" => $token, |
|
84 | + "userAgent" => $this->request->server->get("HTTP_USER_AGENT"), |
|
85 | + "ip" => $this->request->server->get("REMOTE_ADDR") |
|
86 | + ]; |
|
87 | + if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$this->request->server->get("HTTP_USER_AGENT"))||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($this->request->server->get("HTTP_USER_AGENT"),0,4))) { |
|
88 | + $account_token_search = [ |
|
89 | + "token" => $token, |
|
90 | + "userAgent" => $this->request->server->get("HTTP_USER_AGENT"), |
|
91 | + ]; |
|
92 | + } |
|
93 | + |
|
94 | + $account_token = $em->getRepository(AccountToken::class)->findOneBy($account_token_search); |
|
95 | + |
|
96 | + if (!$account_token) { |
|
97 | + return false; |
|
98 | + } |
|
99 | + |
|
100 | + $this->account = $em->getRepository(Account::class)->findOneBy([ |
|
101 | + "id" => $account_token->getAccount()->getId(), |
|
102 | + "isActive" => true, |
|
103 | + ]); |
|
104 | + |
|
105 | + if (!$this->account) { |
|
106 | + return false; |
|
107 | + } |
|
108 | + |
|
109 | + $this->account->setLastConnection(new \DateTime()); |
|
110 | + $em->persist($this->account); |
|
111 | + $em->flush(); |
|
112 | + |
|
113 | + $this->getToken($this->account); |
|
114 | + $this->session->set("jwt_infos", $jwt); |
|
115 | + $this->session->set("account", $this->account); |
|
116 | + $this->session->set("account_token", $account_token); |
|
117 | + |
|
118 | + return true; |
|
119 | + } |
|
120 | + |
|
121 | + /** |
|
122 | + * method that return the token for a account |
|
123 | + * @param Account $account |
|
124 | + * @return string |
|
125 | + * @throws Exception |
|
126 | + */ |
|
127 | + public function getToken(Account $account): string |
|
128 | + { |
|
129 | + $account_token = $this->em->getRepository(AccountToken::class)->findOneBy([ |
|
130 | + "account" => $account, |
|
131 | + "userAgent" => $this->request->server->get("HTTP_USER_AGENT"), |
|
132 | + "ip" => $this->request->server->get("REMOTE_ADDR") |
|
133 | + ]); |
|
134 | + |
|
135 | + $token = $account_token ? $account_token->getToken() : null; |
|
136 | + $now = new \DateTime(); |
|
137 | + |
|
138 | + if ($token === null || $account_token->getEndToken() < $now) { |
|
139 | + return $this->setToken($account, $account_token); |
|
140 | + } |
|
141 | + |
|
142 | + return $token; |
|
143 | + } |
|
144 | + |
|
145 | + /** |
|
146 | + * @param Account $account |
|
147 | + * @param $account_token |
|
148 | + * @return string |
|
149 | + * method that set a token for the account |
|
150 | + * @throws Exception |
|
151 | + */ |
|
152 | + public function setToken(Account $account, $account_token): string |
|
153 | + { |
|
154 | + $token = $this->generateToken(); |
|
155 | + $now = new \DateTime(); |
|
156 | + $end_token = $now->add(new \DateInterval("PT".$this->container->getParameter("ribs_admin")["api_token_duration"]."M")); |
|
157 | + |
|
158 | + if (!$account_token) { |
|
159 | + $account_token = new AccountToken(); |
|
160 | + } |
|
161 | + |
|
162 | + $account_token->setToken($token); |
|
163 | + $account_token->setUserAgent($this->request->server->get("HTTP_USER_AGENT")); |
|
164 | + $account_token->setIp($this->request->server->get("REMOTE_ADDR")); |
|
165 | + $account_token->setEndToken($end_token); |
|
166 | + $account_token->setAccount($account); |
|
167 | + $this->em->persist($account_token); |
|
168 | + $this->em->flush(); |
|
169 | + |
|
170 | + $this->account = $account; |
|
171 | + $this->session->set("account", $this->account); |
|
172 | + $this->session->set("account_token", $account_token); |
|
173 | + |
|
174 | + return $token; |
|
175 | + } |
|
176 | + |
|
177 | + /** |
|
178 | + * generate a token for api |
|
179 | + * @param int $length |
|
180 | + * @return string |
|
181 | + */ |
|
182 | + public function generateToken(int $length = 200): string |
|
183 | + { |
|
184 | + $string = "abcdefghijklmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789"; |
|
185 | + $token = ""; |
|
186 | + srand((double)microtime() * 1000000); |
|
187 | + for ($i = 0; $i < $length; $i++) { |
|
188 | + $token .= $string[rand() % strlen($string)]; |
|
189 | + } |
|
190 | + |
|
191 | + return $token; |
|
192 | + } |
|
193 | + |
|
194 | + /** |
|
195 | + * method that encode an object to a json |
|
196 | + * @param $object |
|
197 | + * @param string $type |
|
198 | + * @return mixed |
|
199 | + * @throws ExceptionInterface |
|
200 | + * @throws AnnotationException |
|
201 | + */ |
|
202 | + public function serializeObject($object, $type = "json") |
|
203 | + { |
|
204 | + $classMetadataFactory = new ClassMetadataFactory(new AnnotationLoader(new AnnotationReader())); |
|
205 | + $serializer = new Serializer([new DateTimeNormalizer(), new ObjectNormalizer($classMetadataFactory)], [new XmlEncoder(), new JsonEncoder()]); |
|
206 | + |
|
207 | + return $serializer->normalize($object, $type, [ |
|
208 | + 'circular_reference_handler' => function ($object) { |
|
209 | + return $object->getId(); |
|
210 | + }, |
|
211 | + 'groups' => 'main' |
|
212 | + ]); |
|
213 | + } |
|
214 | 214 | } |
@@ -84,7 +84,7 @@ discard block |
||
84 | 84 | "userAgent" => $this->request->server->get("HTTP_USER_AGENT"), |
85 | 85 | "ip" => $this->request->server->get("REMOTE_ADDR") |
86 | 86 | ]; |
87 | - if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i',$this->request->server->get("HTTP_USER_AGENT"))||preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i',substr($this->request->server->get("HTTP_USER_AGENT"),0,4))) { |
|
87 | + if (preg_match('/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows (ce|phone)|xda|xiino/i', $this->request->server->get("HTTP_USER_AGENT")) || preg_match('/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s\-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|\-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw\-(n|u)|c55\/|capi|ccwa|cdm\-|cell|chtm|cldc|cmd\-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc\-s|devi|dica|dmob|do(c|p)o|ds(12|\-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(\-|_)|g1 u|g560|gene|gf\-5|g\-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd\-(m|p|t)|hei\-|hi(pt|ta)|hp( i|ip)|hs\-c|ht(c(\-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i\-(20|go|ma)|i230|iac( |\-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc\-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|\-[a-w])|libw|lynx|m1\-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m\-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(\-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)\-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|\-([1-8]|c))|phil|pire|pl(ay|uc)|pn\-2|po(ck|rt|se)|prox|psio|pt\-g|qa\-a|qc(07|12|21|32|60|\-[2-7]|i\-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h\-|oo|p\-)|sdk\/|se(c(\-|0|1)|47|mc|nd|ri)|sgh\-|shar|sie(\-|m)|sk\-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h\-|v\-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl\-|tdg\-|tel(i|m)|tim\-|t\-mo|to(pl|sh)|ts(70|m\-|m3|m5)|tx\-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|\-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(\-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas\-|your|zeto|zte\-/i', substr($this->request->server->get("HTTP_USER_AGENT"), 0, 4))) { |
|
88 | 88 | $account_token_search = [ |
89 | 89 | "token" => $token, |
90 | 90 | "userAgent" => $this->request->server->get("HTTP_USER_AGENT"), |
@@ -153,7 +153,7 @@ discard block |
||
153 | 153 | { |
154 | 154 | $token = $this->generateToken(); |
155 | 155 | $now = new \DateTime(); |
156 | - $end_token = $now->add(new \DateInterval("PT".$this->container->getParameter("ribs_admin")["api_token_duration"]."M")); |
|
156 | + $end_token = $now->add(new \DateInterval("PT" . $this->container->getParameter("ribs_admin")["api_token_duration"] . "M")); |
|
157 | 157 | |
158 | 158 | if (!$account_token) { |
159 | 159 | $account_token = new AccountToken(); |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | { |
184 | 184 | $string = "abcdefghijklmnopqrstuvwxyzABCDEFGHJKMNPQRSTUVWXYZ23456789"; |
185 | 185 | $token = ""; |
186 | - srand((double)microtime() * 1000000); |
|
186 | + srand((double) microtime() * 1000000); |
|
187 | 187 | for ($i = 0; $i < $length; $i++) { |
188 | 188 | $token .= $string[rand() % strlen($string)]; |
189 | 189 | } |
@@ -205,7 +205,7 @@ discard block |
||
205 | 205 | $serializer = new Serializer([new DateTimeNormalizer(), new ObjectNormalizer($classMetadataFactory)], [new XmlEncoder(), new JsonEncoder()]); |
206 | 206 | |
207 | 207 | return $serializer->normalize($object, $type, [ |
208 | - 'circular_reference_handler' => function ($object) { |
|
208 | + 'circular_reference_handler' => function($object) { |
|
209 | 209 | return $object->getId(); |
210 | 210 | }, |
211 | 211 | 'groups' => 'main' |
@@ -12,30 +12,30 @@ |
||
12 | 12 | */ |
13 | 13 | private $user; |
14 | 14 | |
15 | - /** |
|
16 | - * CreateUpdateAwareListener constructor. |
|
17 | - * @param TokenStorage $tokenStorage |
|
18 | - */ |
|
19 | - public function __construct(TokenStorage $tokenStorage) |
|
15 | + /** |
|
16 | + * CreateUpdateAwareListener constructor. |
|
17 | + * @param TokenStorage $tokenStorage |
|
18 | + */ |
|
19 | + public function __construct(TokenStorage $tokenStorage) |
|
20 | 20 | { |
21 | - $this->user = $tokenStorage->getToken()->getUser()->getUser(); |
|
21 | + $this->user = $tokenStorage->getToken()->getUser()->getUser(); |
|
22 | 22 | } |
23 | 23 | |
24 | 24 | public function prePersist($entity) |
25 | 25 | { |
26 | 26 | if ($entity->getCreatedBy() === null) { |
27 | - $entity->setCreatedAt(new \DateTime()); |
|
28 | - $entity->setCreatedBy($this->user); |
|
27 | + $entity->setCreatedAt(new \DateTime()); |
|
28 | + $entity->setCreatedBy($this->user); |
|
29 | 29 | } |
30 | - if ($entity->getUpdatedBy() === null) { |
|
31 | - $entity->setUpdatedAt(new \DateTime()); |
|
32 | - $entity->setUpdatedBy($this->user); |
|
33 | - } |
|
30 | + if ($entity->getUpdatedBy() === null) { |
|
31 | + $entity->setUpdatedAt(new \DateTime()); |
|
32 | + $entity->setUpdatedBy($this->user); |
|
33 | + } |
|
34 | 34 | } |
35 | 35 | |
36 | - public function preUpdate($entity) |
|
37 | - { |
|
38 | - $entity->setUpdatedAt(new \DateTime()); |
|
39 | - $entity->setUpdatedBy($this->user); |
|
40 | - } |
|
36 | + public function preUpdate($entity) |
|
37 | + { |
|
38 | + $entity->setUpdatedAt(new \DateTime()); |
|
39 | + $entity->setUpdatedBy($this->user); |
|
40 | + } |
|
41 | 41 | } |
@@ -13,137 +13,137 @@ |
||
13 | 13 | */ |
14 | 14 | class UserLogs |
15 | 15 | { |
16 | - use CreatedUpdatedTrait; |
|
17 | - |
|
18 | - /** |
|
19 | - * @var integer |
|
20 | - * |
|
21 | - * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
22 | - * @ORM\Id |
|
23 | - * @ORM\GeneratedValue(strategy="NONE") |
|
24 | - */ |
|
25 | - private $id; |
|
26 | - |
|
27 | - /** |
|
28 | - * @var User |
|
29 | - * |
|
30 | - * @ORM\Id |
|
31 | - * @ORM\GeneratedValue(strategy="NONE") |
|
32 | - * @ORM\OneToOne(targetEntity="User") |
|
33 | - * @ORM\JoinColumns({ |
|
34 | - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") |
|
35 | - * }) |
|
36 | - */ |
|
37 | - private $user; |
|
38 | - |
|
39 | - /** |
|
40 | - * @var string |
|
41 | - * |
|
42 | - * @ORM\Column(name="method", type="string", length=255, nullable=false) |
|
43 | - */ |
|
44 | - private $method; |
|
45 | - |
|
46 | - /** |
|
47 | - * @var string |
|
48 | - * |
|
49 | - * @ORM\Column(name="url", type="string", length=255, nullable=false) |
|
50 | - */ |
|
51 | - private $url; |
|
52 | - |
|
53 | - /** |
|
54 | - * @var string |
|
55 | - * |
|
56 | - * @ORM\Column(name="equest_parameters", type="text", nullable=true) |
|
57 | - */ |
|
58 | - private $request_parameters; |
|
59 | - |
|
60 | - /** |
|
61 | - * @return int |
|
62 | - */ |
|
63 | - public function getId() |
|
64 | - { |
|
65 | - return $this->id; |
|
66 | - } |
|
67 | - |
|
68 | - /** |
|
69 | - * @param int $id |
|
70 | - */ |
|
71 | - public function setId($id) |
|
72 | - { |
|
73 | - $this->id = $id; |
|
74 | - } |
|
75 | - |
|
76 | - /** |
|
77 | - * @return User |
|
78 | - */ |
|
79 | - public function getUser(): User |
|
80 | - { |
|
81 | - return $this->user; |
|
82 | - } |
|
83 | - |
|
84 | - /** |
|
85 | - * @param \User $user |
|
86 | - */ |
|
87 | - public function setUser($user) |
|
88 | - { |
|
89 | - $this->user = $user; |
|
90 | - } |
|
91 | - |
|
92 | - /** |
|
93 | - * @return string |
|
94 | - */ |
|
95 | - public function getMethod(): string |
|
96 | - { |
|
97 | - return $this->method; |
|
98 | - } |
|
99 | - |
|
100 | - /** |
|
101 | - * @param string $method |
|
102 | - * @return UserLogs |
|
103 | - */ |
|
104 | - public function setMethod(string $method): UserLogs |
|
105 | - { |
|
106 | - $this->method = $method; |
|
107 | - |
|
108 | - return $this; |
|
109 | - } |
|
110 | - |
|
111 | - /** |
|
112 | - * @return string |
|
113 | - */ |
|
114 | - public function getUrl(): string |
|
115 | - { |
|
116 | - return $this->url; |
|
117 | - } |
|
118 | - |
|
119 | - /** |
|
120 | - * @param string $url |
|
121 | - * @return UserLogs |
|
122 | - */ |
|
123 | - public function setUrl(string $url): UserLogs |
|
124 | - { |
|
125 | - $this->url = $url; |
|
126 | - |
|
127 | - return $this; |
|
128 | - } |
|
129 | - |
|
130 | - /** |
|
131 | - * @return string |
|
132 | - */ |
|
133 | - public function getRequestParameters(): string |
|
134 | - { |
|
135 | - return $this->request_parameters; |
|
136 | - } |
|
137 | - |
|
138 | - /** |
|
139 | - * @param string $request_parameters |
|
140 | - * @return UserLogs |
|
141 | - */ |
|
142 | - public function setRequestParameters(string $request_parameters): UserLogs |
|
143 | - { |
|
144 | - $this->request_parameters = $request_parameters; |
|
145 | - |
|
146 | - return $this; |
|
147 | - } |
|
16 | + use CreatedUpdatedTrait; |
|
17 | + |
|
18 | + /** |
|
19 | + * @var integer |
|
20 | + * |
|
21 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
22 | + * @ORM\Id |
|
23 | + * @ORM\GeneratedValue(strategy="NONE") |
|
24 | + */ |
|
25 | + private $id; |
|
26 | + |
|
27 | + /** |
|
28 | + * @var User |
|
29 | + * |
|
30 | + * @ORM\Id |
|
31 | + * @ORM\GeneratedValue(strategy="NONE") |
|
32 | + * @ORM\OneToOne(targetEntity="User") |
|
33 | + * @ORM\JoinColumns({ |
|
34 | + * @ORM\JoinColumn(name="user_id", referencedColumnName="id") |
|
35 | + * }) |
|
36 | + */ |
|
37 | + private $user; |
|
38 | + |
|
39 | + /** |
|
40 | + * @var string |
|
41 | + * |
|
42 | + * @ORM\Column(name="method", type="string", length=255, nullable=false) |
|
43 | + */ |
|
44 | + private $method; |
|
45 | + |
|
46 | + /** |
|
47 | + * @var string |
|
48 | + * |
|
49 | + * @ORM\Column(name="url", type="string", length=255, nullable=false) |
|
50 | + */ |
|
51 | + private $url; |
|
52 | + |
|
53 | + /** |
|
54 | + * @var string |
|
55 | + * |
|
56 | + * @ORM\Column(name="equest_parameters", type="text", nullable=true) |
|
57 | + */ |
|
58 | + private $request_parameters; |
|
59 | + |
|
60 | + /** |
|
61 | + * @return int |
|
62 | + */ |
|
63 | + public function getId() |
|
64 | + { |
|
65 | + return $this->id; |
|
66 | + } |
|
67 | + |
|
68 | + /** |
|
69 | + * @param int $id |
|
70 | + */ |
|
71 | + public function setId($id) |
|
72 | + { |
|
73 | + $this->id = $id; |
|
74 | + } |
|
75 | + |
|
76 | + /** |
|
77 | + * @return User |
|
78 | + */ |
|
79 | + public function getUser(): User |
|
80 | + { |
|
81 | + return $this->user; |
|
82 | + } |
|
83 | + |
|
84 | + /** |
|
85 | + * @param \User $user |
|
86 | + */ |
|
87 | + public function setUser($user) |
|
88 | + { |
|
89 | + $this->user = $user; |
|
90 | + } |
|
91 | + |
|
92 | + /** |
|
93 | + * @return string |
|
94 | + */ |
|
95 | + public function getMethod(): string |
|
96 | + { |
|
97 | + return $this->method; |
|
98 | + } |
|
99 | + |
|
100 | + /** |
|
101 | + * @param string $method |
|
102 | + * @return UserLogs |
|
103 | + */ |
|
104 | + public function setMethod(string $method): UserLogs |
|
105 | + { |
|
106 | + $this->method = $method; |
|
107 | + |
|
108 | + return $this; |
|
109 | + } |
|
110 | + |
|
111 | + /** |
|
112 | + * @return string |
|
113 | + */ |
|
114 | + public function getUrl(): string |
|
115 | + { |
|
116 | + return $this->url; |
|
117 | + } |
|
118 | + |
|
119 | + /** |
|
120 | + * @param string $url |
|
121 | + * @return UserLogs |
|
122 | + */ |
|
123 | + public function setUrl(string $url): UserLogs |
|
124 | + { |
|
125 | + $this->url = $url; |
|
126 | + |
|
127 | + return $this; |
|
128 | + } |
|
129 | + |
|
130 | + /** |
|
131 | + * @return string |
|
132 | + */ |
|
133 | + public function getRequestParameters(): string |
|
134 | + { |
|
135 | + return $this->request_parameters; |
|
136 | + } |
|
137 | + |
|
138 | + /** |
|
139 | + * @param string $request_parameters |
|
140 | + * @return UserLogs |
|
141 | + */ |
|
142 | + public function setRequestParameters(string $request_parameters): UserLogs |
|
143 | + { |
|
144 | + $this->request_parameters = $request_parameters; |
|
145 | + |
|
146 | + return $this; |
|
147 | + } |
|
148 | 148 | } |
149 | 149 |
@@ -16,7 +16,7 @@ |
||
16 | 16 | */ |
17 | 17 | class AccessRight |
18 | 18 | { |
19 | - use CreatedUpdatedTrait; |
|
19 | + use CreatedUpdatedTrait; |
|
20 | 20 | |
21 | 21 | /** |
22 | 22 | * @var integer |
@@ -14,296 +14,296 @@ |
||
14 | 14 | */ |
15 | 15 | class Module |
16 | 16 | { |
17 | - use CreatedUpdatedTrait; |
|
18 | - |
|
19 | - /** |
|
20 | - * @var integer |
|
21 | - * |
|
22 | - * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
23 | - * @ORM\Id |
|
24 | - * @ORM\GeneratedValue(strategy="IDENTITY") |
|
25 | - */ |
|
26 | - private $id; |
|
27 | - |
|
28 | - /** |
|
29 | - * @var string |
|
30 | - * |
|
31 | - * @ORM\Column(name="package_name", type="string", length=255, nullable=false) |
|
32 | - */ |
|
33 | - private $packageName; |
|
34 | - |
|
35 | - /** |
|
36 | - * @var string |
|
37 | - * |
|
38 | - * @ORM\Column(name="title_tag", type="string", length=70, nullable=true) |
|
39 | - */ |
|
40 | - private $titleTag; |
|
41 | - |
|
42 | - /** |
|
43 | - * @var string |
|
44 | - * |
|
45 | - * @ORM\Column(name="description_tag", type="string", length=160, nullable=true) |
|
46 | - */ |
|
47 | - private $descriptionTag; |
|
48 | - |
|
49 | - /** |
|
50 | - * @var string |
|
51 | - * |
|
52 | - * @ORM\Column(name="title", type="string", length=255, nullable=false) |
|
53 | - */ |
|
54 | - private $title; |
|
55 | - |
|
56 | - /** |
|
57 | - * @var string |
|
58 | - * |
|
59 | - * @ORM\Column(name="template", type="string", length=255, nullable=true) |
|
60 | - */ |
|
61 | - private $template; |
|
62 | - |
|
63 | - /** |
|
64 | - * @var string |
|
65 | - * |
|
66 | - * @ORM\Column(name="url", type="string", length=255, nullable=true) |
|
67 | - */ |
|
68 | - private $url; |
|
69 | - |
|
70 | - /** |
|
71 | - * @var string |
|
72 | - * |
|
73 | - * @ORM\Column(name="url_admin", type="string", length=255, nullable=true) |
|
74 | - */ |
|
75 | - private $urlAdmin; |
|
76 | - |
|
77 | - /** |
|
78 | - * @var boolean |
|
79 | - * |
|
80 | - * @ORM\Column(name="active", type="boolean", nullable=false) |
|
81 | - */ |
|
82 | - private $active; |
|
83 | - |
|
84 | - /** |
|
85 | - * @var integer |
|
86 | - * |
|
87 | - * @ORM\Column(name="`order`", type="integer", nullable=true) |
|
88 | - */ |
|
89 | - private $order; |
|
90 | - |
|
91 | - /** |
|
92 | - * @var boolean |
|
93 | - * |
|
94 | - * @ORM\Column(name="displayed", type="boolean", nullable=false) |
|
95 | - */ |
|
96 | - private $displayed; |
|
97 | - |
|
98 | - /** |
|
99 | - * @var boolean |
|
100 | - * |
|
101 | - * @ORM\Column(name="dev_mode", type="boolean", nullable=false) |
|
102 | - */ |
|
103 | - private $devMode = false; |
|
104 | - |
|
105 | - /** |
|
106 | - * @return int |
|
107 | - */ |
|
108 | - public function getId(): int |
|
109 | - { |
|
110 | - return $this->id; |
|
111 | - } |
|
112 | - |
|
113 | - /** |
|
114 | - * @param int $id |
|
115 | - */ |
|
116 | - public function setId(int $id) |
|
117 | - { |
|
118 | - $this->id = $id; |
|
119 | - } |
|
120 | - |
|
121 | - /** |
|
122 | - * @return string |
|
123 | - */ |
|
124 | - public function getPackageName(): ?string |
|
125 | - { |
|
126 | - return $this->packageName; |
|
127 | - } |
|
128 | - |
|
129 | - /** |
|
130 | - * @param string $package_name |
|
131 | - */ |
|
132 | - public function setPackageName(string $package_name) |
|
133 | - { |
|
134 | - $this->packageName = $package_name; |
|
135 | - } |
|
136 | - |
|
137 | - /** |
|
138 | - * @return string |
|
139 | - */ |
|
140 | - public function getTitleTag(): ?string |
|
141 | - { |
|
142 | - return $this->titleTag; |
|
143 | - } |
|
144 | - |
|
145 | - /** |
|
146 | - * @param string $titleTag |
|
147 | - */ |
|
148 | - public function setTitleTag(string $titleTag) |
|
149 | - { |
|
150 | - $this->titleTag = $titleTag; |
|
151 | - } |
|
152 | - |
|
153 | - /** |
|
154 | - * @return string |
|
155 | - */ |
|
156 | - public function getDescriptionTag(): ?string |
|
157 | - { |
|
158 | - return $this->descriptionTag; |
|
159 | - } |
|
160 | - |
|
161 | - /** |
|
162 | - * @param string $descriptionTag |
|
163 | - */ |
|
164 | - public function setDescriptionTag(string $descriptionTag) |
|
165 | - { |
|
166 | - $this->descriptionTag = $descriptionTag; |
|
167 | - } |
|
168 | - |
|
169 | - /** |
|
170 | - * @return string |
|
171 | - */ |
|
172 | - public function getTitle(): ?string |
|
173 | - { |
|
174 | - return $this->title; |
|
175 | - } |
|
176 | - |
|
177 | - /** |
|
178 | - * @param string $title |
|
179 | - */ |
|
180 | - public function setTitle(string $title) |
|
181 | - { |
|
182 | - $this->title = $title; |
|
183 | - } |
|
184 | - |
|
185 | - /** |
|
186 | - * @return string |
|
187 | - */ |
|
188 | - public function getTemplate(): ?string |
|
189 | - { |
|
190 | - return $this->template; |
|
191 | - } |
|
192 | - |
|
193 | - /** |
|
194 | - * @param string $template |
|
195 | - */ |
|
196 | - public function setTemplate(string $template) |
|
197 | - { |
|
198 | - $this->template = $template; |
|
199 | - } |
|
200 | - |
|
201 | - /** |
|
202 | - * @return string |
|
203 | - */ |
|
204 | - public function getUrl(): ?string |
|
205 | - { |
|
206 | - return $this->url; |
|
207 | - } |
|
208 | - |
|
209 | - /** |
|
210 | - * @param string $url |
|
211 | - */ |
|
212 | - public function setUrl(string $url) |
|
213 | - { |
|
214 | - $this->url = $url; |
|
215 | - } |
|
216 | - |
|
217 | - /** |
|
218 | - * @return string |
|
219 | - */ |
|
220 | - public function getUrlAdmin(): ?string |
|
221 | - { |
|
222 | - return $this->urlAdmin; |
|
223 | - } |
|
224 | - |
|
225 | - /** |
|
226 | - * @param string $urlAdmin |
|
227 | - */ |
|
228 | - public function setUrlAdmin(string $urlAdmin) |
|
229 | - { |
|
230 | - $this->urlAdmin = $urlAdmin; |
|
231 | - } |
|
232 | - |
|
233 | - /** |
|
234 | - * @return boolean |
|
235 | - */ |
|
236 | - public function getActive(): ?bool |
|
237 | - { |
|
238 | - return $this->active; |
|
239 | - } |
|
240 | - |
|
241 | - /** |
|
242 | - * @param bool $active |
|
243 | - */ |
|
244 | - public function setActive(bool $active) |
|
245 | - { |
|
246 | - $this->active = $active; |
|
247 | - } |
|
248 | - |
|
249 | - /** |
|
250 | - * @return int |
|
251 | - */ |
|
252 | - public function getOrder(): ?int |
|
253 | - { |
|
254 | - return $this->order; |
|
255 | - } |
|
256 | - |
|
257 | - /** |
|
258 | - * @param int $order |
|
259 | - */ |
|
260 | - public function setOrder(int $order) |
|
261 | - { |
|
262 | - $this->order = $order; |
|
263 | - } |
|
264 | - |
|
265 | - /** |
|
266 | - * @return bool |
|
267 | - */ |
|
268 | - public function getDisplayed(): ?bool |
|
269 | - { |
|
270 | - return $this->displayed; |
|
271 | - } |
|
272 | - |
|
273 | - /** |
|
274 | - * @param bool $displayed |
|
275 | - */ |
|
276 | - public function setDisplayed(bool $displayed) |
|
277 | - { |
|
278 | - $this->displayed = $displayed; |
|
279 | - } |
|
280 | - |
|
281 | - /** |
|
282 | - * @return bool |
|
283 | - */ |
|
284 | - public function getDevMode(): bool |
|
285 | - { |
|
286 | - return $this->devMode; |
|
287 | - } |
|
288 | - |
|
289 | - /** |
|
290 | - * @param bool $devMode |
|
291 | - * @return Module |
|
292 | - */ |
|
293 | - public function setDevMode(bool $devMode): Module |
|
294 | - { |
|
295 | - $this->devMode = $devMode; |
|
296 | - |
|
297 | - return $this; |
|
298 | - } |
|
299 | - |
|
300 | - public function getFormattedActive() |
|
301 | - { |
|
302 | - return $this->getActive() ? "Oui" : "Non"; |
|
303 | - } |
|
304 | - |
|
305 | - public function getFormattedDisplayed() |
|
306 | - { |
|
307 | - return $this->getDisplayed() ? "Oui" : "Non"; |
|
308 | - } |
|
17 | + use CreatedUpdatedTrait; |
|
18 | + |
|
19 | + /** |
|
20 | + * @var integer |
|
21 | + * |
|
22 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
23 | + * @ORM\Id |
|
24 | + * @ORM\GeneratedValue(strategy="IDENTITY") |
|
25 | + */ |
|
26 | + private $id; |
|
27 | + |
|
28 | + /** |
|
29 | + * @var string |
|
30 | + * |
|
31 | + * @ORM\Column(name="package_name", type="string", length=255, nullable=false) |
|
32 | + */ |
|
33 | + private $packageName; |
|
34 | + |
|
35 | + /** |
|
36 | + * @var string |
|
37 | + * |
|
38 | + * @ORM\Column(name="title_tag", type="string", length=70, nullable=true) |
|
39 | + */ |
|
40 | + private $titleTag; |
|
41 | + |
|
42 | + /** |
|
43 | + * @var string |
|
44 | + * |
|
45 | + * @ORM\Column(name="description_tag", type="string", length=160, nullable=true) |
|
46 | + */ |
|
47 | + private $descriptionTag; |
|
48 | + |
|
49 | + /** |
|
50 | + * @var string |
|
51 | + * |
|
52 | + * @ORM\Column(name="title", type="string", length=255, nullable=false) |
|
53 | + */ |
|
54 | + private $title; |
|
55 | + |
|
56 | + /** |
|
57 | + * @var string |
|
58 | + * |
|
59 | + * @ORM\Column(name="template", type="string", length=255, nullable=true) |
|
60 | + */ |
|
61 | + private $template; |
|
62 | + |
|
63 | + /** |
|
64 | + * @var string |
|
65 | + * |
|
66 | + * @ORM\Column(name="url", type="string", length=255, nullable=true) |
|
67 | + */ |
|
68 | + private $url; |
|
69 | + |
|
70 | + /** |
|
71 | + * @var string |
|
72 | + * |
|
73 | + * @ORM\Column(name="url_admin", type="string", length=255, nullable=true) |
|
74 | + */ |
|
75 | + private $urlAdmin; |
|
76 | + |
|
77 | + /** |
|
78 | + * @var boolean |
|
79 | + * |
|
80 | + * @ORM\Column(name="active", type="boolean", nullable=false) |
|
81 | + */ |
|
82 | + private $active; |
|
83 | + |
|
84 | + /** |
|
85 | + * @var integer |
|
86 | + * |
|
87 | + * @ORM\Column(name="`order`", type="integer", nullable=true) |
|
88 | + */ |
|
89 | + private $order; |
|
90 | + |
|
91 | + /** |
|
92 | + * @var boolean |
|
93 | + * |
|
94 | + * @ORM\Column(name="displayed", type="boolean", nullable=false) |
|
95 | + */ |
|
96 | + private $displayed; |
|
97 | + |
|
98 | + /** |
|
99 | + * @var boolean |
|
100 | + * |
|
101 | + * @ORM\Column(name="dev_mode", type="boolean", nullable=false) |
|
102 | + */ |
|
103 | + private $devMode = false; |
|
104 | + |
|
105 | + /** |
|
106 | + * @return int |
|
107 | + */ |
|
108 | + public function getId(): int |
|
109 | + { |
|
110 | + return $this->id; |
|
111 | + } |
|
112 | + |
|
113 | + /** |
|
114 | + * @param int $id |
|
115 | + */ |
|
116 | + public function setId(int $id) |
|
117 | + { |
|
118 | + $this->id = $id; |
|
119 | + } |
|
120 | + |
|
121 | + /** |
|
122 | + * @return string |
|
123 | + */ |
|
124 | + public function getPackageName(): ?string |
|
125 | + { |
|
126 | + return $this->packageName; |
|
127 | + } |
|
128 | + |
|
129 | + /** |
|
130 | + * @param string $package_name |
|
131 | + */ |
|
132 | + public function setPackageName(string $package_name) |
|
133 | + { |
|
134 | + $this->packageName = $package_name; |
|
135 | + } |
|
136 | + |
|
137 | + /** |
|
138 | + * @return string |
|
139 | + */ |
|
140 | + public function getTitleTag(): ?string |
|
141 | + { |
|
142 | + return $this->titleTag; |
|
143 | + } |
|
144 | + |
|
145 | + /** |
|
146 | + * @param string $titleTag |
|
147 | + */ |
|
148 | + public function setTitleTag(string $titleTag) |
|
149 | + { |
|
150 | + $this->titleTag = $titleTag; |
|
151 | + } |
|
152 | + |
|
153 | + /** |
|
154 | + * @return string |
|
155 | + */ |
|
156 | + public function getDescriptionTag(): ?string |
|
157 | + { |
|
158 | + return $this->descriptionTag; |
|
159 | + } |
|
160 | + |
|
161 | + /** |
|
162 | + * @param string $descriptionTag |
|
163 | + */ |
|
164 | + public function setDescriptionTag(string $descriptionTag) |
|
165 | + { |
|
166 | + $this->descriptionTag = $descriptionTag; |
|
167 | + } |
|
168 | + |
|
169 | + /** |
|
170 | + * @return string |
|
171 | + */ |
|
172 | + public function getTitle(): ?string |
|
173 | + { |
|
174 | + return $this->title; |
|
175 | + } |
|
176 | + |
|
177 | + /** |
|
178 | + * @param string $title |
|
179 | + */ |
|
180 | + public function setTitle(string $title) |
|
181 | + { |
|
182 | + $this->title = $title; |
|
183 | + } |
|
184 | + |
|
185 | + /** |
|
186 | + * @return string |
|
187 | + */ |
|
188 | + public function getTemplate(): ?string |
|
189 | + { |
|
190 | + return $this->template; |
|
191 | + } |
|
192 | + |
|
193 | + /** |
|
194 | + * @param string $template |
|
195 | + */ |
|
196 | + public function setTemplate(string $template) |
|
197 | + { |
|
198 | + $this->template = $template; |
|
199 | + } |
|
200 | + |
|
201 | + /** |
|
202 | + * @return string |
|
203 | + */ |
|
204 | + public function getUrl(): ?string |
|
205 | + { |
|
206 | + return $this->url; |
|
207 | + } |
|
208 | + |
|
209 | + /** |
|
210 | + * @param string $url |
|
211 | + */ |
|
212 | + public function setUrl(string $url) |
|
213 | + { |
|
214 | + $this->url = $url; |
|
215 | + } |
|
216 | + |
|
217 | + /** |
|
218 | + * @return string |
|
219 | + */ |
|
220 | + public function getUrlAdmin(): ?string |
|
221 | + { |
|
222 | + return $this->urlAdmin; |
|
223 | + } |
|
224 | + |
|
225 | + /** |
|
226 | + * @param string $urlAdmin |
|
227 | + */ |
|
228 | + public function setUrlAdmin(string $urlAdmin) |
|
229 | + { |
|
230 | + $this->urlAdmin = $urlAdmin; |
|
231 | + } |
|
232 | + |
|
233 | + /** |
|
234 | + * @return boolean |
|
235 | + */ |
|
236 | + public function getActive(): ?bool |
|
237 | + { |
|
238 | + return $this->active; |
|
239 | + } |
|
240 | + |
|
241 | + /** |
|
242 | + * @param bool $active |
|
243 | + */ |
|
244 | + public function setActive(bool $active) |
|
245 | + { |
|
246 | + $this->active = $active; |
|
247 | + } |
|
248 | + |
|
249 | + /** |
|
250 | + * @return int |
|
251 | + */ |
|
252 | + public function getOrder(): ?int |
|
253 | + { |
|
254 | + return $this->order; |
|
255 | + } |
|
256 | + |
|
257 | + /** |
|
258 | + * @param int $order |
|
259 | + */ |
|
260 | + public function setOrder(int $order) |
|
261 | + { |
|
262 | + $this->order = $order; |
|
263 | + } |
|
264 | + |
|
265 | + /** |
|
266 | + * @return bool |
|
267 | + */ |
|
268 | + public function getDisplayed(): ?bool |
|
269 | + { |
|
270 | + return $this->displayed; |
|
271 | + } |
|
272 | + |
|
273 | + /** |
|
274 | + * @param bool $displayed |
|
275 | + */ |
|
276 | + public function setDisplayed(bool $displayed) |
|
277 | + { |
|
278 | + $this->displayed = $displayed; |
|
279 | + } |
|
280 | + |
|
281 | + /** |
|
282 | + * @return bool |
|
283 | + */ |
|
284 | + public function getDevMode(): bool |
|
285 | + { |
|
286 | + return $this->devMode; |
|
287 | + } |
|
288 | + |
|
289 | + /** |
|
290 | + * @param bool $devMode |
|
291 | + * @return Module |
|
292 | + */ |
|
293 | + public function setDevMode(bool $devMode): Module |
|
294 | + { |
|
295 | + $this->devMode = $devMode; |
|
296 | + |
|
297 | + return $this; |
|
298 | + } |
|
299 | + |
|
300 | + public function getFormattedActive() |
|
301 | + { |
|
302 | + return $this->getActive() ? "Oui" : "Non"; |
|
303 | + } |
|
304 | + |
|
305 | + public function getFormattedDisplayed() |
|
306 | + { |
|
307 | + return $this->getDisplayed() ? "Oui" : "Non"; |
|
308 | + } |
|
309 | 309 | } |
@@ -14,51 +14,51 @@ discard block |
||
14 | 14 | */ |
15 | 15 | class Page |
16 | 16 | { |
17 | - use CreatedUpdatedTrait; |
|
18 | - |
|
19 | - /** |
|
20 | - * @var integer |
|
21 | - * |
|
22 | - * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
23 | - * @ORM\Id |
|
24 | - * @ORM\GeneratedValue(strategy="IDENTITY") |
|
25 | - */ |
|
26 | - private $id; |
|
27 | - |
|
28 | - /** |
|
29 | - * @var string |
|
30 | - * |
|
31 | - * @ORM\Column(name="guid", type="string", length=255, nullable=false) |
|
32 | - */ |
|
33 | - private $guid; |
|
34 | - |
|
35 | - /** |
|
36 | - * @var string |
|
37 | - * |
|
38 | - * @ORM\Column(name="title_tag", type="string", length=70, nullable=true) |
|
39 | - */ |
|
40 | - private $titleTag; |
|
41 | - |
|
42 | - /** |
|
43 | - * @var string |
|
44 | - * |
|
45 | - * @ORM\Column(name="description_tag", type="string", length=160, nullable=true) |
|
46 | - */ |
|
47 | - private $descriptionTag; |
|
48 | - |
|
49 | - /** |
|
50 | - * @var string |
|
51 | - * |
|
52 | - * @ORM\Column(name="title", type="string", length=255, nullable=false) |
|
53 | - */ |
|
54 | - private $title; |
|
17 | + use CreatedUpdatedTrait; |
|
18 | + |
|
19 | + /** |
|
20 | + * @var integer |
|
21 | + * |
|
22 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
23 | + * @ORM\Id |
|
24 | + * @ORM\GeneratedValue(strategy="IDENTITY") |
|
25 | + */ |
|
26 | + private $id; |
|
27 | + |
|
28 | + /** |
|
29 | + * @var string |
|
30 | + * |
|
31 | + * @ORM\Column(name="guid", type="string", length=255, nullable=false) |
|
32 | + */ |
|
33 | + private $guid; |
|
34 | + |
|
35 | + /** |
|
36 | + * @var string |
|
37 | + * |
|
38 | + * @ORM\Column(name="title_tag", type="string", length=70, nullable=true) |
|
39 | + */ |
|
40 | + private $titleTag; |
|
41 | + |
|
42 | + /** |
|
43 | + * @var string |
|
44 | + * |
|
45 | + * @ORM\Column(name="description_tag", type="string", length=160, nullable=true) |
|
46 | + */ |
|
47 | + private $descriptionTag; |
|
48 | + |
|
49 | + /** |
|
50 | + * @var string |
|
51 | + * |
|
52 | + * @ORM\Column(name="title", type="string", length=255, nullable=false) |
|
53 | + */ |
|
54 | + private $title; |
|
55 | 55 | |
56 | 56 | /** |
57 | 57 | * @var string |
58 | 58 | * |
59 | 59 | * @ORM\Column(name="template", type="string", length=255, nullable=false) |
60 | 60 | */ |
61 | - private $template; |
|
61 | + private $template; |
|
62 | 62 | |
63 | 63 | /** |
64 | 64 | * @var string |
@@ -67,123 +67,123 @@ discard block |
||
67 | 67 | */ |
68 | 68 | private $url; |
69 | 69 | |
70 | - /** |
|
71 | - * @var string |
|
72 | - * |
|
73 | - * @ORM\Column(name="content", type="text", nullable=true) |
|
74 | - */ |
|
75 | - private $content; |
|
76 | - |
|
77 | - /** |
|
78 | - * @var integer |
|
79 | - * |
|
80 | - * @ORM\Column(name="active", type="integer", nullable=false) |
|
81 | - */ |
|
82 | - private $active; |
|
83 | - |
|
84 | - /** |
|
85 | - * @var integer |
|
86 | - * |
|
87 | - * @ORM\Column(name="order", type="integer", nullable=false) |
|
88 | - */ |
|
89 | - private $order; |
|
90 | - |
|
91 | - /** |
|
92 | - * @var integer |
|
93 | - * |
|
94 | - * @ORM\Column(name="displayed", type="integer", nullable=false) |
|
95 | - */ |
|
96 | - private $displayed; |
|
97 | - |
|
98 | - /** |
|
99 | - * @var \Page |
|
100 | - * |
|
101 | - * @ORM\ManyToOne(targetEntity="Page") |
|
102 | - * @ORM\JoinColumns({ |
|
103 | - * @ORM\JoinColumn(name="parent", referencedColumnName="id") |
|
104 | - * }) |
|
105 | - */ |
|
106 | - private $parent; |
|
107 | - |
|
108 | - /** |
|
109 | - * @return int |
|
110 | - */ |
|
111 | - public function getId() |
|
112 | - { |
|
113 | - return $this->id; |
|
114 | - } |
|
115 | - |
|
116 | - /** |
|
117 | - * @param int $id |
|
118 | - */ |
|
119 | - public function setId($id) |
|
120 | - { |
|
121 | - $this->id = $id; |
|
122 | - } |
|
123 | - |
|
124 | - /** |
|
125 | - * @return string |
|
126 | - */ |
|
127 | - public function getGuid() |
|
128 | - { |
|
129 | - return $this->guid; |
|
130 | - } |
|
131 | - |
|
132 | - /** |
|
133 | - * @param string $guid |
|
134 | - */ |
|
135 | - public function setGuid($guid) |
|
136 | - { |
|
137 | - $this->guid = $guid; |
|
138 | - } |
|
139 | - |
|
140 | - /** |
|
141 | - * @return string |
|
142 | - */ |
|
143 | - public function getTitleTag() |
|
144 | - { |
|
145 | - return $this->titleTag; |
|
146 | - } |
|
147 | - |
|
148 | - /** |
|
149 | - * @param string $titleTag |
|
150 | - */ |
|
151 | - public function setTitleTag($titleTag) |
|
152 | - { |
|
153 | - $this->titleTag = $titleTag; |
|
154 | - } |
|
155 | - |
|
156 | - /** |
|
157 | - * @return string |
|
158 | - */ |
|
159 | - public function getDescriptionTag() |
|
160 | - { |
|
161 | - return $this->descriptionTag; |
|
162 | - } |
|
163 | - |
|
164 | - /** |
|
165 | - * @param string $descriptionTag |
|
166 | - */ |
|
167 | - public function setDescriptionTag($descriptionTag) |
|
168 | - { |
|
169 | - $this->descriptionTag = $descriptionTag; |
|
170 | - } |
|
171 | - |
|
172 | - /** |
|
173 | - * @return string |
|
174 | - */ |
|
175 | - public function getTitle() |
|
176 | - { |
|
177 | - return $this->title; |
|
178 | - } |
|
179 | - |
|
180 | - /** |
|
181 | - * @param string $title |
|
182 | - */ |
|
183 | - public function setTitle($title) |
|
184 | - { |
|
185 | - $this->title = $title; |
|
186 | - } |
|
70 | + /** |
|
71 | + * @var string |
|
72 | + * |
|
73 | + * @ORM\Column(name="content", type="text", nullable=true) |
|
74 | + */ |
|
75 | + private $content; |
|
76 | + |
|
77 | + /** |
|
78 | + * @var integer |
|
79 | + * |
|
80 | + * @ORM\Column(name="active", type="integer", nullable=false) |
|
81 | + */ |
|
82 | + private $active; |
|
83 | + |
|
84 | + /** |
|
85 | + * @var integer |
|
86 | + * |
|
87 | + * @ORM\Column(name="order", type="integer", nullable=false) |
|
88 | + */ |
|
89 | + private $order; |
|
90 | + |
|
91 | + /** |
|
92 | + * @var integer |
|
93 | + * |
|
94 | + * @ORM\Column(name="displayed", type="integer", nullable=false) |
|
95 | + */ |
|
96 | + private $displayed; |
|
97 | + |
|
98 | + /** |
|
99 | + * @var \Page |
|
100 | + * |
|
101 | + * @ORM\ManyToOne(targetEntity="Page") |
|
102 | + * @ORM\JoinColumns({ |
|
103 | + * @ORM\JoinColumn(name="parent", referencedColumnName="id") |
|
104 | + * }) |
|
105 | + */ |
|
106 | + private $parent; |
|
107 | + |
|
108 | + /** |
|
109 | + * @return int |
|
110 | + */ |
|
111 | + public function getId() |
|
112 | + { |
|
113 | + return $this->id; |
|
114 | + } |
|
115 | + |
|
116 | + /** |
|
117 | + * @param int $id |
|
118 | + */ |
|
119 | + public function setId($id) |
|
120 | + { |
|
121 | + $this->id = $id; |
|
122 | + } |
|
123 | + |
|
124 | + /** |
|
125 | + * @return string |
|
126 | + */ |
|
127 | + public function getGuid() |
|
128 | + { |
|
129 | + return $this->guid; |
|
130 | + } |
|
131 | + |
|
132 | + /** |
|
133 | + * @param string $guid |
|
134 | + */ |
|
135 | + public function setGuid($guid) |
|
136 | + { |
|
137 | + $this->guid = $guid; |
|
138 | + } |
|
139 | + |
|
140 | + /** |
|
141 | + * @return string |
|
142 | + */ |
|
143 | + public function getTitleTag() |
|
144 | + { |
|
145 | + return $this->titleTag; |
|
146 | + } |
|
147 | + |
|
148 | + /** |
|
149 | + * @param string $titleTag |
|
150 | + */ |
|
151 | + public function setTitleTag($titleTag) |
|
152 | + { |
|
153 | + $this->titleTag = $titleTag; |
|
154 | + } |
|
155 | + |
|
156 | + /** |
|
157 | + * @return string |
|
158 | + */ |
|
159 | + public function getDescriptionTag() |
|
160 | + { |
|
161 | + return $this->descriptionTag; |
|
162 | + } |
|
163 | + |
|
164 | + /** |
|
165 | + * @param string $descriptionTag |
|
166 | + */ |
|
167 | + public function setDescriptionTag($descriptionTag) |
|
168 | + { |
|
169 | + $this->descriptionTag = $descriptionTag; |
|
170 | + } |
|
171 | + |
|
172 | + /** |
|
173 | + * @return string |
|
174 | + */ |
|
175 | + public function getTitle() |
|
176 | + { |
|
177 | + return $this->title; |
|
178 | + } |
|
179 | + |
|
180 | + /** |
|
181 | + * @param string $title |
|
182 | + */ |
|
183 | + public function setTitle($title) |
|
184 | + { |
|
185 | + $this->title = $title; |
|
186 | + } |
|
187 | 187 | |
188 | 188 | /** |
189 | 189 | * @return string |
@@ -217,84 +217,84 @@ discard block |
||
217 | 217 | $this->url = $url; |
218 | 218 | } |
219 | 219 | |
220 | - /** |
|
221 | - * @return string |
|
222 | - */ |
|
223 | - public function getContent() |
|
224 | - { |
|
225 | - return $this->content; |
|
226 | - } |
|
227 | - |
|
228 | - /** |
|
229 | - * @param string $content |
|
230 | - */ |
|
231 | - public function setContent($content) |
|
232 | - { |
|
233 | - $this->content = $content; |
|
234 | - } |
|
235 | - |
|
236 | - /** |
|
237 | - * @return int |
|
238 | - */ |
|
239 | - public function getActive() |
|
240 | - { |
|
241 | - return $this->active; |
|
242 | - } |
|
243 | - |
|
244 | - /** |
|
245 | - * @param int $active |
|
246 | - */ |
|
247 | - public function setActive($active) |
|
248 | - { |
|
249 | - $this->active = $active; |
|
250 | - } |
|
251 | - |
|
252 | - /** |
|
253 | - * @return int |
|
254 | - */ |
|
255 | - public function getOrder() |
|
256 | - { |
|
257 | - return $this->order; |
|
258 | - } |
|
259 | - |
|
260 | - /** |
|
261 | - * @param int $order |
|
262 | - */ |
|
263 | - public function setOrder($order) |
|
264 | - { |
|
265 | - $this->order = $order; |
|
266 | - } |
|
267 | - |
|
268 | - /** |
|
269 | - * @return int |
|
270 | - */ |
|
271 | - public function getDisplayed() |
|
272 | - { |
|
273 | - return $this->displayed; |
|
274 | - } |
|
275 | - |
|
276 | - /** |
|
277 | - * @param int $displayed |
|
278 | - */ |
|
279 | - public function setDisplayed($displayed) |
|
280 | - { |
|
281 | - $this->displayed = $displayed; |
|
282 | - } |
|
283 | - |
|
284 | - /** |
|
285 | - * @return \Page |
|
286 | - */ |
|
287 | - public function getParent() |
|
288 | - { |
|
289 | - return $this->parent; |
|
290 | - } |
|
291 | - |
|
292 | - /** |
|
293 | - * @param \Page $parent |
|
294 | - */ |
|
295 | - public function setParent($parent) |
|
296 | - { |
|
297 | - $this->parent = $parent; |
|
298 | - } |
|
220 | + /** |
|
221 | + * @return string |
|
222 | + */ |
|
223 | + public function getContent() |
|
224 | + { |
|
225 | + return $this->content; |
|
226 | + } |
|
227 | + |
|
228 | + /** |
|
229 | + * @param string $content |
|
230 | + */ |
|
231 | + public function setContent($content) |
|
232 | + { |
|
233 | + $this->content = $content; |
|
234 | + } |
|
235 | + |
|
236 | + /** |
|
237 | + * @return int |
|
238 | + */ |
|
239 | + public function getActive() |
|
240 | + { |
|
241 | + return $this->active; |
|
242 | + } |
|
243 | + |
|
244 | + /** |
|
245 | + * @param int $active |
|
246 | + */ |
|
247 | + public function setActive($active) |
|
248 | + { |
|
249 | + $this->active = $active; |
|
250 | + } |
|
251 | + |
|
252 | + /** |
|
253 | + * @return int |
|
254 | + */ |
|
255 | + public function getOrder() |
|
256 | + { |
|
257 | + return $this->order; |
|
258 | + } |
|
259 | + |
|
260 | + /** |
|
261 | + * @param int $order |
|
262 | + */ |
|
263 | + public function setOrder($order) |
|
264 | + { |
|
265 | + $this->order = $order; |
|
266 | + } |
|
267 | + |
|
268 | + /** |
|
269 | + * @return int |
|
270 | + */ |
|
271 | + public function getDisplayed() |
|
272 | + { |
|
273 | + return $this->displayed; |
|
274 | + } |
|
275 | + |
|
276 | + /** |
|
277 | + * @param int $displayed |
|
278 | + */ |
|
279 | + public function setDisplayed($displayed) |
|
280 | + { |
|
281 | + $this->displayed = $displayed; |
|
282 | + } |
|
283 | + |
|
284 | + /** |
|
285 | + * @return \Page |
|
286 | + */ |
|
287 | + public function getParent() |
|
288 | + { |
|
289 | + return $this->parent; |
|
290 | + } |
|
291 | + |
|
292 | + /** |
|
293 | + * @param \Page $parent |
|
294 | + */ |
|
295 | + public function setParent($parent) |
|
296 | + { |
|
297 | + $this->parent = $parent; |
|
298 | + } |
|
299 | 299 | } |
300 | 300 |
@@ -6,91 +6,91 @@ |
||
6 | 6 | |
7 | 7 | trait CreatedUpdatedTrait |
8 | 8 | { |
9 | - /** |
|
10 | - * @ORM\Column(name="created_at", type="datetime", nullable=true) |
|
11 | - */ |
|
12 | - protected $created_at; |
|
9 | + /** |
|
10 | + * @ORM\Column(name="created_at", type="datetime", nullable=true) |
|
11 | + */ |
|
12 | + protected $created_at; |
|
13 | 13 | |
14 | - /** |
|
15 | - * @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\User") |
|
16 | - * @ORM\JoinColumn(name="created_by", referencedColumnName="id", nullable=false) |
|
17 | - */ |
|
18 | - protected $created_by; |
|
14 | + /** |
|
15 | + * @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\User") |
|
16 | + * @ORM\JoinColumn(name="created_by", referencedColumnName="id", nullable=false) |
|
17 | + */ |
|
18 | + protected $created_by; |
|
19 | 19 | |
20 | - /** |
|
21 | - * @ORM\Column(name="updated_at", type="datetime", nullable=true) |
|
22 | - */ |
|
23 | - protected $updated_at; |
|
20 | + /** |
|
21 | + * @ORM\Column(name="updated_at", type="datetime", nullable=true) |
|
22 | + */ |
|
23 | + protected $updated_at; |
|
24 | 24 | |
25 | - /** |
|
26 | - * @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\User") |
|
27 | - * @ORM\JoinColumn(name="updated_by", referencedColumnName="id", nullable=false) |
|
28 | - */ |
|
29 | - protected $updated_by; |
|
25 | + /** |
|
26 | + * @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\User") |
|
27 | + * @ORM\JoinColumn(name="updated_by", referencedColumnName="id", nullable=false) |
|
28 | + */ |
|
29 | + protected $updated_by; |
|
30 | 30 | |
31 | - /** |
|
32 | - * @return mixed |
|
33 | - */ |
|
34 | - public function getCreatedAt() |
|
35 | - { |
|
36 | - return $this->created_at; |
|
37 | - } |
|
31 | + /** |
|
32 | + * @return mixed |
|
33 | + */ |
|
34 | + public function getCreatedAt() |
|
35 | + { |
|
36 | + return $this->created_at; |
|
37 | + } |
|
38 | 38 | |
39 | - /** |
|
40 | - * @param mixed $created_at |
|
41 | - */ |
|
42 | - public function setCreatedAt($created_at) |
|
43 | - { |
|
44 | - $this->created_at = $created_at; |
|
45 | - } |
|
39 | + /** |
|
40 | + * @param mixed $created_at |
|
41 | + */ |
|
42 | + public function setCreatedAt($created_at) |
|
43 | + { |
|
44 | + $this->created_at = $created_at; |
|
45 | + } |
|
46 | 46 | |
47 | - /** |
|
48 | - * @return mixed |
|
49 | - */ |
|
50 | - public function getCreatedBy() |
|
51 | - { |
|
52 | - return $this->created_by; |
|
53 | - } |
|
47 | + /** |
|
48 | + * @return mixed |
|
49 | + */ |
|
50 | + public function getCreatedBy() |
|
51 | + { |
|
52 | + return $this->created_by; |
|
53 | + } |
|
54 | 54 | |
55 | - /** |
|
56 | - * @ORM\PrePersist |
|
57 | - * @param mixed $created_by |
|
58 | - */ |
|
59 | - public function setCreatedBy($created_by) |
|
60 | - { |
|
61 | - $this->created_by = $created_by; |
|
62 | - } |
|
55 | + /** |
|
56 | + * @ORM\PrePersist |
|
57 | + * @param mixed $created_by |
|
58 | + */ |
|
59 | + public function setCreatedBy($created_by) |
|
60 | + { |
|
61 | + $this->created_by = $created_by; |
|
62 | + } |
|
63 | 63 | |
64 | - /** |
|
65 | - * @return mixed |
|
66 | - */ |
|
67 | - public function getUpdatedAt() |
|
68 | - { |
|
69 | - return $this->updated_at; |
|
70 | - } |
|
64 | + /** |
|
65 | + * @return mixed |
|
66 | + */ |
|
67 | + public function getUpdatedAt() |
|
68 | + { |
|
69 | + return $this->updated_at; |
|
70 | + } |
|
71 | 71 | |
72 | - /** |
|
73 | - * @param mixed $updated_at |
|
74 | - */ |
|
75 | - public function setUpdatedAt($updated_at) |
|
76 | - { |
|
77 | - $this->updated_at = $updated_at; |
|
78 | - } |
|
72 | + /** |
|
73 | + * @param mixed $updated_at |
|
74 | + */ |
|
75 | + public function setUpdatedAt($updated_at) |
|
76 | + { |
|
77 | + $this->updated_at = $updated_at; |
|
78 | + } |
|
79 | 79 | |
80 | - /** |
|
81 | - * @return mixed |
|
82 | - */ |
|
83 | - public function getUpdatedBy() |
|
84 | - { |
|
85 | - return $this->updated_by; |
|
86 | - } |
|
80 | + /** |
|
81 | + * @return mixed |
|
82 | + */ |
|
83 | + public function getUpdatedBy() |
|
84 | + { |
|
85 | + return $this->updated_by; |
|
86 | + } |
|
87 | 87 | |
88 | - /** |
|
89 | - * @ORM\PreUpdate |
|
90 | - * @param mixed $updated_by |
|
91 | - */ |
|
92 | - public function setUpdatedBy($updated_by) |
|
93 | - { |
|
94 | - $this->updated_by = $updated_by; |
|
95 | - } |
|
88 | + /** |
|
89 | + * @ORM\PreUpdate |
|
90 | + * @param mixed $updated_by |
|
91 | + */ |
|
92 | + public function setUpdatedBy($updated_by) |
|
93 | + { |
|
94 | + $this->updated_by = $updated_by; |
|
95 | + } |
|
96 | 96 | } |
@@ -14,23 +14,23 @@ discard block |
||
14 | 14 | */ |
15 | 15 | class User |
16 | 16 | { |
17 | - use CreatedUpdatedTrait; |
|
17 | + use CreatedUpdatedTrait; |
|
18 | 18 | |
19 | - /** |
|
20 | - * @var integer |
|
21 | - * |
|
22 | - * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
23 | - * @ORM\Id |
|
24 | - * @ORM\GeneratedValue(strategy="IDENTITY") |
|
25 | - */ |
|
26 | - private $id; |
|
19 | + /** |
|
20 | + * @var integer |
|
21 | + * |
|
22 | + * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) |
|
23 | + * @ORM\Id |
|
24 | + * @ORM\GeneratedValue(strategy="IDENTITY") |
|
25 | + */ |
|
26 | + private $id; |
|
27 | 27 | |
28 | - /** |
|
29 | - * @var string |
|
30 | - * |
|
31 | - * @ORM\Column(name="guid", type="string", length=255, nullable=false) |
|
32 | - */ |
|
33 | - private $guid; |
|
28 | + /** |
|
29 | + * @var string |
|
30 | + * |
|
31 | + * @ORM\Column(name="guid", type="string", length=255, nullable=false) |
|
32 | + */ |
|
33 | + private $guid; |
|
34 | 34 | |
35 | 35 | /** |
36 | 36 | * @var AccessRight |
@@ -38,63 +38,63 @@ discard block |
||
38 | 38 | * @ORM\ManyToOne(targetEntity="PiouPiou\RibsAdminBundle\Entity\AccessRight", inversedBy="users") |
39 | 39 | * @ORM\JoinColumn(name="id_access_right", referencedColumnName="id", nullable=true) |
40 | 40 | */ |
41 | - private $accessRightList; |
|
41 | + private $accessRightList; |
|
42 | 42 | |
43 | 43 | /** |
44 | 44 | * @var boolean |
45 | 45 | * |
46 | 46 | * @ORM\Column(name="admin", type="boolean", nullable=true, options={"default": false}) |
47 | 47 | */ |
48 | - private $admin; |
|
48 | + private $admin; |
|
49 | 49 | |
50 | - /** |
|
51 | - * @var string |
|
52 | - * |
|
53 | - * @ORM\Column(name="firstname", type="string", length=255, nullable=false) |
|
54 | - */ |
|
55 | - private $firstname; |
|
50 | + /** |
|
51 | + * @var string |
|
52 | + * |
|
53 | + * @ORM\Column(name="firstname", type="string", length=255, nullable=false) |
|
54 | + */ |
|
55 | + private $firstname; |
|
56 | 56 | |
57 | - /** |
|
58 | - * @var string |
|
59 | - * |
|
60 | - * @ORM\Column(name="lastname", type="string", length=255, nullable=false) |
|
61 | - */ |
|
62 | - private $lastname; |
|
57 | + /** |
|
58 | + * @var string |
|
59 | + * |
|
60 | + * @ORM\Column(name="lastname", type="string", length=255, nullable=false) |
|
61 | + */ |
|
62 | + private $lastname; |
|
63 | 63 | |
64 | - /** |
|
65 | - * @var string |
|
66 | - * |
|
67 | - * @ORM\Column(name="adress", type="string", length=255, nullable=true) |
|
68 | - */ |
|
69 | - private $adress; |
|
64 | + /** |
|
65 | + * @var string |
|
66 | + * |
|
67 | + * @ORM\Column(name="adress", type="string", length=255, nullable=true) |
|
68 | + */ |
|
69 | + private $adress; |
|
70 | 70 | |
71 | - /** |
|
72 | - * @var string |
|
73 | - * |
|
74 | - * @ORM\Column(name="postal_code", type="string", length=100, nullable=true) |
|
75 | - */ |
|
76 | - private $postalCode; |
|
71 | + /** |
|
72 | + * @var string |
|
73 | + * |
|
74 | + * @ORM\Column(name="postal_code", type="string", length=100, nullable=true) |
|
75 | + */ |
|
76 | + private $postalCode; |
|
77 | 77 | |
78 | - /** |
|
79 | - * @var string |
|
80 | - * |
|
81 | - * @ORM\Column(name="country", type="string", length=100, nullable=true) |
|
82 | - */ |
|
83 | - private $country; |
|
78 | + /** |
|
79 | + * @var string |
|
80 | + * |
|
81 | + * @ORM\Column(name="country", type="string", length=100, nullable=true) |
|
82 | + */ |
|
83 | + private $country; |
|
84 | 84 | |
85 | - /** |
|
86 | - * @var string |
|
87 | - * |
|
88 | - * @ORM\Column(name="state", type="string", length=255, nullable=true) |
|
89 | - */ |
|
90 | - private $state; |
|
85 | + /** |
|
86 | + * @var string |
|
87 | + * |
|
88 | + * @ORM\Column(name="state", type="string", length=255, nullable=true) |
|
89 | + */ |
|
90 | + private $state; |
|
91 | 91 | |
92 | - /** |
|
93 | - * @var string |
|
94 | - * |
|
95 | - * @ORM\Column(name="access_rights", type="text", nullable=true) |
|
96 | - */ |
|
97 | - private $accessRights; |
|
92 | + /** |
|
93 | + * @var string |
|
94 | + * |
|
95 | + * @ORM\Column(name="access_rights", type="text", nullable=true) |
|
96 | + */ |
|
97 | + private $accessRights; |
|
98 | 98 | |
99 | 99 | /** |
100 | 100 | * @var boolean |
@@ -103,37 +103,37 @@ discard block |
||
103 | 103 | */ |
104 | 104 | private $archived = false; |
105 | 105 | |
106 | - /** |
|
107 | - * @return int |
|
108 | - */ |
|
109 | - public function getId() |
|
110 | - { |
|
111 | - return $this->id; |
|
112 | - } |
|
106 | + /** |
|
107 | + * @return int |
|
108 | + */ |
|
109 | + public function getId() |
|
110 | + { |
|
111 | + return $this->id; |
|
112 | + } |
|
113 | 113 | |
114 | - /** |
|
115 | - * @param int $id |
|
116 | - */ |
|
117 | - public function setId($id) |
|
118 | - { |
|
119 | - $this->id = $id; |
|
120 | - } |
|
114 | + /** |
|
115 | + * @param int $id |
|
116 | + */ |
|
117 | + public function setId($id) |
|
118 | + { |
|
119 | + $this->id = $id; |
|
120 | + } |
|
121 | 121 | |
122 | - /** |
|
123 | - * @return string |
|
124 | - */ |
|
125 | - public function getGuid() |
|
126 | - { |
|
127 | - return $this->guid; |
|
128 | - } |
|
122 | + /** |
|
123 | + * @return string |
|
124 | + */ |
|
125 | + public function getGuid() |
|
126 | + { |
|
127 | + return $this->guid; |
|
128 | + } |
|
129 | 129 | |
130 | - /** |
|
131 | - * @param string $guid |
|
132 | - */ |
|
133 | - public function setGuid($guid) |
|
134 | - { |
|
135 | - $this->guid = $guid; |
|
136 | - } |
|
130 | + /** |
|
131 | + * @param string $guid |
|
132 | + */ |
|
133 | + public function setGuid($guid) |
|
134 | + { |
|
135 | + $this->guid = $guid; |
|
136 | + } |
|
137 | 137 | |
138 | 138 | /** |
139 | 139 | * @return AccessRight |
@@ -167,117 +167,117 @@ discard block |
||
167 | 167 | $this->admin = $admin; |
168 | 168 | } |
169 | 169 | |
170 | - /** |
|
171 | - * @return string |
|
172 | - */ |
|
173 | - public function getFirstname() |
|
174 | - { |
|
175 | - return $this->firstname; |
|
176 | - } |
|
170 | + /** |
|
171 | + * @return string |
|
172 | + */ |
|
173 | + public function getFirstname() |
|
174 | + { |
|
175 | + return $this->firstname; |
|
176 | + } |
|
177 | 177 | |
178 | - /** |
|
179 | - * @param string $firstname |
|
180 | - */ |
|
181 | - public function setFirstname($firstname) |
|
182 | - { |
|
183 | - $this->firstname = $firstname; |
|
184 | - } |
|
178 | + /** |
|
179 | + * @param string $firstname |
|
180 | + */ |
|
181 | + public function setFirstname($firstname) |
|
182 | + { |
|
183 | + $this->firstname = $firstname; |
|
184 | + } |
|
185 | 185 | |
186 | - /** |
|
187 | - * @return string |
|
188 | - */ |
|
189 | - public function getLastname() |
|
190 | - { |
|
191 | - return $this->lastname; |
|
192 | - } |
|
186 | + /** |
|
187 | + * @return string |
|
188 | + */ |
|
189 | + public function getLastname() |
|
190 | + { |
|
191 | + return $this->lastname; |
|
192 | + } |
|
193 | 193 | |
194 | - /** |
|
195 | - * @param string $lastname |
|
196 | - */ |
|
197 | - public function setLastname($lastname) |
|
198 | - { |
|
199 | - $this->lastname = $lastname; |
|
200 | - } |
|
194 | + /** |
|
195 | + * @param string $lastname |
|
196 | + */ |
|
197 | + public function setLastname($lastname) |
|
198 | + { |
|
199 | + $this->lastname = $lastname; |
|
200 | + } |
|
201 | 201 | |
202 | - /** |
|
203 | - * @return string |
|
204 | - */ |
|
205 | - public function getAdress() |
|
206 | - { |
|
207 | - return $this->adress; |
|
208 | - } |
|
202 | + /** |
|
203 | + * @return string |
|
204 | + */ |
|
205 | + public function getAdress() |
|
206 | + { |
|
207 | + return $this->adress; |
|
208 | + } |
|
209 | 209 | |
210 | - /** |
|
211 | - * @param string $adress |
|
212 | - */ |
|
213 | - public function setAdress($adress) |
|
214 | - { |
|
215 | - $this->adress = $adress; |
|
216 | - } |
|
210 | + /** |
|
211 | + * @param string $adress |
|
212 | + */ |
|
213 | + public function setAdress($adress) |
|
214 | + { |
|
215 | + $this->adress = $adress; |
|
216 | + } |
|
217 | 217 | |
218 | - /** |
|
219 | - * @return string |
|
220 | - */ |
|
221 | - public function getPostalCode() |
|
222 | - { |
|
223 | - return $this->postalCode; |
|
224 | - } |
|
218 | + /** |
|
219 | + * @return string |
|
220 | + */ |
|
221 | + public function getPostalCode() |
|
222 | + { |
|
223 | + return $this->postalCode; |
|
224 | + } |
|
225 | 225 | |
226 | - /** |
|
227 | - * @param string $postalCode |
|
228 | - */ |
|
229 | - public function setPostalCode($postalCode) |
|
230 | - { |
|
231 | - $this->postalCode = $postalCode; |
|
232 | - } |
|
226 | + /** |
|
227 | + * @param string $postalCode |
|
228 | + */ |
|
229 | + public function setPostalCode($postalCode) |
|
230 | + { |
|
231 | + $this->postalCode = $postalCode; |
|
232 | + } |
|
233 | 233 | |
234 | - /** |
|
235 | - * @return string |
|
236 | - */ |
|
237 | - public function getCountry() |
|
238 | - { |
|
239 | - return $this->country; |
|
240 | - } |
|
234 | + /** |
|
235 | + * @return string |
|
236 | + */ |
|
237 | + public function getCountry() |
|
238 | + { |
|
239 | + return $this->country; |
|
240 | + } |
|
241 | 241 | |
242 | - /** |
|
243 | - * @param string $country |
|
244 | - */ |
|
245 | - public function setCountry($country) |
|
246 | - { |
|
247 | - $this->country = $country; |
|
248 | - } |
|
242 | + /** |
|
243 | + * @param string $country |
|
244 | + */ |
|
245 | + public function setCountry($country) |
|
246 | + { |
|
247 | + $this->country = $country; |
|
248 | + } |
|
249 | 249 | |
250 | - /** |
|
251 | - * @return string |
|
252 | - */ |
|
253 | - public function getState() |
|
254 | - { |
|
255 | - return $this->state; |
|
256 | - } |
|
250 | + /** |
|
251 | + * @return string |
|
252 | + */ |
|
253 | + public function getState() |
|
254 | + { |
|
255 | + return $this->state; |
|
256 | + } |
|
257 | 257 | |
258 | - /** |
|
259 | - * @param string $state |
|
260 | - */ |
|
261 | - public function setState($state) |
|
262 | - { |
|
263 | - $this->state = $state; |
|
264 | - } |
|
258 | + /** |
|
259 | + * @param string $state |
|
260 | + */ |
|
261 | + public function setState($state) |
|
262 | + { |
|
263 | + $this->state = $state; |
|
264 | + } |
|
265 | 265 | |
266 | - /** |
|
267 | - * @return string |
|
268 | - */ |
|
269 | - public function getAccessRights() |
|
270 | - { |
|
271 | - return $this->accessRights; |
|
272 | - } |
|
266 | + /** |
|
267 | + * @return string |
|
268 | + */ |
|
269 | + public function getAccessRights() |
|
270 | + { |
|
271 | + return $this->accessRights; |
|
272 | + } |
|
273 | 273 | |
274 | - /** |
|
275 | - * @param string $accessRights |
|
276 | - */ |
|
277 | - public function setAccessRights($accessRights) |
|
278 | - { |
|
279 | - $this->accessRights = $accessRights; |
|
280 | - } |
|
274 | + /** |
|
275 | + * @param string $accessRights |
|
276 | + */ |
|
277 | + public function setAccessRights($accessRights) |
|
278 | + { |
|
279 | + $this->accessRights = $accessRights; |
|
280 | + } |
|
281 | 281 | |
282 | 282 | /** |
283 | 283 | * @return boolean |
@@ -14,7 +14,7 @@ |
||
14 | 14 | */ |
15 | 15 | class Navigation |
16 | 16 | { |
17 | - use CreatedUpdatedTrait; |
|
17 | + use CreatedUpdatedTrait; |
|
18 | 18 | |
19 | 19 | /** |
20 | 20 | * @var integer |