They should've been linked by a HABTM but i need to save some additional
fields in the join table so i made 2x hasMany.
ITA: Article e Piece dovrebbero essere linkati via HABTM, ma vuoi salvare
altri campi addizionali nella Tabella ArticlePiece.
ITA: ma la tabella ArticlePiece può avere
Hi all, I am building a download manager for my site. Now I am
building the edit function for the downloads. I have used the console
cake bake controller to create it, but it seems that each time I press
save it adds a new association.
Example:
Post as been added with TagA and TagC. I edit it
Ok, I've upgraded to 2.0.2, changed the code of
EpisodeReleaseController.php, and i have fixed the add problem. Now I
am building the edit function. I have used the console cake bake
controller to create it, but it seems that each time I press save it
adds a new association.
Example;
Post
http://book.cakephp.org/2.0/en/models/associations-linking-models-together.html#hasandbelongstomany-habtm
*unique*: If true (default value) cake will first delete existing
relationship records in the foreign keys table before inserting new ones,
when updating a record. So existing associations
I don't see Post or Tag model in this app.
Check this line
https://github.com/ilmattodel93/IMattiDel93-s-Site/blob/master/app/Model/EpisodeRelease.php#L39
or other habtm associations.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP
Ok, I've upgraded to 2.0.2, changed the code of
EpisodeReleaseController.php, and i have fixed the add problem. Now I
am building the edit function. I have used the console cake bake
controller to create it, but it seems that each time I press save it
adds a new association.
Example;
Post as been
(
[0] = 1
)
)
[VideoCodec] = Array
(
[VideoCodec] = Array
(
[0] = 8
)
)
)
But it seems that HABTM relations are'nt saved why?
Thanks again! ^^
WebRep
Overall rating
(
[0] = 1
)
)
[VideoCodec] = Array
(
[VideoCodec] = Array
(
[0] = 8
)
)
)
But it seems that HABTM relations are'nt saved why?
Thanks again! ^^
WebRep
Overall rating
I've had some similar trouble with 2.0
turned out the fields in the DB were not the same type.
id on one table was a bigint and the foreign key on the relationship table
was a regular integer.
atenciosamente,
With MySQL you can catch these errors at db schema level if you use
foreign key
Use InnoDB. As John says, it won't let you create RI between fields with
different types (and it's very precise) and you get transactions thrwn in for
good measure.
On 2 Nov 2011, at 16:14, Jon Bennett wrote:
I've had some similar trouble with 2.0
turned out the fields in the DB were not the
I Have already checked, and all table are already well related. Same
column type INT(11) and InnoDB powered. But I still have the
problem... :S
What to do now? The code I am using works if I use cakephp1.3
On 2 Nov, 17:51, Jeremy Burns jeremybu...@me.com wrote:
Use InnoDB. As John says, it
Put your code on Github or Gists and send us the link.
Thiago Belem, enviado do meu Android
Em 02/11/2011 15:28, Mattia Manzati manzat...@gmail.com escreveu:
I Have already checked, and all table are already well related. Same
column type INT(11) and InnoDB powered. But I still have the
Ok, putted code on github. This is the repo:
https://github.com/ilmattodel93/IMattiDel93-s-Site
Thanks again for your help! ^^
On 2 Nov, 18:47, Thiago Belem cont...@thiagobelem.net wrote:
Put your code on Github or Gists and send us the link.
Thiago Belem, enviado do meu Android
Em
Hello all,
i need help.
I had a brand model with $hasAndBelongsToMany = array('Category');
Category is a model with the translation on the field 'name'
Now depending on a category filter in a searchbox I want to identify
which brands are in the search area and which other catgeories are
assigned
https://github.com/milesj/cake-uploader/issues/24
I have opened an issue about this problem. Does anybody have an idea
of why it may not work?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and
You would not want to delete the associated Service as the nature of
HABTM means that Service could be associated with any number of other
ServiceCategory.
HTH, Paul
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site
Hi!
I was wrong thinking on HABTM. Everything is working ok :-)
Thanks!
On 20 sep, 12:01, WebbedIT p...@webbedit.co.uk wrote:
You would not want to delete the associated Service as the nature of
HABTM means that Service could be associated with any number of other
ServiceCategory.
HTH
:
If using Cakes HABTM automagic the table should be named
classes_teachers and have the following fields
id (primary_key, auto_inc)
class_id
teacher_id
After that it's a case of
INSERT INTO classes_teachers (class_id, teacher_id) SELECT class_id,
teacher_id FROM import_table
HTH, Paul
Hi!
I have the following relationship between HABTM tables:
- services
- service_categories
- Servicecategories_services (the latter is what links the two tables
above)
Well, what I get is that when you delete a table record
service_categories, records are automatically deleted from the table
Have you set the 'dependent' key in *both* relationship configurations?
Kind regards
Thomas
Am 19.09.2011 16:32, schrieb xamako:
Hi!
I have the following relationship between HABTM tables:
- services
- service_categories
- Servicecategories_services (the latter is what links the two tables
The dependent key is not avaible en HABTM
http://book.cakephp.org/es/view/1044/hasAndBelongsToMany-HABTM
Thanks
On 19 sep, 16:41, Thomas Ploch profipl...@googlemail.com wrote:
Have you set the 'dependent' key in *both* relationship configurations?
Kind regards
Thomas
Am 19.09.2011 16:32
(.$tclass_id., .$teacher['Teacher']
['id'].););
Cheers Chris
On Sep 16, 8:37 am, WebbedIT p...@webbedit.co.uk wrote:
If using Cakes HABTM automagic the table should be named
classes_teachers and have the following fields
id (primary_key, auto_inc)
class_id
teacher_id
is not avaible en
HABTMhttp://book.cakephp.org/es/view/1044/hasAndBelongsToMany-HABTM
Thanks
On 19 sep, 16:41, Thomas Ploch profipl...@googlemail.com wrote:
Have you set the 'dependent' key in *both* relationship configurations?
Kind regards
Thomas
Am 19.09.2011 16:32, schrieb xamako
, teacher_id) VALUES
(.$tclass_id., .$teacher['Teacher']
['id'].););
Cheers Chris
On Sep 16, 8:37 am, WebbedIT p...@webbedit.co.uk wrote:
If using Cakes HABTM automagic the table should be named
classes_teachers and have the following fields
id (primary_key, auto_inc
If using Cakes HABTM automagic the table should be named
classes_teachers and have the following fields
id (primary_key, auto_inc)
class_id
teacher_id
After that it's a case of
INSERT INTO classes_teachers (class_id, teacher_id) SELECT class_id,
teacher_id FROM import_table
HTH, Paul
@phpMagpie
Okay I'll try that and see thanks
On Sep 15, 2:11 am, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
Don't do it as HABTM. Create a model and controller for the joining table and
use $belongsTo and $hasMany.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 14 Sep
hi,
First time user of cake with CI background, I have two tables
teachers and classes that share a many to many relationship e.g.
Teacher-Classes.
I'm having to import the data from CSV files that have been exported
from another system that we have limited access to.I've got the
classes
I have this data structure :
Product(Id,name);
Market(Id,name);
Product HABTM Market ( I mean that i could have products available in
many Market or store but the price is not the same for example this
product X is available in Market1 and in Market2 but in market1 it's
expensive than in Market2
is no one can help me ?
any help is welcome
On Sep 14, 10:12 pm, driss bounouar.dr...@gmail.com wrote:
I have this data structure :
Product(Id,name);
Market(Id,name);
Product HABTM Market ( I mean that i could have products available in
many Market or store but the price is not the same
Don't do it as HABTM. Create a model and controller for the joining table and
use $belongsTo and $hasMany.
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 14 Sep 2011, at 23:12, driss wrote:
I have this data structure :
Product(Id,name);
Market(Id,name);
Product HABTM Market ( I
Show us your form view code and then echo your resulting data array
please.
HTH, Paul
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To
Hello,
i'm trying to start using HABTM in Cake 1.3, but can't understand how
can i add an realtion.
Im trynig to create new relation between User and Project records in
DB, but no data apperas in users_projects
after im saving data :(
My code is:
$data = array(
'User' = array('id' = 1
Hi Mondo,
Paul is right, you should model-ise your join table, effectively creating a
hasMany through association, since you're adding additional fields that
are not part of the table's foreign keys. You might want to read this:
http://book.cakephp.org/view/1650/hasMany-through-The-Join-Model
28, 7:51 pm, Mondo mo...@nodegarden.net wrote:
I have a Recipe, Item, and Units table/model. I have a HABTM
relationship with Recipe and Item, and I get the default multiple-
select box when adding/editing Recipe. (am using Bake for everything
for the most part). The problem is I need
a HABTM
relationship with Recipe and Item, and I get the default multiple-
select box when adding/editing Recipe. (am using Bake for everything
for the most part). The problem is I need to associate quantities and
units with each Item.
Sample of UI I'm hoping for:http://i.stack.imgur.com
I have a Recipe, Item, and Units table/model. I have a HABTM
relationship with Recipe and Item, and I get the default multiple-
select box when adding/editing Recipe. (am using Bake for everything
for the most part). The problem is I need to associate quantities and
units with each Item.
Sample
' = '',
'order' = ''
),
'User' = array(
'className' = 'User',
'foreignKey' = 'user_id',
'conditions' = '',
'fields' = '',
'order' = ''
)
);
But Cake isn't treating this anything like a HABTM relationship...
I have a normal HABTM relationship relating users and roles, (without a join
model manually
Well, I realized as soon as I posted that the reason the auth_sources_users
records aren't getting deleted is that their user_id fields are blank... so
I don't know if there's going to be a problem deleting the records or not...
But what am I doing wrong when saving the data using the
Ok, I'm getting a little closer. Some digging in more documentation brought
me to this array to use instead:
Array
(
[User] = Array
(
[email] = (my email here)
[first_name] = Ben
[last_name] = McClure
)
[AuthSource] = Array
(
The way Cake generates HABTM inputs was changed for 2.0. Its supposed
to be less magic, but it doesn't seem like that is the case in this
situation. Having some more information on the rest of the form might
help.
-Mark
On Aug 12, 3:23 pm, handsofaten bjud...@gmail.com wrote:
Hi - I'm working
Hi - I'm working with CakePHP 2.0 beta, and having some trouble with
the expected FormHelper functionality.
I have in my view something like this:
$i = 0;
foreach($terms as $term){
echo $this-Form-input('Term.'.$i.'.id');
$i++
}
From which I expect something like this to be generated:
input
, thus
replacing all previous tags added to the artist (this is how HABTM
normally works).
3) You want to do something different from 1 and 2 above.
In 1) you probably have to consider using a HasMany relationship
between Artist and ArtistTag instead of the HABTM between Artist and
Tag.
In 2) you
://bakery.cakephp.org/articles/bparise/2007/05/09/add-delete-habtm-behavior
seems like i'm on the right track. but
$this-Artist-habtmAdd('Tag', 1, 123456); //artist_id=1, tag id =
123456
does nothing.
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP
, which is mentioned at the bottom
of the page about saving HABTM data in the CakePHP book at:
http://book.cakephp.org/view/1034/Saving-Related-Model-Data-HABTM
Keep up the good work, enjoy,
John
On Aug 9, 8:27 pm, mr_robot robo...@radarboy.com wrote:
hi john. yea it's 1.
i have got it working
hi john
thanks for all the help (and the kind encouragement).
i kinda of worked out a solution, posting here for others:
$tag_count = count($artist['Tag']);
$artist = $this-Tags-checkforUpdates($artist);
if (count($artist['Tag'])$tag_count){
// first save all the tags
foreach($artist['Tag'] as
hi john
thanks for the answer. but i am doing this:
$artist['Tag'][1]['artist_id'] = 184287;
regards
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related
Yes, I saw that, but the book says you have to do it differently in
order to do it automatically.
You have to refer to the Artist like this:
[code]
$artist['Artist']['id'] = 184287;
[/code]
Observe that you should not just call the save method with the
$artist['Tag'] data only, but the full
. no luck adding the whole $artist array. it starts to do weird
stuff - adding values from the artist table into the artist_tags
table. very confusing.
will try build a form but this is all very strange - i assumed
relations would be straightforward...?
--
Our newest site for the
You have to populate the related models Id in your array, as it is
explained in the CakePHP book at:
http://book.cakephp.org/view/1034/Saving-Related-Model-Data-HABTM
So for each Tag record, add the related Artist record with just the
primary key of the Artist record.
Enjoy,
John
On Aug 5, 2
hi there
been pulling my hair out on this one for 2 days.
i have two simple models.
artist and tags.
and i have a artists_tags database table with artist_id and tag_id.
artist model
class Artist extends AppModel {
var $name = 'Artist';
var $hasAndBelongsToMany = array(
Hi,
I wonder if it's possible to get many HABTM relations working in a
single table ? For example I want my Products, Pages and News to be
paired as HABTM with my Images. So I have table named images_items
with a model named ImageItem and the table looks like this:
id - INT
item_id - INT
Hello,
-- in your controller function (add or edit):
...
$pharmacies = $this-Turn-Pharmacy-find('list');
// FOR SELECTED CHECKBOX : (only in edit)
$options['joins'] = array(
array('table' = 'pharmacies_turns',
'alias' = 'PharmaciesTurn',
'type' =
oups, I forgive a Categorie replacement.
You must read PharmaciesTurn instead of CategoriesTurn
On 27 juil, 09:50, BenJsno bench...@yahoo.fr wrote:
Hello,
-- in your controller function (add or edit):
...
$pharmacies = $this-Turn-Pharmacy-find('list');
// FOR SELECTED CHECKBOX : (only
Thank you very much!!! It's working and it's magic like some things in
Cake...
I have problems with save with HABTM, I published other post about it called
Checkbox múltiples + HABTM. Can you help with it?
Thanks!
era
--
Our newest site for the community: CakePHP Video Tutorials
http
Ben it's working the problem about save with HABTM!!! My problem was:
$pharmacy = new Pharmacy();
$this-set('pharmacies', $pharmacy-find('all'));
The value of the parameter 'all' wasn't working.
The next works!!!
$pharmacy = new Pharmacy();
$this-set('pharmacies', $pharmacy-find('all
it's working the problem about save with HABTM!!! My problem was:
$pharmacy = new Pharmacy();
$this-set('pharmacies', $pharmacy-find('all'));
The value of the parameter 'all' wasn't working.
The next works!!!
$pharmacy = new Pharmacy();
$this-set('pharmacies', $pharmacy-find('all
Hello! I want to show in the view a list of checkbox of Pharmacies to
assign to a Turn.
Example:
Turn: INPUT TEXT
Pharmacies:
CHKBOX1
CHKBOX2
CHKBOX3
Can help me with this?
Thanks!
eraonline
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the
Hello. I can't save multiple checkbox in HABTM.
My code is:
MODEL
?php
class Turn extends AppModel {
var $name = 'Turn';
var $hasAndBelongsToMany = array( 'Pharmacy' = array( 'className' =
'Pharmacy' ) );
var $validate = array(
'name' = array(
'rule' = 'notEmpty
Hi everyone,
I have being trying to solve this for the last 4 hours with no luck.
basically I have the following tables
users
links
users_links
Basically I'm trying to get the below query to run using find('all')
and paginate (I'm running this inside UserController)
SELECT
If you have defined a HABTM relationship your joining table should be
links_users (i.e. the tables are in alphabetical order).
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 21 Jul 2011, at 16:26, localhost wrote:
Hi everyone,
I have being trying to solve this for the last 4
a HABTM relationship your joining table should be
links_users (i.e. the tables are in alphabetical order).
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 21 Jul 2011, at 16:26, localhost wrote:
Hi everyone,
I have being trying to solve this for the last 4 hours
a HABTM relationship your joining table should be
links_users (i.e. the tables are in alphabetical order).
Jeremy Burns
Class Outfit
http://www.classoutfit.com
On 21 Jul 2011, at 16:26, localhost wrote:
Hi everyone,
I have being trying to solve this for the last 4 hours with no luck
' = ''
)
);
}
What do you mean by joining table should be links_users (i.e. the
tables are in alphabetical order) ?
On Jul 21, 6:31 pm, Jeremy Burns | Class Outfit
jeremybu...@classoutfit.com wrote:
If you have defined a HABTM relationship your joining table should be
links_users (i.e. the tables
completely the model for your join table - the UsersLink
model.
3) define a normal habtm relationship between the User model and the
Link model.
4) read the manual before you start another project - all of this is
clearly explained in many translations.
On Jul 21, 10:45 am, Jeremy Burns | Class Outfit
Ok, looking at the Mongo DB source code, it doesn't do any association
queries. So i'm written a behavior to solve it.
On Jul 18, 4:55 pm, LordG lordgthefi...@gmail.com wrote:
Hello Bakers,
I'm busy testing Models with MongoDB. I have two Models: Recipe and
Tag.
class Recipe extends
Hello Bakers,
I'm busy testing Models with MongoDB. I have two Models: Recipe and
Tag.
class Recipe extends AppModel {
var $name = 'Recipe';
var $mongoSchema = array(
'name' = array('type' = 'string'),
'description' = array('type' = 'string'),
Is CAKEPHP developer team planning to correct/adjust the _deleteLinks
function in the cake\libs\model\model.php ?
It ignores the conditions definition declared in the model.
-- Original code:
function _deleteLinks($id) {
foreach ($this-hasAndBelongsToMany as $assoc = $data) {
Hi.
I would like to paging products with multi Habtm.
My tables:
products
categories
colors
And HABTM connections
Product HABTM Categories products_categories
Product belongsTo Color
How do I make a query like the following? (width : Habtm Pagination)
Category.id = 3 and Color.id=4 all
You can either add a JOIN [1] query for each HABTM association you want to
filter on the pagination find, or BIND [2] the join table models
(ProductsCategory and ProductsColor) to the Product model as HasOne
associations before doing the pagination. Both would require to specify that
the join must
Hi,
I m not able to get good example for habtm.
I tried something.
$this-Post-unbindModel(array('hasAndBelongsToMany'=array('Tag')));
$this-Post-bindModel(
array(
'hasOne'=array(
'PostsTag'=array(
'foreignKey'=false
to get good example for habtm.
I tried something.
$this-Post-unbindModel(array('hasAndBelongsToMany'=array('Tag')));
$this-Post-bindModel(
array(
'hasOne'=array(
'PostsTag'=array(
'foreignKey'=false
, Prabha Vathi wrote:
Hi,
I m not able to get good example for habtm.
I tried something.
$this-Post-unbindModel(array('hasAndBelongsToMany'=array('Tag')));
$this-Post-bindModel(
array(
'hasOne'=array(
'PostsTag'=array
Hi,
In tagscontroller,
$this-paginate = array('conditions' = array('Post.status' =
'active','Tag.tag_machine_value' = $name),'limit' = 3);
$posts = $this-paginate('Post');
$this-set(compact('posts'));
Tag and Post model have hasAndBelongsToMany relation.
I am getting Unknown column
Any Help Please?
--
Our newest site for the community: CakePHP Video Tutorials
http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others
with their CakePHP related questions.
To unsubscribe from this group, send email to
HI
you can solve this problem usign custom query pagination.
you can search in google you will get many examples.
On Fri, Jun 24, 2011 at 10:02 PM, Prabha Vathi prabha.ridd...@gmail.comwrote:
Hi,
In tagscontroller,
$this-paginate = array('conditions' = array('Post.status' =
in Language Model instead of User Model
On Jun 14, 9:56 pm, Shaz shazam...@gmail.com wrote:
I have User HABTM Language, and i want to ensure during a User add /
edit they choose a minimum of one language, upto a maximum of 3. In
the user model, for $validate I've tried:
'Language
I haven't actually made models for the Join table - I don't think you
need to for a HABTM relationship
On Jun 15, 1:41 pm, Rob Maurer robmau...@gmail.com wrote:
Interesting. What would happen if you put the validation in the model
for the join table?
On Jun 14, 3:17 pm, Shaz shazam
You should check this:
http://bakery.cakephp.org/articles/nachopitt/2010/07/01/habtm-validatable-behavior
On 15 jun, 08:24, Shaz shazam...@gmail.com wrote:
I haven't actually made models for the Join table - I don't think you
need to for a HABTM relationship
On Jun 15, 1:41 pm, Rob Maurer
I have User HABTM Language, and i want to ensure during a User add /
edit they choose a minimum of one language, upto a maximum of 3. In
the user model, for $validate I've tried:
'Language' = array(
'multiple' = array(
'rule' = array
Write the Validation Rule in Language Model instead of User Model
On Jun 14, 9:56 pm, Shaz shazam...@gmail.com wrote:
I have User HABTM Language, and i want to ensure during a User add /
edit they choose a minimum of one language, upto a maximum of 3. In
the user model, for $validate I've
that validation; where I only want the
users to...
Thanks!
On Jun 14, 8:14 pm, hunny saurabh85maha...@gmail.com wrote:
Write the Validation Rule in Language Model instead of User Model
On Jun 14, 9:56 pm, Shaz shazam...@gmail.com wrote:
I have User HABTM Language, and i want to ensure during
Hi,
I'm using for my user table, username like PK and I have a HABTM
relationship between user and messages, but when I create a message, the
table messages_recipients is empty :(
any help??
best regards,
Jorge
--
View this message in context:
http://cakephp.1045679.n5.nabble.com/HABTM
I have the following relationships (habtm both ways):
User HABTM Groups
User HABTM Events
User HABTM Locations
So for example - I want to get users that belong to groupA, groupB and
locationX and paginate the results - whats the best way of
implementing it?
I'm trying to avoid using bindModel
Hi everyone,
I have a problem when using CakePHP HABTM.
I have the following models.
class Repositorio extends AppModel{
var $name=Repositorio;
var $hasAndBelongsToMany = array(
'Sesion' =
array(
'joinTable' = 'sesions_repositorios
Hi there,
Has anyone noticed any issues with the Miles J Uploader pluign (http://
milesj.me/code/cakephp/uploader) when used in forms that have HABTM
elements?
If I comment out the the habtm field the uploader works like a charm,
as soon is its present though it fails to upload the files return
Hi guys, I would like to make a
$this-MODEL-find call but would only like to bring back the items related
to that query and paginate the results.
I tried $this-paginate('Model', ('model.field' = 'value');
and then looped through the results but it looses the pagination on the
related
http://book.cakephp.org/view/1231/Pagination read this :)
--
Lep pozdrav, Tilen Majerle
http://majerle.eu
2011/5/6 Dee Johnson devario...@gmail.com
Hi guys, I would like to make a
$this-MODEL-find call but would only like to bring back the items related
to that query and paginate the
Not sure if you read the question fully or just didnt understand it but I
have already read ALL of that and frankly it is irrelevant. :)
My issue is not covered anywhere in the cake docs as i have seen. My
problem is similar to this guy and I am about to give this a whirl.
Hi guys, Im having a small issue here.
I have a model1 that HABTM model2
before I send the results to the view via a set, I run a foreach loop grab
the first bit of results and then another to get to the associated data.
the data array at that point (associated data only is being sent
record except few latest uncategorized
posts.
in the long run those 3 lines of code will crush your server.
perhaps you should look into habtm countercache.
although it is not implemented for habtm as core feature. i've come
across some articles with workarounds
do that and it will come down to one
zijn.digi...@gmail.com wrote:
On Thu, Apr 28, 2011 at 12:31 PM, david hc davi...@gmail.com wrote:
Hello,
I have a table posts related with table categories with de habtm table
posts_categories.
posts.id
categories.id
posts_categories.post_id
posts_categories.category_id
I'm trying
Only one more doubt...
Could I use the native cakephp paginator with this model function?
Thanx!
On 29 abr, 10:13, davidhc davi...@gmail.com wrote:
Thank you very much, cricket!
I have change your code:
$ids = Set::extract($this-PostCategory-find('all'),
'{n}.PostCategory.post_id');
with:
Ignore my previous message...
I have solved it with this http://bin.cakephp.org/view/471586323
Thank you again, cricket :D
David.
On 29 abr, 10:17, davidhc davi...@gmail.com wrote:
Only one more doubt...
Could I use the native cakephp paginator with this model function?
--
Our newest site
Hello,
I have a table posts related with table categories with de habtm table
posts_categories.
posts.id
categories.id
posts_categories.post_id
posts_categories.category_id
I'm trying to get all the records WITHOUT category (because I have
posts taken from RSS and not categorized yet).
My model
On Thu, Apr 28, 2011 at 12:31 PM, david hc davi...@gmail.com wrote:
Hello,
I have a table posts related with table categories with de habtm table
posts_categories.
posts.id
categories.id
posts_categories.post_id
posts_categories.category_id
I'm trying to get all the records WITHOUT
I wanted to save a HABTM model but without using a regular form.
Consider
Entity1 HABTM Entity2, so we have a DB table for entity1, one for
entity2 and one like entity1_entity2.
I construct my own array like:
[Entity1] = (field1, field2)
[Entity2] = (
[0] = (field1, field2)
[1] = (field1
Hi guys - any ideas? Am I doing this wrong, or is this just
inconsistent behaviour and I should raise a ticket?
cheers
On Apr 22, 7:26 pm, Tonu Tusk lvot...@googlemail.com wrote:
Hi there ...
so let's say I have
Cake habtm Ingredient
and
Ingredient habmt Cake
If I was to prep $data
Hi there ...
so let's say I have
Cake habtm Ingredient
and
Ingredient habmt Cake
If I was to prep $data such as
[Cake][id] = 1
[Ingredient] = array(1, 2, 3)
and did a
Cake-save($data)
this would delete any existing associating records in the join table
between these two models
Do you use saveAll on innoDb tables ? If not, actually set option
'atomic' = false.
Try first save with options validate = only and a second saveAll with
validate false.
On Apr 13, 12:06 am, Jeff jeffkw...@gmail.com wrote:
I've got an odd problem. I have tables/models names and projects with
in the join table in addition to the IDs.
The HABTM saves are so elegant that I'm hesitant to break them into
hasManys. In what ways is keeping it a HABTM limiting and at what
point should I switch it to two hasManys instead?
On Apr 12, 7:00 am, euromark dereurom...@googlemail.com wrote:
yes
201 - 300 of 2499 matches
Mail list logo