# |
Mar 6th 2018, 14:17 |
neon1024 |
Afternoon everyone |
# |
Mar 6th 2018, 12:54 |
savant |
night all |
# |
Mar 6th 2018, 12:46 |
makallio85 |
Thanks for your time! Clarified things for me. |
# |
Mar 6th 2018, 12:46 |
makallio85 |
Okay. Now I get it. |
# |
Mar 6th 2018, 12:46 |
savant |
I think thats an anti-pattern |
# |
Mar 6th 2018, 12:46 |
savant |
I dont like querying the database from within the entity |
# |
Mar 6th 2018, 12:44 |
makallio85 |
Do we mean here by "virtual value", something that does lazyloading or something that processes some other data that entity already has? And that should be considered as antipattern? |
# |
Mar 6th 2018, 12:43 |
makallio85 |
Cool. So if i add method getPhoneNumber() to contact that iterates just what entity already holds we are all good here. I just got little bit confused of virtual value => anti pattern thoughts you said. |
# |
Mar 6th 2018, 12:41 |
savant |
accessing data you have access to already - and throwing exceptions when its missing - is good |
# |
Mar 6th 2018, 12:41 |
savant |
querying from the method is bad |
# |
Mar 6th 2018, 12:41 |
makallio85 |
Aaa okay. So you mean, i can have public method in entity, but virtual value is bad pattern? |
# |
Mar 6th 2018, 12:40 |
ghoritrilochan |
link: http://shreehariji.com |
# |
Mar 6th 2018, 12:40 |
ghoritrilochan |
my new project in not found css,js,img or other page link? |
# |
Mar 6th 2018, 12:40 |
savant |
add a method to your Contact entity that does those “iterations” for you |
# |
Mar 6th 2018, 12:40 |
makallio85 |
So if I want to provide "easy" access to phone number without virtual value and without iterations or conditions on calling side, i should do... eeh what? :) |
# |
Mar 6th 2018, 12:39 |
makallio85 |
Yes |
# |
Mar 6th 2018, 12:39 |
savant |
no extra querying |
# |
Mar 6th 2018, 12:39 |
savant |
so your Contact entities have access to those |
# |
Mar 6th 2018, 12:39 |
makallio85 |
Yes |
# |
Mar 6th 2018, 12:39 |
savant |
CommunicationDetails already has the phone number, right? |
# |
Mar 6th 2018, 12:38 |
savant |
@makallio85 nope |
# |
Mar 6th 2018, 12:38 |
makallio85 |
@savant https://gist.github.com/makallio85/6fc0e11ef52ab2eaa122bd24c58f6cc9 |
# |
Mar 6th 2018, 12:36 |
nisseni |
savant: will try that. :) |
# |
Mar 6th 2018, 12:35 |
savant |
that way you can use debug_kit :) |
# |
Mar 6th 2018, 12:35 |
savant |
just make a dummy page that executes that |
# |
Mar 6th 2018, 12:35 |
nisseni |
savant: yeah, me too, but this is a query made from AJAX. |
# |
Mar 6th 2018, 12:35 |
savant |
but also never use fetchAll() so I can’t really help. Sorry :( |
# |
Mar 6th 2018, 12:35 |
savant |
nisseni: I normally view that in debug_kit |
# |
Mar 6th 2018, 12:34 |
nisseni |
savant: I've tried to figure that out via $db->getLog() - but I can only see the expression made from cakephp where the "?" haven't been replaced with the terms. |
# |
Mar 6th 2018, 12:33 |
savant |
nisseni: is the query executed the one you expect to execute? |
# |
Mar 6th 2018, 12:33 |
nisseni |
I have a problem with fetchAll in Cakephp 2.x - https://gist.github.com/anonymous/d4b9090196ac780d4cb83700e0433469 - I'm getting an empty result from the fetchAll try, but the very same thing as a regular mysql query works fine. Am I missing something? |
# |
Mar 6th 2018, 12:33 |
makallio85 |
@savang Let me post link that holds an example |
# |
Mar 6th 2018, 12:32 |
savant |
@portilloster no, we’re not a css framework, so the css we include is very generic |
# |
Mar 6th 2018, 12:32 |
savant |
im not doing anything magic there. explicit vs implicit. |
# |
Mar 6th 2018, 12:32 |
savant |
@makallio85 it cannot. Use contain(). |
# |
Mar 6th 2018, 12:32 |
makallio85 |
There is definetely some catch i cant get now :) |
# |
Mar 6th 2018, 12:32 |
portilloster |
@savant I thought cakephp has some predifined css for this cases! |
# |
Mar 6th 2018, 12:31 |
makallio85 |
@savant But how can this data be accessed when I query for example 1 entity from contact table without doing anything extra when querying? Or it cannot? |
# |
Mar 6th 2018, 12:28 |
savant |
@portilloster https://codepen.io/alexandredees/pen/ojaFr |
# |
Mar 6th 2018, 12:28 |
savant |
@portilloster use css :slightly_smiling_face: |
# |
Mar 6th 2018, 12:28 |
portilloster |
Guys, any idea about resizing divs for my login div that is almost as wide as the screen? <div class="users form"> <fieldset> <legend> <?php echo __('Please enter your username and password'); ?> </legend> <?= $this->Form->create() ?> <?= $this->Form->control('email') ?> <?= $this->Form->control('password') ?> <?= $this->Form->button('Login') ?> <?= $this->Form->end() ?> </fieldset> </div> |