# |
Apr 28th 2017, 14:41 |
jeremyharris |
they should though, e.g., if you contain(Sites) and it doesn’t actually bring in the data, it’s either a) not matching anything or b) the plugin’s finder is broken |
# |
Apr 28th 2017, 14:40 |
awi |
Well that means softdeletes dont work with contain |
# |
Apr 28th 2017, 14:39 |
jeremyharris |
that would make sense yes |
# |
Apr 28th 2017, 14:38 |
awi |
*within |
# |
Apr 28th 2017, 14:38 |
awi |
The construction is: $this->belongsTo('Sites', ['finder' => 'notRemoved']); which uses the finder of SitesTable mitchin a matching I guess? |
# |
Apr 28th 2017, 14:36 |
awi |
Well. I put this finder there (which is a finder checking for a softdelete which I think translates into a matching when I look at the query object) to exclude finding anything belonging to anything deleted. So when i do so, cake cant give me a normal $entity->relatedsubentity->field? |
# |
Apr 28th 2017, 14:34 |
jeremyharris |
you most certainly can use a finder in a table — that’s where they belong. not sure what you mean by “loose function of contain” though |
# |
Apr 28th 2017, 14:33 |
jeremyharris |
does that finder use matching? the point I’m getting at is that the query is likely using matching which adds the _matchingData property. contain will not do that, and if it does, a thousand apps have screamed out in agony |
# |
Apr 28th 2017, 14:33 |
awi |
so I cant use a finder in table or loose function of "contain"? |
# |
Apr 28th 2017, 14:32 |
awi |
jeremyharris well ist has from table innitialize wich uses a finder. |
# |
Apr 28th 2017, 14:31 |
dereuromark |
;) yeah the question is a bit too broad |
# |
Apr 28th 2017, 14:31 |
jeremyharris |
general answer: it’s necessary for any data you want to validate :slightly_smiling_face: |
# |
Apr 28th 2017, 14:30 |
julez |
a general question: is data validation necessary for all fields or just for fields which are generated by usercontent? |
# |
Apr 28th 2017, 14:24 |
awi |
let me see. |
# |
Apr 28th 2017, 14:23 |
jeremyharris |
do you have a `matching()` call in that query as well? |
# |
Apr 28th 2017, 14:16 |
awi |
is this intended to be this way? |
# |
Apr 28th 2017, 14:16 |
awi |
I ran into some problems with contain. somehow contain turns to a _matchingData by cake update vom 3.3 to 3.4 |
# |
Apr 28th 2017, 14:15 |
awi |
hi. |
# |
Apr 28th 2017, 13:34 |
cakephp051 |
hahaha |
# |
Apr 28th 2017, 13:34 |
jeremyharris |
cat across keyboard? |
# |
Apr 28th 2017, 13:34 |
grandfelix |
:,) |
# |
Apr 28th 2017, 13:33 |
grandfelix |
google translate |
# |
Apr 28th 2017, 13:33 |
dereuromark |
? |
# |
Apr 28th 2017, 13:32 |
cakephp051 |
gshsgrjsgjsgrklsgrxjksgrjkgrjrjp |
# |
Apr 28th 2017, 13:32 |
cakephp051 |
qfrakafekkagkgskgskgsbkegsjsgbkogsjkjgrwjpisrxf |
# |
Apr 28th 2017, 13:32 |
cakephp051 |
aefekaefejjkvefeskifeae |
# |
Apr 28th 2017, 13:32 |
cakephp051 |
bshjkafwhlfqehefe |
# |
Apr 28th 2017, 13:31 |
cakephp051 |
jisf;jsffl;jk;;h;hsfhsdghlisgd |
# |
Apr 28th 2017, 13:31 |
cakephp051 |
hi |
# |
Apr 28th 2017, 13:30 |
dereuromark |
Has anyone experiene/insights with http://alistair.cockburn.us/Hexagonal+architecture and (Cake)PHP? |
# |
Apr 28th 2017, 13:27 |
grandfelix |
@btx thanks. Will take a look |
# |
Apr 28th 2017, 13:02 |
btx |
just realized you’re selecting from the same table |
# |
Apr 28th 2017, 13:01 |
btx |
@grandfelix you could also do a contain, and in the contain, sort by created DESC and do limit 1 since technically you’re not selecting any of the related fields |
# |
Apr 28th 2017, 12:59 |
btx |
@grandfelix check out https://book.cakephp.org/3.0/en/orm/query-builder.html#using-sql-functions specifically scroll down (just past the list of functions ending with `dayOfWeek`) to the example about selecting concat with inner join. I think that will help |
# |
Apr 28th 2017, 12:57 |
iqu |
hmm. which one is better. create 2 foreign keys / belongsTo or virtual fields via Entity? |
# |
Apr 28th 2017, 12:50 |
admad |
->context()->entity()->getSource() is the right way |
# |
Apr 28th 2017, 12:49 |
rchavik |
list($junk, $model) = pluginSplit($modelSource); |
# |
Apr 28th 2017, 12:49 |
rchavik |
$modelSource = $this->Form->context()->entity()->getSource(); |
# |
Apr 28th 2017, 12:49 |
rchavik |
i hack it this way instead: |
# |
Apr 28th 2017, 12:49 |
rchavik |
i need to create a link on an element with model=Nodesandforeign_key=1, the value of model can change |
# |
Apr 28th 2017, 12:47 |
admad |
rchavik: what exactly are you trying to do? :slightly_smiling_face: |