Log message #3893144

# At Username Text
# Jun 13th 2016, 10:50 kitcat711 c'est bien cela?
# Jun 13th 2016, 10:50 kitcat711 dans le Model et le Controller
# Jun 13th 2016, 10:50 kitcat711 use Cake\Event\Event;
# Jun 13th 2016, 10:49 kitcat711 use Cake\ORM\Entity;
# Jun 13th 2016, 10:49 kitcat711 donc si j'ai bien compris: je mets
# Jun 13th 2016, 10:47 kitcat711 pas find
# Jun 13th 2016, 10:47 kitcat711 s13: beforsave
# Jun 13th 2016, 10:45 Ch0c4 donc enfaite le set et get et le has sont pas obligatoire
# Jun 13th 2016, 10:44 Ch0c4 extends ArrayAccess
# Jun 13th 2016, 10:44 Ch0c4 oups désolé je n'avais pas vu ça
# Jun 13th 2016, 10:44 Ch0c4 j'invente rien
# Jun 13th 2016, 10:43 kitcat711 je lis
# Jun 13th 2016, 10:43 Ch0c4 http://api.cakephp.org/3.2/class-Cake.Datasource.EntityInterface.html
# Jun 13th 2016, 10:43 Ch0c4 et pour savoir si $entity a 'username' tu peux faire un $entity->has('username');
# Jun 13th 2016, 10:42 kitcat711 tain mais j'ai jamais fait cela dans mes beforesave et j'avaais aps de warning avant
# Jun 13th 2016, 10:41 Ch0c4 et pour le modifier c'est $entity->set('userName', $entity->get('email');
# Jun 13th 2016, 10:41 Ch0c4 ensuite pour répurer le userName c'est $entity->get('username');
# Jun 13th 2016, 10:41 Ch0c4 non tu laisse le second
# Jun 13th 2016, 10:41 kitcat711 c'est vraiment pas limpide pour moi
# Jun 13th 2016, 10:40 kitcat711 et je vire l'autre?
# Jun 13th 2016, 10:40 Ch0c4 use Cake\Datasource\EntityInterface;
# Jun 13th 2016, 10:40 kitcat711 use App\Model\Entity; devient use App\Model\EntityInterface; ?
# Jun 13th 2016, 10:39 kitcat711 oui c le but
# Jun 13th 2016, 10:38 Ch0c4 le beforeSave va faire des modif avant la sauvegarde en bdd
# Jun 13th 2016, 10:36 kitcat711 du coup pour corriger je dois changer quoi
# Jun 13th 2016, 10:36 kitcat711 ben si: en prod ca s'affiche mechamment a l'écran
# Jun 13th 2016, 10:36 kitcat711 c pas clair pour moi
# Jun 13th 2016, 10:36 Ch0c4 enfaite ça change rien mais bon
# Jun 13th 2016, 10:35 Ch0c4 Entity -> EntityInterface
# Jun 13th 2016, 10:34 kitcat711 et je trouve pas -20minutes que je changed es trucs et j'ai du mettre le souk
# Jun 13th 2016, 10:33 kitcat711 un souci d'entity passé dans un before save qui n'est aps du bon type
# Jun 13th 2016, 10:33 kitcat711 http://pastie.org/private/9wnw0odymq3ui7utpge5q
# Jun 13th 2016, 10:33 kitcat711 hello
# Jun 13th 2016, 10:31 Anju Je vous dis bon appétit ! A toute !
# Jun 13th 2016, 10:30 Anju Mince je dois aller manger
# Jun 13th 2016, 10:29 Anju Non non, ma faute, j'ai mal compris ta question. Il y a bien deux tables : type_environnements, et environnements
# Jun 13th 2016, 10:28 Ch0c4 car moi j'ai type, environnement et type_environnement
# Jun 13th 2016, 10:28 Anju Désolée
# Jun 13th 2016, 10:28 Anju Ah, ma faute, j'avais mal compris ta question
# Jun 13th 2016, 10:28 Ch0c4 euh on parle de 2 tables ou 3
# Jun 13th 2016, 10:27 Anju De la même façon qu'on aurait une table livres et une table auteurs. Un livre a un auteur