=> array (
'className' => 'User',
'with' => 'PermissionRight',
)
);
*Notice* (8): Undefined index: User
[*CORE\Cake\Model\Datasource\DboSource.php*, line *1388*]
On Monday, March 14, 2016 at 8:29:13 PM UTC+1, John Andersen wrote:
>
> Check your
Check your model names in the HABTM relationships. Looks like you have a
mix of singular and plural.
Enjoy, John
On Monday, 14 March 2016 05:33:36 UTC+2, Steffen Reinig wrote:
>
> Hello Cakephp Fans,
>
> today i receive these error:
>
> Notice (8): Undefined index: Use
Hello Cakephp Fans,
today i receive these error:
Notice (8): Undefined index: User [CORE\Cake\Model\Datasource\DboSource.php,
line 1388]
Its easy to reproduce:
Model: User belongsTo Group
Model: Permission habtm Rights (className User)
Permission habtm Owners (className User)
When i
Hi, I have a simple HABTM with a lessons/Students table. i simply create a
new lesson with an existing student via a while loop , so I should get 2
new rows. I am testing this function. What I get is 4 new rows in the
lesson table instead of 2. I have no idea why the extra 2 rows are created
at which I currently sit, and so I
believe HABTM relationships to be the answer.
My attempt to solve this conundrum was to implement a node table and two
join tables - children and parents - both of which taking the place of what
would be conventionally named nodes_nodes tables. The children join
So I have 2 models, Posts and Events.
Model Post.php looks like this:
?php
App::uses('AppModel','Model');
class Post extends AppModel{
...took out variables for brevity sake
public $hasAndBelongsToMany = array(
Events=array(
className=Event,
joinTable=events_posts,
foreignKey=post_id,
Hi Jake
Does your events_posts table have a primary key, that is a column named id
used for the primary key?
If not, then please add such and try again :)
Enjoy, John
On Sunday, 11 January 2015 16:45:30 UTC+2, Jake Newsom wrote:
So I have 2 models, Posts and Events.
Model Post.php looks
I want to add a new record in a table called TutorsSubject. This table is
created from HABTM relationship of Tutor and Subject. Anyway I load the
subject names in a text box and I can select a subject name but I cant add
a new record. I need to set the id of the tutor_id.
There are 3 fields
Hvae you tried saveAll($dataArray, array('deep' = true)); ?
I use this method to save all my HABTM data.
Also, since you are manually setting data maybe, your array is not well
formed for CakePHP save(All).
Anup
On Monday, 22 September 2014 14:21:03 UTC+5:30, ajt wrote:
I want to add a new
But I dont need a saveall as I save to 1 table only ? Saveall is not
appropriate for this. I am not sure what to do here.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the
Oh Ok.
Now I see what are you doing.
If you check the documentation for Cakephp, the association tables gets
populated by Cakephp, itself. Howvever if you are saving the data straight
into the association tble then do it this way
$data['tutor_id'] = 2;
$data['subject_id'] =
Hi ,
I have the odd situation where I can retrieve data from a HABTM model (from
debug array)but cant actually display any of it in the view. I keep getting
index undefined error for everything. I want data from both tables but it
doesnt work
//view doesnt work
foreach ($student as $item2
Mails like these end up in SPAM on Gmail. Use text instead or HTML , you
will probably get more replies
T
On Fri, Jul 11, 2014 at 9:37 PM, Salines nikola.parad...@gmail.com wrote:
I have habtm relationship between articles and tags. This works correctly.
Now in my Articles/admin_add.ctp
Sorry, I copied the question from SO.
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
CakePHP group.
To unsubscribe from this group and stop receiving emails
I have habtm relationship between articles and tags. This works correctly.
Now in my Articles/admin_add.ctp want beside multiple selection inputs, add
fields to add additional tags, and save it all together.
echo $this-Form-input('Tag'); // multiple select
echo $this-Form-input('Tag.0.name
using
CakePHP since 2.0, so I'm very familiar with HABTM conventions, including
the fact that the tables are named in alphabetical order by convention. In
my case, this would be photos_users, but I really hate that because it just
seems backward. My question is, will CakePHP break if I name
Hi all,
I'm developing an application that has Photos and Users. I've been using
CakePHP since 2.0, so I'm very familiar with HABTM conventions, including
the fact that the tables are named in alphabetical order by convention. In
my case, this would be photos_users, but I really hate
Hi,
I need an association where therapists have many children and visa-versa.
I have 3 tables:
therapists
children
children_therapists
You can see the association below:
Therapist.php
public $hasAndBelongsToMany = array('Child' =
array(
Check your class name in the association you have defined:
'className' = 'Children',
Should it not be:
'className' = 'Child',
Enjoy, John
On Tuesday, 24 June 2014 14:29:52 UTC+3, Gregory Fox wrote:
Hi,
I need an association where therapists have many children and visa-versa.
I have 3
the convention would be for a join table to be flags_invoices
(alphabetical), the model name might be FlagsInvoice, even though CakePHP
to automagically generate a dynamic model of FlagInvoice while using the
HABTM relationship from the Flag or Invoice models.
Though it might be easier to explicitly
Hi folks,
im goggling for this a few days but can't find a clear solution for my
problem.
So what i am trying to do is quit simple.
I created a *Container* model and this $actsAs tree.
Container Database:
id, containertype_id, name, parent_id, lft, rght
Now i want to create a Contact. A
Ok, I'm probably being really dumb here, but I can't figure out how to
delete an associated record when the association is HABTM.
I have the following:
*Invoice:*
public $hasAndBelongsToMany = array(
'Flag' = array(
'counterCache' = true,
)
);
I can add
Since the convention would be for a join table to be flags_invoices
(alphabetical), the model name might be FlagsInvoice, even though CakePHP
to automagically generate a dynamic model of FlagInvoice while using the
HABTM relationship from the Flag or Invoice models.
Though it might be easier
I've done a lot of searching and reading, but I can't seem to figure out
the best way to handle this. Any advice would be appreciated:
I have a Customer model and a Departure model that have a HABTM
relationship. (Customers can sign up for multiple Departures.) I need to
keep track
Is this possible?
Situation:
Users have many Items
I want to pull a User's total inventory, which sits in the inventory table.
But I also need to pull some fields from the master item table (like item
name) or to be able to pull items only be their type (this data sits in the
master table)
Hi, now I'm trying to retrieve data using find function like this
$this-Evento-Behaviors-load('Containable');
$this-Evento-recursive = -1;
debug($this-Evento-find('all', array('conditions' =
array('Evento.id'=$this-Convert-decode($evento_id)),
'contain' =array(
My first guess is because the necessary fields required by the contains
statement to do the join are not included when specifying the contains
clause for Disciplina and DisciplinasEvento.
i.e. the query cant get DisciplinasEvento if Disciplina.id is not
retrieved. The query can't get
I've been wrangling an app with Cake and have got myself stuck with saving
HABTM data. To save repeating myself here is the link to my StackOverflow
questionhttp://stackoverflow.com/questions/18893392/cakephp-saving-habtm-datawhich
I have yet to receive a solution.
Basically I have 2 models
Ps. the above will remove all existing HABTM relationships records for the
client, so if you only need to add additional relationship records, then
you need to work with the relationship model (join table) instead of with
Client and Security.
--
Like Us on FaceBook https://www.facebook.com
Please ensure that your data follows the following structure when saving
HABTM data:
Array(
[0] = Array
(
[Client] = Array
(
[id] = 12345
)
[Security] = Array
(
[id
This is a duplicate of my question asked on StackOverflow here:
http://stackoverflow.com/questions/17875143/model-habtm-model-referencing-original-model
If you could answer the question there, or let me know if it is a bug or
not, it would be greatly appreciated.
I have a Team model
Hi everybody,
I'm struggling with a particular hasAndBelongsToMany form data problem and
need some help.
Quickly:
1. A recipe can have many ingredients.
2. An ingredient can be in many recipes.
2. An ingredient in a recipe can be mandatory or optional (or not present).
4. an ingredient in a
I am using cakephp 2.3.5.
There are B and model A model is a relationship HABTM,
C model and intermediate model AB is the relationship of hasOne.
A.php
class A extends AppModel {
public $recursive = 2;
public $hasAndBelongsToMany = array(
'B' = array(
'with' = 'C
This is an awesome set of tips for a very murky area :)
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
CakePHP group.
To unsubscribe from this group and stop
if
there was a work around.
Thanks for the advice, I'll get it set with the join model and go from
there. Thanks again.
On Feb 17, 3:10 pm, euromark dereurom...@googlemail.com wrote:
yep
you will need to develop your own HABTM behavior that will take care
of that
because john is right
solved
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
CakePHP group.
To unsubscribe from this group and stop receiving emails from it, send an email
to
Hi there,
I have 4 tables:
- childs
- peroples
- childs_peoples
- type
Between childs and parents I have a HABTM relationship, the join table is
childs_parents.
In my type table there're values like mother, vather, oncle ...
On peoples i have a fk to the type table.
Now to my actual question
Cake 2.x
Item - habtm - Category
I'm trying to select all uncategorised Items. There are only 723 records in
the items table, 188 of which are uncategorised. I know this last fact
because I can run the following query in mysql client:
SELECT * FROM items LEFT JOIN categories_items AS ci
'
)
)
);
}
On Thu, May 2, 2013 at 6:44 PM, lowpass zijn.digi...@gmail.com wrote:
Cake 2.x
Item - habtm - Category
I'm trying to select all uncategorised Items. There are only 723 records
in the items table, 188 of which are uncategorised. I know this last fact
because I can run the following query in mysql
:
Cake 2.x
Item - habtm - Category
I'm trying to select all uncategorised Items. There are only 723 records in
the items table, 188 of which are uncategorised. I know this last fact
because I can run the following query in mysql client:
SELECT * FROM items LEFT JOIN categories_items AS ci
Whats the best way to achieve reciprocity between a HABTM self-referencing
model?
For example:
I have a model called Zones it HABTM other Zones. I have the join table
setup and everything is working like other HABTM models. But I want the
reverse connection to also be established. So
Hi Leonhart,
And if you look from another perspective.. Try to perform a search on the
Language model, filtering by laguage_name field and then CakePHP will take
care of getting the HABTM results from your Post model.
What do you think?
On Wednesday, April 3, 2013 6:03:09 PM UTC-3, Leonhart
How can I perform a find call if I've a Model linked to another one with
the Has And Belongs To Many relation? The Models involved are Post and
Language. According to the Cake Conventions I've created and populated
the Language_Post table. I want to find only the Posts with a specific
language
Obviously, I meant Languages_Posts table. Sorry for the mistake :)
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are subscribed to the Google Groups
CakePHP group.
To unsubscribe from this group
I do not understand, What do you want to store in languages table?
Look here:
http://book.cakephp.org/2.0/en/core-libraries/behaviors/translate.html
Dana srijeda, 3. travnja 2013. 15:06:49 UTC+2, korisnik Leonhart napisao je:
How can I perform a find call if I've a Model linked to another one
contain more than a translation of the article (on the same page)
obviously, the right relationship between Link and Language is a HABTM.
Well, I need to perform a search on the Link table starting from the
language of the content: If a user searches for english contents, I wanna
get just the Links
Hello,
I solved the problem now as follows
*JobsController.php*
...
$drivers = $this-Job-query(SELECT User.id, (CONCAT(vorname, '
',nachname)) AS name FROM users AS User INNER JOIN users_events AS Event ON
User.id = Event.user_id WHERE Event.event_id = $jobid);
...
*edit.ctp*
$select_value =
Am Dienstag, 19. März 2013 00:42:28 UTC+1 schrieb cricket:
On Mon, Mar 18, 2013 at 12:40 PM, Jerome Walitzek
jerome@t-online.de javascript: wrote:
Hi there,
i have a problem with INNER JOIN.
Models
Job
User
UsersEvent
What are the associations between models? Do
Hi there,
i have a problem with INNER JOIN.
Models
Job
User
UsersEvent
In my Job View i would like to get all users which are assigned to an
event. I only get successfully the IDs from UsersEvent but not the names
from the User Model.
In principle I would like to do following:
SELECT
On Mon, Mar 18, 2013 at 12:40 PM, Jerome Walitzek
jerome.walit...@t-online.de wrote:
Hi there,
i have a problem with INNER JOIN.
Models
Job
User
UsersEvent
What are the associations between models? Do you also have an Event
model? I ask because that last one looks like a join model
Hi Andrew,
I'm having exactly the same problem.. I have a HABTM relationship between
(sports) matches and teams. When I try to create a fixture for the
MatchesTeam class I get the same error:
*Error: *SQLSTATE[42S02]: Base table or view not found: 1146 Table
'c0test.matches_teams' doesn't
Ok so I guess I found the solution for this...
Before I was getting this error:
Warning: array_map(): An error occurred while invoking the map
callback in
/var/www/clients/client0/web29/web/lib/Cake/Model/Datasource/DboSource.php
on line 451 Warning: Fixture creation for
all,
I've been digging for a good example for exactly what I am trying to
do.
Most of the samples out there I can find are for HABTM relationships
adding and updating, whilst adding a new model instance.
What I am after is the update process / procedure required to update
results in the HABTM model record belonging to the artist.
How can a do a round trip in a HABTM relationship?
Thanks for all the help,
Jay
Result:
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you
of languages that the artists speaks only
results in the HABTM model record belonging to the artist.
How can a do a round trip in a HABTM relationship?
Thanks for all the help,
Jay
Result:
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
, record
2-ArtistsLanguage, etc...)
Comments:
Basically, I am looking to find all artists for a given language. This part
works, but the result for the list of languages that the artists speaks only
results in the HABTM model record belonging to the artist.
How can a do a round trip in a HABTM
Hey Guys,
First of all, a warm hello to everybody here, secondly, i would want to
know if somebody can help me with this problem.
This is the association part from the Product model, which correlates the
Products table with the shipping_methods table, through a join table,
called
On Fri, Jan 25, 2013 at 8:03 PM, Penny Coders dtk...@gmail.com wrote:
?php echo
$this-Form-input('ShippingMethod',array('label'=false,'multiple'='multiple','class'='chzn-select
validate[required]','div'=false,'data-placeholder'='Shipping methods'));?
You've specified the model but not the
Hey,
Thanks, i did try that, no luck tho'
Anybody any more ideas?
Best Regards,
Alex.
On Saturday, January 26, 2013 9:49:52 PM UTC+2, cricket wrote:
On Fri, Jan 25, 2013 at 8:03 PM, Penny Coders dtk...@gmail.comjavascript:
wrote:
?php echo
Please note, it DOES show the options, but NOT the previously selected
values, compared to another site, on exactly the same procedure does work...
On Sunday, January 27, 2013 4:41:46 AM UTC+2, Penny Coders wrote:
Hey,
Thanks, i did try that, no luck tho'
Anybody any more ideas?
Best
print_r your request data and ensure that the schema is matching your intended
inputs
==
print_r($this-request-data);
==
On Jan 26, 2013, at 6:42 PM, Penny Coders dtk...@gmail.com wrote:
Please note, it DOES show the options, but NOT the previously selected
values, compared to another
//$this-request-data['ShippingMethod']
Array ( [0] = Array ( [id] = 1 [name] = Free Shipping
[ProductShippingMethod] = Array ( [id] = 4 [product_id] = 18
[shipping_method_id] = 1 [created] = [modified] = ) ) [1] = Array (
[id] = 3 [name] = FedEx [ProductShippingMethod] = Array ( [id] = 6
On Wed, Jan 2, 2013 at 8:32 PM, Stefano Campanella
leona...@guildofmessengers.com wrote:
Yes I am sure. In my case id is not numeric, the permission name is already
an identifier for the permission
Your DB schema is broken by design, then. Good luck with that.
--
Like Us on FaceBook
Broken for CakePHP or broken in general?
Generally, I would not see a problem in using a non-numeric primary key,
you just have to be conscious of the constraints this imposes.
If it is for a constraint of CakePHP, well I didn't experience any problem
with that yet. There is no error in
Yes I did, but it does not suit my needs or my organization structure. For
me it's at the same time too complicated and too limited. I don't need a
tree, I need a graph, where a user can have more than one group; because
users can be categorized in more than one way.
Anyway, do you have any
When running a find('count') the contain param is useless. This is
because the main query is fetching a sum, not a set of records from
which to fetch the associated 'contain' records.
Are you using AuthComponent? You can use that to fetch the User and
associated records. However, I can't remember
mmh, ok. But the problem is that even if I change the find(count) into a
find(all) it still loads data only from Group table.
Yes I am using the AuthComponent for logged in users. But since I want to
use my Authorize class also for managing what anonymous users can access I
am calling
This simply is solvable with:
$this-Auth-userScope = array('User.can_access_admin' = 1);
Put that in you beforeFilter function inside AppController, and your
problems are solved. If you want to redirect them, than you shoukd do
something like this:
if ($this-Auth-user()) {
Excuse me Ivan,
but there is no reference to userScope attribute anywhere in the source
code of cakePHP, I assume you mean $this-Auth-scope.
But it still doesn't help me, is was under the impression that that
attribute is used to impose conditions for logging users in, this is not
my case, I
I think that should be something like:
$data = $this-controller()-Group-find(
'count',
array(
'conditions' = array(
'Group.id' = 1 // hard-coded for testing?
),
'joins' = array(
array(
I just realised that this also makes no sense. Why are you running a
COUNT(*) on Group when your condition is to select only the Group with
id = 1?
Perhaps you need to start from the beginning and explain what it is
you're looking for.
And I'll second the suggestion to use ACL.
On Wed, Jan 2,
Works like a charm! Thank you so much cricket!
Now to reply to your questions:
I am using a count because I don't need any content returned. With this
query I just check if the record exists, if it does then I know the Group
has the specified permission. The count will always return 0 if group 1
array('*id*'='can_access_admin')
Do you have sure is ID? Usually ID is numeric.
Em terça-feira, 1 de janeiro de 2013 19h23min58s UTC-3, Stefano Campanella
escreveu:
Hello all,
this is my first time posting here. I recently started to study how to use
CakePHP and I'm trying to develop
Yes I am sure. In my case id is not numeric, the permission name is already
an identifier for the permission
On Wednesday, January 2, 2013 3:56:41 PM UTC+1, Maicon Pinto wrote:
array('*id*'='can_access_admin')
Do you have sure is ID? Usually ID is numeric.
Em terça-feira, 1 de
or Group
classes:
$this-GroupMember-find(...)
On Mon, Dec 31, 2012 at 8:32 AM, pyr...@googlemail.com wrote:
Hey,
I'm having a slight issue with a fixture I'm attempting to create.
Basically I have a Member model and a Group model, and they have a HABTM
relationship, I've specified a custom
Hello all,
this is my first time posting here. I recently started to study how to use
CakePHP and I'm trying to develop a website.
In my website I am writing a custom authorize component where each user get
one or more groups and each group has one or more permissions associated to
it.
I have
Have you looked at the inbuilt Auth and ACL components? Might save you a lot of
time.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 1 Jan 2013, at 22:23:58, Stefano Campanella leona...@guildofmessengers.com
wrote:
Hello all,
this is my first time posting here. I recently started
Hey,
I'm having a slight issue with a fixture I'm attempting to create.
Basically I have a Member model and a Group model, and they have a HABTM
relationship, I've specified a custom model to handle this relationship
'GroupsMember' as I wish to add methods to that model to query the join
. And change the fetch method, of course.
I included the order just to show that it can be.
On Sun, Dec 16, 2012 at 3:20 PM, MetZ met...@gmail.com wrote:
Okei, so I have a HABTM setup:
- posts
- tags
- posts_tags
When creating posts = select multiple tags: example: Tag1, Tag2, Tag3
Each selected
Okei, so I have a HABTM setup:
- posts
- tags
- posts_tags
When creating posts = select multiple tags: example: Tag1, Tag2, Tag3
Each selected tag is saved to posts_tags: id:1, post_id: 44, tag_id: 3
(and so on).
Now, displaying my posts, and listing the selected tags, is no problem
*Category HABTM Post, find results by selected category and show related
posts and paginate by posts?*
Another day, another problem.
When Selecting one category, output will show properly related posts.
But the post results need to use pagination.
How?
Thanks
--
Like Us on FaceBook https
/components/pagination.html
On Friday, December 7, 2012 2:58:07 PM UTC+1, Salines wrote:
*Category HABTM Post, find results by selected category and show related
posts and paginate by posts?*
Another day, another problem.
When Selecting one category, output will show properly related posts
I'm lost in the code and reading documents :/
* public function show($slug = null) {*
* $this-Category-Behaviors-attach('Containable');*
* *
* $this-paginate = array(*
* 'contain' = array('Post'=array('fields'=array('Post.title'))),*
* 'fields' = array('Category.id',
Solved
public function show($slug = null) {
$this-Category-recursive = 0;
$this-paginate = array(
'joins' = array(
array(
'table'= 'categories_posts',
'alias'= 'CategoriesPost',
'type' = 'inner',
'conditions'= array(
'Category.id = CategoriesPost.category_id'
)
),
array(
Thanks guys for your help.
I think that I have found what is causing the problem but I need some
feedback to see if it's probable.
Lets say I have the models 'Order' and 'Cart' which have a HABTM
relationship with a join model 'CartsOrder'.
*When I run this:*
$order = $this-Order-find('first
So as far as I can tell, if you want to paginate a model based on the
conditions in another model associated via HABTM, you need to do a custom
join. It'd be nice to have some convenience methods to make that more
Cakey.
It's a fairly common need; find posts by author's status, find athletes
I have HABTM associations between two models but can only get find to return
one level. I can return several levels with other associations but think I must
be doing something wtong with HABTM.
Controller/SchedulesController.php
$this-Schedule-find('first', array(
'contain' = array
Hi!
I read many topics about HABTM validation in Cake but I can't figure out
how to solve my problem.
I have my main model – Restaurants, it has many HABTM relations to
additional models.
Now I'm building admin area, and I'm working with new controller in which I
have
public $uses = array
I have a *User* model to use built-in authentication. The model has several
*$hasOne* relationships and all linked models get saved automatically into
session, which is great because I can call *AuthComponent**::user()*whenever I
need to perform an action based on user data.
Now, I've added a
That's what I've done in the past when I want to include data that
Auth doesn't automatically store. IIRC, you can write to the Auth.User
key; the data will then be available from the user() method.
$this-Session-write('Auth.User.group', $group_data);
Retrieve with $this-Auth-user('group')
On
if i have an Agent who have one associated Plugin and i want to add one
Plugin more how can i do? if i do:
$this-Agent-save(
array(
'id' = $data['Agent']['id'],
'Plugin' = array($data['Plugin']['id'])
)
)
Old plugin is deleted
Hey,
I have an orders table, a carts table and a carts_orders table. Every once
and a while, I lose some of the rows from the carts_orders table. They are
being created properly but are being deleted at some point. I have been
trying to figure it out but everything in the applications works
By default, Cake clears down the entire habtm table (for the current
association) and adds back in just those that are in the current saved dataset.
So if a cart has three orders and you try to add another in isolation the first
three are cleared and replaced with the new one. If you are trying
If you are using $this-CartsOrder-delete(); then it must be deleting the
cartsorder record . You should check for that.
Enjoy,
Marcus
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message because you are
For 2.x sites you can also set 'unique' = 'keepExisting' to prevent the save
from deleting existing records:
http://book.cakephp.org/2.0/en/models/saving-your-data.html#what-to-do-when-habtm-becomes-complicated
http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#ref
not be required).
For example: User habtm Role.
When updating a User address, you still need to provide the Role data in
the POSTed array. To avoid the need
of providing the Role data, you could temporarily unbind the relationship
using unbindModel() before the call to User-save().
http
I'm looking for some guidance here.
I have:
User hasAndBelongsToMany Project
Schema:
Users.id
Users.name
...
Project hasAndBelongsToMany User
Schema:
Project.id
Project.name
...
My join table:
projects_users.user_id
projects_users.project_id
Site belongsTo Project
Site.id
You don't really need to add a constraint if your code if you specify
the User.id as a condition and run your query on the User model.
In Project model:
public function fetchAll($user_id = null)
{
if (!empty($user_id))
{
return $this-User-find(
On Monday, September 24, 2012 3:30:01 PM UTC-4, cricket wrote:
Wasn't there an episode of Laverne Shirley in which Fonzi appeared?
Touche. So my example isn't perfect. Although, if I were actually
implementing this, I would probably handle that exception by making another
Fonzi for LS
Wasn't there an episode of Laverne Shirley in which Fonzi appeared?
On Sun, Sep 23, 2012 at 3:46 PM, Carl Clements typo...@clemnet.info wrote:
Here is an example almost exactly like the one I am trying to solve, but
using more familiar objects (television series) to hopefully allow common
1 - 100 of 2499 matches
Mail list logo