Log message #4201817

# At Username Text
# Sep 5th 2019, 13:41 g.catania As matter of fact, my foreach (working flawlessy before cache() introduction) throws: "Objects returned by Cake\ORM\Query::getIterator() must be traversable or implement interface Iterator"
# Sep 5th 2019, 13:40 g.catania Hi guys. I'm having an hard time figuring out why chaining ->cache() to my query, I can't iterate it. From docs I read "->cache() returns this, meaning a Cake\ORM\Query object".
# Sep 5th 2019, 13:39 david098 @colas.ruamps that isn't working either as clients are put multiple times in the resultset for every statement due... ->group(['Clients.id']) is also no solution as only 1 statement is left over in the resultset
# Sep 5th 2019, 13:34 alexdd55976 ok, see your point.
# Sep 5th 2019, 13:34 david098 @alexdd55976 I prefer to start from clients as i want to loop through the clients and send them an email with the request of missing statements for their contracts
# Sep 5th 2019, 13:27 colas.ruamps @david098 you could try to add `->matching('Contracts.Statements', function(....`
# Sep 5th 2019, 13:26 alexdd55976 @david098 this is my rough idea ``` $query = $this->Contracts->where(['Contracts.published'=>true]); }) ->contain('Contracts.Statements', function ($q) use ($date) { return $q ->where(['amount IS'=>NULL]) ->where(['Statements.periodend <=' => '2019-09-30']) ->order(['periodend'=>'ASC']); }) ->contain('Clients') ->order(['Clients.name'=>'ASC']); ```
# Sep 5th 2019, 13:25 neon1024 Is there a funky collection method which I could use to pick the highest value in an array of arrays?
# Sep 5th 2019, 13:23 david098 This my query at the moment, but it is returning all clients including contracts with no statements due
# Sep 5th 2019, 13:23 alexdd55976 the biggest factor seems to be contracts, so start here.. get all contracts.published, then get the statements and the clients
# Sep 5th 2019, 13:22 david098 `$query = $this->Statements->Contracts->Clients->find();` `$query` ` ->matching('Contracts', function ($q) {` ` return $q->where(['Contracts.published'=>true]);` ` })` ` ->contain('Contracts.Statements', function ($q) use ($date) {` ` return $q` ` ->where(['amount IS'=>NULL])` ` ->where(['Statements.periodend <=' => $date])` ` ->order(['periodend'=>'ASC']);` ` })` ` ->order(['Clients.name'=>'ASC']);`
# Sep 5th 2019, 13:21 alexdd55976 you could try (the obvious) to get over clients to contracts to statements.
# Sep 5th 2019, 13:21 alexdd55976 depenends from which side you comin.
# Sep 5th 2019, 13:15 slackebot will I end up doing loops and do "manual"checks?
# Sep 5th 2019, 13:15 david098 I got a querybuilder issue, I have clients who have many to many contracts what have many to many statements. I want to get all Clients with their active contracts (Contracts.published = 1) where there are statements due (Statements.periodend <= 2019-09-30). So if there is not an active contract or if there are no statements due under the contract i don't want to get the client in the resultset. Is this possible in 1 query(builder) or
# Sep 5th 2019, 13:04 leonardo.crecente actually print_r('Index'); exit;
# Sep 5th 2019, 13:03 leonardo.crecente in /httpdocs/blog/index.php I,ve put a print_r(); exit; to see if request gets there...
# Sep 5th 2019, 13:02 alexdd55976 ah.. ok.. its no subfolder shown for the cake
# Sep 5th 2019, 13:02 leonardo.crecente In any case the website url: http://www.savane.com.br and the blog url: http://www.savane.com.br/blog
# Sep 5th 2019, 12:08 spriz or at least play around with some of the existing rectors
# Sep 5th 2019, 12:09 dereuromark Once you are an expert please also contribute this to IdeHelper for better variable collection :)
# Sep 5th 2019, 12:16 ndm @val That can be achieved by setting the corresponding table class' table name so that it includes the database, like `$this->setTable('my_database.users')` instead of the default `$this->setTable('users')`.
# Sep 5th 2019, 13:01 alexdd55976 so it should be yourdomain.ltd/ and yourdomain.ltd/blog
# Sep 5th 2019, 12:59 leonardo.crecente but not success
# Sep 5th 2019, 12:59 leonardo.crecente I followed this stackoverflow post: https://stackoverflow.com/questions/55240956/wordpress-installed-in-cakephp-subfolder-on-iis-window-server
# Sep 5th 2019, 12:58 alexdd55976 should not be a problem
# Sep 5th 2019, 12:58 leonardo.crecente ON /httpdocs/app
# Sep 5th 2019, 12:58 alexdd55976 where is your cake app?
# Sep 5th 2019, 12:57 leonardo.crecente hey guys! I'm working on a cakephp 2.x project hosted on a windows/iis 7.5 server runnig php 7.0. The website is working perfectly but there is a wordpress installation inside /httpdocs/blog folder (I know this is not the right way to do it but unfotunately I can't change it). The question is: Is there a way to make wordpress work inside /blog folder on iis? On apache I know it is possibly.
# Sep 5th 2019, 12:53 val @admad what plugin do you refer to?
# Sep 5th 2019, 12:52 admad *could be
# Sep 5th 2019, 12:52 admad cakephp-utils could also be working just fine. Might just need updating usage of deprecated methods if at all
# Sep 5th 2019, 12:50 admad https://github.com/FriendsOfCake/awesome-cakephp#auditing--logging
# Sep 5th 2019, 12:50 admad widen your gaze instead of fixating on one plugin/repo
# Sep 5th 2019, 12:48 val @admad awesome links to cakephp-utils which seems to be dead
# Sep 5th 2019, 12:46 slackebot !tell bancer about awesome
# Sep 5th 2019, 12:46 slackebot Command sent from Slack by admad:
# Sep 5th 2019, 12:46 val Is there a better place to find WhoDidItBehavior for 3.x?
# Sep 5th 2019, 12:43 val https://github.com/cakemanager/cakephp-utils is that a dead project?
# Sep 5th 2019, 12:08 spriz Yeah, I think it's time to read up on AST properly
# Sep 5th 2019, 11:57 dereuromark Sounds like a custom rector script or in general custom regex Upgrade app command/task or sth :slightly_smiling_face: