# |
May 27th 2016, 09:55 |
TheMiller |
yes sorry ;) |
# |
May 27th 2016, 09:55 |
hmic |
truncate, yes. |
# |
May 27th 2016, 09:54 |
TheMiller |
may I flush the phinx-tables? |
# |
May 27th 2016, 09:54 |
Neon1024x |
Odd, I've never seen that error before |
# |
May 27th 2016, 09:54 |
fquffio |
Oh, then you must `bin/cake bake migration_snapshot initial` first. :slightly_smiling_face: |
# |
May 27th 2016, 09:54 |
TheMiller |
yes. |
# |
May 27th 2016, 09:54 |
bernat1 |
hmmm |
# |
May 27th 2016, 09:54 |
Neon1024x |
Using bin/cake bake migration right? |
# |
May 27th 2016, 09:54 |
bernat1 |
how do you make a diff? |
# |
May 27th 2016, 09:54 |
TheMiller |
There are no available migrations. Try creating one using the create command. |
# |
May 27th 2016, 09:53 |
TheMiller |
Thanks @all so far. migrations status says - nothing to do |
# |
May 27th 2016, 09:53 |
Neon1024x |
TheMiller, You might want to bake a migration snapshot, or try bin/cake migrations status |
# |
May 27th 2016, 09:52 |
bernat1 |
TheMiller: look for a phinxlog table |
# |
May 27th 2016, 09:52 |
fquffio |
TheMiller: I'm not sure, but probably `bin/cake migrations mark_migrated` is what you're looking for. |
# |
May 27th 2016, 09:52 |
TheMiller |
3.2.9 |
# |
May 27th 2016, 09:52 |
Neon1024x |
TheMiller, What version of cake? |
# |
May 27th 2016, 09:52 |
bernat1 |
thanks @fquffio |
# |
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. |