# |
May 26th 2017, 20:25 |
jeremyharris |
k that’s fine. when you define the association, the first param is the “alias” so to speak, so you access it via $this->Users->Follower |
# |
May 26th 2017, 20:23 |
HenriqueMachado |
i have users table and users_followers table, but i dont have a followers table |
# |
May 26th 2017, 20:22 |
jeremyharris |
you have a UsersFollowers table? your associations don’t use that table class (though they indeed use the users_followers table itself) |
# |
May 26th 2017, 20:21 |
HenriqueMachado |
i've only UserTable and UsersFollowersTable |
# |
May 26th 2017, 20:21 |
jeremyharris |
based on your associations, maybe you’re looking for Users->Follower->newEntity |
# |
May 26th 2017, 20:20 |
cleptric |
Should be `Users` I guess |
# |
May 26th 2017, 20:19 |
HenriqueMachado |
I'm confused with cake3, cake1 was so easy :P |
# |
May 26th 2017, 20:19 |
HenriqueMachado |
What i'm doing wrong here? https://pastebin.com/Wg9mh4MH i'M getting: Error: Call to a member function newEntity() on null |
# |
May 26th 2017, 20:06 |
igreat |
Please is there anyway I can build the url in a plugin template to link to the webroot of the plugin |
# |
May 26th 2017, 19:59 |
jeremyharris |
np |
# |
May 26th 2017, 19:58 |
HenriqueMachado |
worked, thanks |
# |
May 26th 2017, 19:57 |
HenriqueMachado |
wow |
# |
May 26th 2017, 19:57 |
jeremyharris |
capital T |
# |
May 26th 2017, 19:57 |
jeremyharris |
joinTable |
# |
May 26th 2017, 19:56 |
HenriqueMachado |
any hint? |
# |
May 26th 2017, 19:56 |
HenriqueMachado |
argh :/ caking want a table called users_users https://pastebin.com/RF0uLHK0 |
# |
May 26th 2017, 19:49 |
igreat |
The vendor folder is in my plugin webroot folder |
# |
May 26th 2017, 19:48 |
igreat |
Trying to generate a url to a file in my theme. I used `$this->url->build('/vendor/file')` it generates the link, but links it to the webroot of my app and not the plugin |
# |
May 26th 2017, 19:45 |
igreat |
Good day guys |
# |
May 26th 2017, 19:43 |
HenriqueMachado |
ah.. sure.. thanks |
# |
May 26th 2017, 19:43 |
jeremyharris |
HenriqueMachado I believe it was replaced with targetForeignKey |
# |
May 26th 2017, 19:38 |
HenriqueMachado |
associationForeignKey was removed on cake3? |
# |
May 26th 2017, 18:56 |
jeremyharris |
a better solution might just be saving the raw data and constructing the entities on demand, because what if your validation rules change and suddenly a previously stored entity fails to save? |
# |
May 26th 2017, 18:55 |
jeremyharris |
you would store new entities, those are what cake saves as records |
# |
May 26th 2017, 18:55 |
jeremyharris |
ok a resultset comes from the DB, not the other way |
# |
May 26th 2017, 18:54 |
deco |
without having a previous resultset |
# |
May 26th 2017, 18:53 |
deco |
What I want to do is to build a kind of ResultSet Object that I can later save it to the DB. I thought that collections would do this. :slightly_smiling_face: |
# |
May 26th 2017, 18:50 |
deco |
Ok. let me put it together... |
# |
May 26th 2017, 18:49 |
jeremyharris |
if you can put together a quick pseudo example of what comes in and what you want to do with it it would probably help |
# |
May 26th 2017, 18:49 |
jeremyharris |
what was the reason for the collection? is that the “processing”? |
# |
May 26th 2017, 18:48 |
deco |
My idea is to create Entities for each dashboard (Queues / Members / Calls), do the processing ans save it to the Database. |
# |
May 26th 2017, 18:47 |
jeremyharris |
deco so QueueStatus QueueMember and Call are the entities? |
# |
May 26th 2017, 18:46 |
jeremyharris |
HenriqueMachado can you gist your current UsersTable along with the db schema for `users` and your join table? |
# |
May 26th 2017, 18:45 |
deco |
@jeremyharris I'm creating a dashboard for the Asterisk PBX. I'm connected to the PBX Socket receiving event messages. There are 3 types of events I'm interested. Queue Status, Queue Members and Calls. The information I receive is not 1 to 1 to the entities. I have to do some processing before saving. |
# |
May 26th 2017, 18:41 |
HenriqueMachado |
cake still looking to the Followers table :/ |
# |
May 26th 2017, 18:32 |
jeremyharris |
might be a better solution if collections aren’t doing what you want |
# |
May 26th 2017, 18:31 |
jeremyharris |
deco what are you trying to accomplish? |
# |
May 26th 2017, 18:22 |
chris-andre |
I have a list of users. Does anyone have a tips how I can show useravatar when a:hover? |
# |
May 26th 2017, 18:15 |
deco |
Is there anyway I can make a collection of entities to be searchable? |
# |
May 26th 2017, 18:04 |
HenriqueMachado |
Ok.. i'll try |
# |
May 26th 2017, 17:56 |
deco |
@HenriqueMachado An example of the belongsTo declaration: In my AgentsTable.php I got this: $this->belongsToMany('Queues', ['foreignKey' => 'agent_id','through' => 'AgentsQueues',]); At the Queues Table I have a similiar declaration and in the linker table I have a hasMany to both tables. |