Log message #4055839

# At Username Text
# Jul 23rd 2017, 01:03 royalty https://gist.github.com/Modicrumb/6917d9aca6821f4c3cae9be3f5a6fec7
# Jul 23rd 2017, 01:03 royalty having a small problem with cake validation, just not sure how to validate an empty field of a related model
# Jul 23rd 2017, 01:02 royalty hello
# Jul 22nd 2017, 22:51 itamer answering my own questions, hopefully, the tutorial has the function still in Table. Just need to check up on the variables.
# Jul 22nd 2017, 22:48 slackebot membership record would have a function calculating when it ended and could be called when you create a person + membership or when you just created the membership. That info doesn't seem to belong in a Table but doesn't seem to belong in Entity either. Have I missed something?
# Jul 22nd 2017, 22:48 itamer v3 newbie question In earlier versions I could load up the model with dropdown lists and functions that could then be called by any controller that had access to the model which meant I could ensure that the same logic was being used throughout the website. We don't use salutations for a person, but lets say we did, it would mean that any controller that might use a person could be sure of having the right list of possible salutations. Or
# Jul 22nd 2017, 19:26 banna Second time it doesn't even go to logout action
# Jul 22nd 2017, 19:24 banna public function logout() { $this->Cookie->delete('remember_me'); $this->Auth->logout(); $this->redirect(array('plugin' => false, 'controller' => "users", 'action' => "login")); }
# Jul 22nd 2017, 19:23 banna You won't be able to logout second time.
# Jul 22nd 2017, 19:23 banna then logout and login - tjax78@gmail.com / test4321
# Jul 22nd 2017, 19:22 banna First login using - giannigame@tiscali.it / test1234
# Jul 22nd 2017, 19:21 banna To see the issue please visit the url - http://dev.casaparticulares.net/dashboard
# Jul 22nd 2017, 19:21 banna I am using cakephp 2.9, On the server i can't logout after logging in second time using two different account
# Jul 22nd 2017, 17:24 iblumbo because that's the real issue, class parameters has to be encapsulated in my assignment
# Jul 22nd 2017, 17:23 iblumbo but do you think that the way cake use the magic getters and setter can be considered encapsulation?
# Jul 22nd 2017, 17:21 iblumbo no, it's my first time with it hmic but now I've got what you've meant
# Jul 22nd 2017, 17:09 hmic you need to know still, most if not all of the cakephp functions accessing entites will not work if the properties are private. because they expect them beeing accessible of course...
# Jul 22nd 2017, 17:08 hmic just by creating your own entity base class and extending that instead of the cakephp one
# Jul 22nd 2017, 17:07 hmic you can make your entity classes use your own entity trait instead of the cakephp provided one easily.
# Jul 22nd 2017, 17:06 hmic iblumbo: have you worked with the magic getters and setter in php before? - if not, read the php manual about them, there are examples provided. you can just return NULL from a getter or raise an exception e.g. which basically makes the var private.
# Jul 22nd 2017, 17:05 iblumbo I checked the EntityTrait and I did see the _set method, but I've got stuck in where to override it and how make them look private :/
# Jul 22nd 2017, 16:56 hmic with the __get and __set approach, you can make them look private by default, easily
# Jul 22nd 2017, 16:56 hmic this said, it looks kind of feasable to make them private in cake - but - you would need to define all the classvars in this case, which is not required now.
# Jul 22nd 2017, 16:55 hmic check the php magic __get and __set methods, you will find information on google on how to utilize them to make class variables *look* private, as you implement getters and setters implicitely with utilizing them, you would not need not provide real getters and setters. but you can! this is the approach cakephp and the entity classes use btw! check the source!
# Jul 22nd 2017, 16:53 iblumbo I'll try to figure it out. thanks for the feedback hmic :)
# Jul 22nd 2017, 16:53 iblumbo yeah yeah I know its an overhead, it's just for one academic assignment haha
# Jul 22nd 2017, 16:44 hmic yeah, play things you can't on workdays
# Jul 22nd 2017, 16:43 birdy247 I am working with Guzzle
# Jul 22nd 2017, 16:43 birdy247 experimenting!
# Jul 22nd 2017, 16:43 birdy247 I like staurdays for this
# Jul 22nd 2017, 16:43 birdy247 :slightly_smiling_face:
# Jul 22nd 2017, 16:43 hmic birdy247: not working really, just in the office, playing with alexa and building a philips hue emulator gadget at the moment
# Jul 22nd 2017, 16:42 hmic entities are supposed to be as lightweight as possible (value objects). you do have getter/setters available though. you can overwrite whatever you want with specifying your own getter/setter methods technically making the properties private. but i dont see any use for that and it introduces lots of (unneccessary) additional overhead
# Jul 22nd 2017, 16:42 birdy247 saturday working?
# Jul 22nd 2017, 16:41 birdy247 Hey hmic
# Jul 22nd 2017, 16:41 hmic still: whats the reasoning?
# Jul 22nd 2017, 16:39 iblumbo Got it! Do you think there's a way to make every entity property private by default and create getter and setters to them in cake v3
# Jul 22nd 2017, 16:17 hmic you can add private methods and variables to an entity. they will not get persisted to the db or set though
# Jul 22nd 2017, 16:16 hmic iblumbo, whats the reasoning?
# Jul 22nd 2017, 16:09 iblumbo is it possible to encapsulate (make private) the properties from an Entity ?
# Jul 22nd 2017, 13:15 slackebot $name)); $conds['OR'][] = $concat;