Log message #4046354

# At Username Text
# Jun 29th 2017, 15:21 hmic daveozoalor: you can install cakephp as a dependency with composer in any non-cakephp project
# Jun 29th 2017, 15:21 cleptric There you go: https://github.com/cakephp/orm And don’t build a php framework. We already did that ;)
# Jun 29th 2017, 15:20 daveozoalor Thanks for that, sorry, I meant composer. I'm doing a project which requires me building a php framework, I have resorted to using Illuminate for ORM because I cant find one for CakePHP
# Jun 29th 2017, 15:14 cleptric @daveozoalor Right now, there is not a single shell package. We’re planning on doing that in the future, though :slightly_smiling_face: For example, you can use the ORM on it’s own. Also, normally you use composer for installing php stuff :slightly_smiling_face:
# Jun 29th 2017, 15:13 daveozoalor *there
# Jun 29th 2017, 15:12 daveozoalor How can I use only cake CLI features in the non-cakephp app I'm building? Are their cakephp packages I can install via npm and start using without having to install cakephp itself?
# Jun 29th 2017, 14:36 glanceded I see, ok, thanks for the tip and invite, maybe I can join the next's year fest.
# Jun 29th 2017, 14:35 neon1024 Check out the cakephp twitter feed, I think there are videos on there, but that’s just of the conference. You’ll have to attend the workshops next time :slightly_smiling_face:
# Jun 29th 2017, 14:34 glanceded @neon1024 I can't find anything about this year's fest. only 2016 amsterdam.
# Jun 29th 2017, 14:28 glanceded Sorry, my bad. You say about the this year event. Thanks for the tip
# Jun 29th 2017, 14:27 glanceded Thanks for the invite, I found it will be in 2018?
# Jun 29th 2017, 14:26 neon1024 @glanceded Cakefest this year there were some great examples of advanced routing in the workshops! ;)
# Jun 29th 2017, 13:42 glanceded I will after your advice, both solutions look realistic, even if I like the middleware one more, I will go with direct splitting in routes.php so I can make some tests
# Jun 29th 2017, 13:40 neon1024 No problem, hope you figure it out :slightly_smiling_face:
# Jun 29th 2017, 13:40 neon1024 https://github.com/cakephp/cakephp/blob/master/src/Routing/Middleware/RoutingMiddleware.php#L48
# Jun 29th 2017, 13:39 glanceded Wow, thanks a lot. Never thought about it. I will first try in my routes.php. If the request object isn't available, I will go with a middleware, since for now I don't have hundreds of routes. Thanks again for your time
# Jun 29th 2017, 13:38 neon1024 So it stands to reason that it should
# Jun 29th 2017, 13:38 neon1024 Well the routing needs to read the request to know where to route the request to right? ;)
# Jun 29th 2017, 13:37 glanceded even in routes.php?
# Jun 29th 2017, 13:37 glanceded the $this->request object is available global?
# Jun 29th 2017, 13:37 neon1024 Then if that didn’t work out, I might refactor and try with a middleware
# Jun 29th 2017, 13:37 neon1024 Personally I’d start by checking the request in the routing, if that’s possible, and building my routing around that
# Jun 29th 2017, 13:36 neon1024 Perhaps Middleware is too soon in the stack
# Jun 29th 2017, 13:35 neon1024 Although I think in your application, anywhere you have access to the request, you should be able to get the domain with `$this->request->getUri()`
# Jun 29th 2017, 13:35 neon1024 Well your Application.php has `->add(new RoutingMiddleware())` so you could pass the domain into the routing middleware perhaps, or roll your own, which then could pass the domain into the routing, perhaps as a parameter
# Jun 29th 2017, 13:31 glanceded Or how to load the correct set of rules?
# Jun 29th 2017, 13:31 glanceded @neon1024 Thanks for your answer. Yes, never thought at middlewares. So I create a middleware, I check the getHost() [domain]. But how to change the routes?
# Jun 29th 2017, 13:29 neon1024 @josexato Well I just check it `if (!empty($this->_properties['association']) {`
# Jun 29th 2017, 13:28 josexato @neon1024 thanks, I'll do some more tests because the child entity is contained when I serialize, can you please suggest me how can I check that the association exist or how can I recalculate again after query and before serialize?
# Jun 29th 2017, 13:28 neon1024 But if you’re using PSR7, the domain should be in the request, which you could use in your application
# Jun 29th 2017, 13:27 neon1024 @glanceded That sounds to me like it could be a good case for middleware
# Jun 29th 2017, 13:24 glanceded What I mean. Same application. Three different domains. Three different routes.
# Jun 29th 2017, 13:23 glanceded I need to make the routes depend on the domain. Is there a Cake way to achive this?
# Jun 29th 2017, 13:23 glanceded Hi guys. I'm facing a problem and I don't know how to manage it.
# Jun 29th 2017, 13:17 neon1024 @josexato Yes you can, but the associated entity will need to be contained when getting the parent entity, then you can access it as you would any other property in your virtual field method. You might want to check, inside the virtual property method, to ensure the association exists before you try and use it though, to prevent errors
# Jun 29th 2017, 13:15 josexato I'm using virtual variables now, but when I want to create a virtual variable based on a "sub-entity" attribute it say it null
# Jun 29th 2017, 13:14 josexato good morning, one question is it possible to get a virtual variable from an entity to do something like $article->authorname ?
# Jun 29th 2017, 12:58 jarard params were wrong :)
# Jun 29th 2017, 12:54 jarard and this beforeFind() must be an instance of Cake\ORM\Query :)
# Jun 29th 2017, 12:50 cake-novice Admad if you can also ans me.. :) please
# Jun 29th 2017, 12:50 cake-novice hmic, if you are aroun, can you ans " hmic, one thing i applied HABTM and can see raw mysql query . its like " ON (`LeadSalePersons`.`lead_id` IN (4228, 4229, 4230, 4231, 4232, 4233....and so on......) ; "