Log message #3881347

# At Username Text
# May 27th 2016, 09:51 bernat1 I'm looking at core behaviors and I wondered if $this->_table was the correct way to use it in plugins. It seems so. Thanks.
# May 27th 2016, 09:51 fquffio bernat1: You might take a look at `TranslateBehavior`: it adds some associations on-the-fly to deal with translated fields (https://github.com/cakephp/cakephp/blob/master/src/ORM/Behavior/TranslateBehavior.php)
# May 27th 2016, 09:51 Neon1024x dariolap, I mean if you're against glob try this , http://book.cakephp.org/3.0/en/core-libraries/file-folder.html
# May 27th 2016, 09:51 dariolap Neon1024x, ok i use it! if there was a cakephp method, I would rather use it
# May 27th 2016, 09:51 TheMiller Hello! I want to start using migrations. Didn't used them before but played around a little. Now I want to make a diff and console says me: "Your migrations history is not in sync with your migrations files. Make sure all your migrations have been migrated before baking a diff." How can I clean the history?
# May 27th 2016, 09:50 Neon1024x dariolap, Why not just use glob()
# May 27th 2016, 09:50 bernat1 I'd like to configure the behavior as if I was creating a special kind of association.
# May 27th 2016, 09:50 Neon1024x I believe that the behaviour has $this->_table is the table it's attached to
# May 27th 2016, 09:50 dariolap in 3.x there is a function to simulate php glob ?
# May 27th 2016, 09:49 Neon1024x It's addAssociations() with an array of all the associtations, or you can just $table->belongsTo() as you would normall
# May 27th 2016, 09:49 Neon1024x Ah so yeah, my bad
# May 27th 2016, 09:49 Neon1024x https://github.com/cakephp/cakephp/blob/master/src/ORM/Table.php#L669-L707
# May 27th 2016, 09:48 bernat1 I want to create a behavior that eases saving some fields as hashes in another table.
# May 27th 2016, 09:47 Neon1024x bernat1, If you have the table then it's $table->addAssociation() I think
# May 27th 2016, 09:47 hmic !tell bernat1 about why
# May 27th 2016, 09:47 hmic bernat1, wrong approach likely?!
# May 27th 2016, 09:46 bernat1 how can I set associations inside a behavior?
# May 27th 2016, 09:11 birdy247 I am trying to use ->cache for a query object
# May 27th 2016, 09:00 unholyknight @hmic ended up needing to use beforeMarshal and the two behaviors I attached ran in the order I attached them in. Thanks for the recommendation on top of that though, if I get into a more complex situation in the future that looks like a great help.
# May 27th 2016, 09:00 dariolap thanks Neon1024x, i used Security::hash()
# May 27th 2016, 08:44 patsToms thanks
# May 27th 2016, 08:43 fquffio See: http://book.cakephp.org/3.0/en/core-libraries/validation.html#conditional-validation
# May 27th 2016, 08:43 fquffio patsToms: i'm not sure I have understood what you need, but if you need at least one of them to be filled, you could use conditional validation rules: add `notEmpty` rule to each field with a conditional check that returns `true` iff (= if and only if) the other two are empty.
# May 27th 2016, 08:36 patsToms is there any way how to require of the fields with validator? For example I have three fields - I want to one of the filled.
# May 27th 2016, 08:32 Neon1024x Although I'm not sure it'll take a file, you might need to base64() the file or something so you can get a string
# May 27th 2016, 08:32 Neon1024x dariolap, Did you try hash() ?
# May 27th 2016, 08:31 dariolap In 3.x there is a function to get hash of file?
# May 27th 2016, 08:25 Neon1024x Isn't that just an index constraint in the db schema?
# May 27th 2016, 08:22 ionas how can I make a constraint where unique (name, parent_id) would fail in case of a name: foo, parent_id: null being inserted twice?
# May 27th 2016, 08:18 birdy247 lol
# May 27th 2016, 08:17 neon1024 You're a triathelete, get yerself into the Thames with your running shoes
# May 27th 2016, 08:13 birdy247 really wish I was there :(
# May 27th 2016, 08:13 birdy247 @neon1024: that looks meannnn
# May 27th 2016, 08:12 Liquidedust Though whomever thought it was a good idea to go out for a "few" beers yesterday, I silently detest and like you at the same time
# May 27th 2016, 08:10 dakota canâ??t give any comment on itâ??s quality though
# May 27th 2016, 08:10 neon1024 Dangerous! ;)
# May 27th 2016, 08:10 dakota The lidl down the street has stroopwafel
# May 27th 2016, 08:10 neon1024 https://untappd.com/b/brouwerij-t-ij-flink/529499
# May 27th 2016, 08:09 neon1024 The local Flink beer is nice though
# May 27th 2016, 08:09 neon1024 Not found any stroopwafel yet :(
# May 27th 2016, 08:08 spriz Nah, you canâ??t drink before 10am if youâ??ve slept! :P