# |
Jul 26th 2016, 08:35 |
Neon1024 |
You might need to manually cast the datetime object to a string |
# |
Jul 26th 2016, 08:35 |
Neon1024 |
Also Iâ??m not sure how that will work, as DateTime in Cake is an object, whereas the primaryKey will probably be assumed to be an int or string |
# |
Jul 26th 2016, 08:35 |
Neon1024 |
Did you configure the Table class Measurements to know that the datetime field is the primary key? |
# |
Jul 26th 2016, 08:34 |
joris_ |
you can see the migrations file in the gist, i only used datetime and float |
# |
Jul 26th 2016, 08:33 |
Neon1024 |
Probably ENUM would be my guess |
# |
Jul 26th 2016, 08:33 |
Neon1024 |
Then your database has a column type which cake doesnâ??t understand |
# |
Jul 26th 2016, 08:33 |
joris_ |
I created a small gist to show the used code: https://gist.github.com/jorisvaesen/8950df804da8b7bdf0565932efc1456b |
# |
Jul 26th 2016, 08:32 |
joris_ |
The db gets created correctly, but when i want to save a new record it gives me the unknown type error on Database/Type.php |
# |
Jul 26th 2016, 08:31 |
joris_ |
I'm using migrations to create the tables (1 at the moment for testing) |
# |
Jul 26th 2016, 08:31 |
joris_ |
Anyone who can help with setting up cake 3 with an sqlite db ? |
# |
Jul 26th 2016, 08:28 |
joris_ |
Hello all |
# |
Jul 26th 2016, 08:27 |
mirec |
thanks. dynamic binding sounds good enough |
# |
Jul 26th 2016, 08:26 |
Neon1024 |
Which just means, loading the behavior as and when you need it, rather than using the Table classes initialize() method |
# |
Jul 26th 2016, 08:26 |
Neon1024 |
If you need multiple configs of the same behavior, Iâ??d be thinking more about doing dynamic binding |
# |
Jul 26th 2016, 08:25 |
Neon1024 |
As behaviors in cake 3 are not indexed by model any more |
# |
Jul 26th 2016, 08:25 |
Neon1024 |
Otherwise BehaviorCollection::name() would return just one instance |
# |
Jul 26th 2016, 08:24 |
Neon1024 |
Plus, I donâ??t think it is possible without aliasing it as another name in the BehaviorCollection |
# |
Jul 26th 2016, 08:24 |
Neon1024 |
Why would you want to? |
# |
Jul 26th 2016, 08:18 |
ra7bi |
i think yes |
# |
Jul 26th 2016, 08:16 |
mirec |
it is possible to bind the same behavior on a table multiple times with different configuration? |
# |
Jul 26th 2016, 08:16 |
mirec |
hello guys |
# |
Jul 26th 2016, 07:11 |
braguzz |
hi |
# |
Jul 26th 2016, 06:57 |
anujsharma9196 |
how can I implement Instamojo payment gateway |
# |
Jul 26th 2016, 06:17 |
braguzz |
I seen a couple of chart plugin, the question is: how to retrieve data from a 'user defined' query? (and then plot the results?) |
# |
Jul 26th 2016, 06:16 |
braguzz |
good morning |
# |
Jul 26th 2016, 05:30 |
slackebot2 |
$this->set('participants', $this->paginate($query)); } ``` |
# |
Jul 26th 2016, 05:30 |
slackebot2 |
'message' => 'Number only ' ] ]); $participant = $this->Participants->newEntity(); if($this->request->is("post")) { $errors = $validator->errors($this->request->data()); if (!empty($errors)) { debug($errors); } } $query = $this->Participants->find('all')->where(['id !=' => 0]); $this->set('participant', $particip |
# |
Jul 26th 2016, 05:30 |
ra7bi |
``` public function search() { $validator = new Validator(); $validator->requirePresence('mobile') ->notEmpty('mobile', 'We need your name.') ->add('mobile', [ 'length' => [ 'rule' => ['minLength', 9], 'message' => 'Titles need to be at least 10 characters long', ] ,'number' => [ 'rule'=> |
# |
Jul 26th 2016, 05:17 |
ra7bi |
how i can display custom validation errors in view |
# |
Jul 26th 2016, 05:02 |
unorthodox |
Morning |
# |
Jul 26th 2016, 04:13 |
ra7bi |
What is the best way to keep track of stock items for shop that have sales and purchased with example ? |
# |
Jul 26th 2016, 02:27 |
hanminh1203 |
Hi, i have a case like this: a user can like many posts, a post can be liked by many users (many-to-many relationship). I want to make a virtual field in PostEntity that check if the post is liked by the current user (saved by CakePHP's Authentication function). I want it to be a virtual field so that I don't need to manually add this virtual field for every query. What is the good way to implement in this case? |
# |
Jul 26th 2016, 00:04 |
moose517 |
Wowzers am i drawing a blank right now on something |
# |
Jul 25th 2016, 22:44 |
D-rex |
Should CakePHP ORM ResultSet return true for instanceof Collection? |
# |
Jul 25th 2016, 22:39 |
sat |
by |
# |
Jul 25th 2016, 22:39 |
sat |
) |
# |
Jul 25th 2016, 22:39 |
mikatone |
thank you |
# |
Jul 25th 2016, 22:39 |
mikatone |
sat forget about it |
# |
Jul 25th 2016, 22:38 |
sat |
seperate |
# |
Jul 25th 2016, 22:38 |
sat |
send your query seperayly |
# |
Jul 25th 2016, 22:37 |
sat |
send first comment clearly :) |