Filtering by multiple associated data

2015-05-26 Thread ProFire
hey guys, is there a way to filter associated results with 2 tags? http://book.cakephp.org/3.0/en/orm/retrieving-data-and-resultsets.html#filtering-by-associated-data The documentation only shows 1 tag to filter. I'm hoping to filter with 2 tags, like articles with "Finance"

Model Behavior and filtering results in a DboSource class Options

2012-05-12 Thread kirill_z
I've noticed that _queryAssociation method, within DboSource class, calls linked models afterFind callback, but does not calls linked models behavior callbacks. IMHO, it can be potential risk when you protect some model with AclBehavior. Because, Model->find() method returns associated model data d

Re: Asset filtering CakePHP 2.0.5 / css.php not included anymore?

2012-01-09 Thread José Lorenzo
Use more advanced solutions like the AssetCompress plugin github.com/markstory/asset_compress -- 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 question

Asset filtering CakePHP 2.0.5 / css.php not included anymore?

2012-01-09 Thread LDSign
Hi there I've tried to enable the CSS asset filtering in CakePHP 2.0.5, but it doesn't work. "csspp" is placed in vendors. It seems the required file "css.php" in the webroot-dir is missing. Any hints? Or has the scheme changed in 2.0? Thank you, Frank -- Our

Re: Filtering Component - Correct way of filtering results between two dates

2011-12-13 Thread René Weber
e Paginator anymore. > > What would be the correct way of doing this? Please give me advise how and > into which direction I should proceed to solve this issue... I am kind of > stuck and I would love to somehow add this to theFilteringand not to > create a hack in my Controller

Filtering Component - Correct way of filtering results between two dates

2011-12-01 Thread web_rene
y database. But if I do unset created_before and _after, they won't be saved to the session ( this is handled by filtering component aswell ) and I can not use Paginator anymore. What would be the correct way of doing this? Please give me advise how and into which direction I should proceed t

Re: filtering model result bases on user rights

2011-10-20 Thread Timmay
Sorry for my late respons, I would have expected a notification when someone replies to my post. I solved the problem using joins, like Zaky suggested. I use the beforeFind method in my docs model to modify the select query. It adds the join and some extra criteria, so that the model cannot return

Re: filtering

2011-09-23 Thread WebbedIT
AJAX work I reccomend you have FireBug installed so you can see what data is being fired. On Sep 23, 9:25 am, Elizebert Eona wrote: > I want to do filtering using ajax. Do u have any idea/advice/suggestion? > > On 23 September 2011 16:19, WebbedIT wrote: > > > > > > >

Re: filtering

2011-09-23 Thread Elizebert Eona
I want to do filtering using ajax. Do u have any idea/advice/suggestion? On 23 September 2011 16:19, WebbedIT wrote: > Do you want to do this with AJAX or full page load? > > HTH, Paul. > > On Sep 23, 2:49 am, ms_liz_87 wrote: > > Can anyone give me any idea how I w

Re: filtering

2011-09-23 Thread WebbedIT
Do you want to do this with AJAX or full page load? HTH, Paul. On Sep 23, 2:49 am, ms_liz_87 wrote: > Can anyone give me any idea how I want to do a filtering? example: > after i select one 1st cat, it will show all list under 1st cat. -- Our newest site for the community: CakePHP

filtering

2011-09-22 Thread ms_liz_87
Can anyone give me any idea how I want to do a filtering? example: after i select one 1st cat, it will show all list under 1st cat. -- 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

Re: filtering model result bases on user rights

2011-09-16 Thread WebbedIT
Can you give us an overview of how you have declared the relationships of those 4 tables? I.e. r u using HABTM or hasMany <-> belongsTo? On Sep 16, 4:28 am, Zaky Katalan-Ezra wrote: > For the list result you join docs and docs token and check that the user > tokens are IN the join result. > To p

Re: filtering model result bases on user rights

2011-09-15 Thread Zaky Katalan-Ezra
For the list result you join docs and docs token and check that the user tokens are IN the join result. To prevent url changes I suggest 1. use uuid as document id. 2. Create a function in the database that take user_id and doc_id and return true/false Call this function in documents/view or edit.

Re: filtering model result bases on user rights

2011-09-15 Thread Timmay
the example I gave is a simplified version of the real situation. The real situation is that a user has two sets of tokens (lets say A and B). These properties are stored in another table, named user_tokens. A document also has two sets of tokens (lets also call them A and B). These properties ar

Re: filtering model result bases on user rights

2011-09-15 Thread Zaky Katalan-Ezra
How do you save the permissions in the database? On Thu, Sep 15, 2011 at 10:53 AM, Timmay wrote: > Hi all, > > I'm working on a multi user website with a collection of documents. > Every user is only allowed to see a subset of the documents. > > I want the Documents model to only return the docu

filtering model result bases on user rights

2011-09-15 Thread Timmay
Hi all, I'm working on a multi user website with a collection of documents. Every user is only allowed to see a subset of the documents. I want the Documents model to only return the documents that a user is allowed to see. If a users requests one particular document, and he doesn't have rights t

Re: data filtering

2011-07-09 Thread krisspnet
://cakephp.1045679.n5.nabble.com/data-filtering-tp4563439p4567611.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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

data filtering

2011-07-08 Thread Plastika
/cakephp.1045679.n5.nabble.com/data-filtering-tp4563439p4563439.html Sent from the CakePHP mailing list archive at Nabble.com. -- 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 t

Filtering search results by using checkboxes

2011-05-26 Thread MeatSandwich
Hey there everyone. I'm a bit of a newb so apologies if this question is a bit simple, although I can't get my head round how to go about doing it. I have a search page where a user can type in a search box, or they can use an alphabetical list to search for the record they're looking for. Eg the

Re: Plan for adding filtering/search capabilities to index.ctp view

2011-01-23 Thread Zaky Katalan-Ezra
Never used myself but check this. cakedc search plugin -- 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

Re: Plan for adding filtering/search capabilities to index.ctp view

2011-01-23 Thread cricket
On Sun, Jan 23, 2011 at 12:58 PM, opike wrote: > I have a view that will potentially be displaying thousands of records > and I want to add search/filtering controls to the top of the index > view. I'm working with cake 1.3.7 and I did some preliminary research > and it doesn&#x

Plan for adding filtering/search capabilities to index.ctp view

2011-01-23 Thread opike
I have a view that will potentially be displaying thousands of records and I want to add search/filtering controls to the top of the index view. I'm working with cake 1.3.7 and I did some preliminary research and it doesn't appear that 1.3.7 provides this type of functionality out of

Re: Filtering by related model...

2011-01-09 Thread Amit Badkas
Hi, Could you please show me the structure of categories table. I need to know surely if Product belongs to Category or Product has many Category or Product has and belongs to many Category. Amit Badkas PHP Applications for E-Biz: http://www.sanisoft.com On Sat, Jan 8, 2011 at 1:25 AM, TSG w

Filtering by related model...

2011-01-07 Thread TSG
I know I've read this somewhere, but I've been searching for an hour now and cannot find it. I have a Product model I have a Category model A product can have many categories The categories table has a field, slug, that is used for SEO purposes. I currently have a beautifully formatted, paginat

Re: Behavior afterFind not filtering data?

2010-07-31 Thread Dr. Loboto
> I've discovered this because I'm attempting to run batches through the > Console. So, I'm only using a Shell script and the Model in question > and I'm definitely getting "?" where I should be getting ™. I've > verified that my database.php file is using 'encoding'  => 'iso-8859-1' > and that my

Re: Behavior afterFind not filtering data?

2010-07-31 Thread cricket
On Fri, Jul 30, 2010 at 11:03 AM, DragonFlyEye wrote: > Ok, the problem appears to be that somewhere in the bowels of > CakePHP's Models, it doesn't seem to like certain characters and just > replaces them with "?" > > I've discovered this because I'm attempting to run batches through the > Consol

Re: Behavior afterFind not filtering data?

2010-07-30 Thread DragonFlyEye
have problems with data entry in the future, like cutting > and pasting from Word. Plus there is some resistence to changing > things around here that I've got to slowly overcome. In the meanwhile, > I have to be able to show progress. > > The result I'm getting is exactly the sam

Re: Behavior afterFind not filtering data?

2010-07-22 Thread DragonFlyEye
be able to show progress. The result I'm getting is exactly the same as the original query. IOW: as though the filtering isn't happening. I've intentionally put errors in the code to make sure that the Model that it's being declared in is correctly identifying the file, whi

Re: Behavior afterFind not filtering data?

2010-07-22 Thread cricket
You haven't said what results you're seeing. Anyway, at a glance, I can see one problem. Sanitize::clean($results); should be: $results = Sanitize::clean($results); But, wouldn't it be simpler to just write a script that cleans up the DB once and forget about it? On Thu, Jul 22, 2010 at 2:06 P

Behavior afterFind not filtering data?

2010-07-22 Thread DragonFlyEye
I'm sure I'm missing something silly, but I cannot get this Behavior to work. I've got data with a bunch of nasty characters in the database that I need to avoid or escape before presenting to the browser. Also, it's got a lot of white space at the end of much of the data because someone erroneousl

Re: filtering

2010-07-08 Thread james livsey
What sort of filtering and for what are you after? > > On Jul 8, 10:08 am, james wrote: > > Hi I am also looking for some advice on filtering. Are these the best > > tutorials? > > > > thanks. > > Check out the new CakePHP Questions site http://cakeqs.org and help other

Re: filtering

2010-07-08 Thread Shaz
What sort of filtering and for what are you after? On Jul 8, 10:08 am, james wrote: > Hi I am also looking for some advice on filtering. Are these the best > tutorials? > > thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP relat

filtering

2010-07-08 Thread james
Hi I am also looking for some advice on filtering. Are these the best tutorials? thanks. Check out the new CakePHP Questions site http://cakeqs.org and help others with their CakePHP related questions. You received this message because you are subscribed to the Google Groups "CakePHP&q

Re: Filtering results in a list

2010-06-16 Thread Sam
http://book.cakephp.org/view/835/image Ad the 'url' option to the options array for your image. echo $html->image('icons/new.png', array( 'alt'=>'New Product Icon', 'width'=>$logo_size[0], 'height'=>$logo_size[1], 'border'=>'0', 'class'=>'ProductLogo', 'url' => array('?'=>$queryString_newproducts

Filtering results in a list

2010-06-16 Thread DSG
Hi all I am a complete newbie on this. I have inherited some code and it now needs altering. At present the code generates a product list and some of the items in the list are new products. At the top of the list is an icon and text that becomes the link that allows you to view just the new produc

Re: Filtering queries with hasMany relationships and pagination

2009-09-14 Thread Teh Treag
es Ive found of doing this suggest returning the entire > result set then using PHP to do the filtering. This isn't necessarily > a problem if there is a way to do pagination with the resulting data. > I just haven't seen any examples of paginating an array of data that > isn&

Filtering queries with hasMany relationships and pagination

2009-09-14 Thread tiberium911
mostly hasMany associations and I need to be able to use filters with those types of associations. The only examples Ive found of doing this suggest returning the entire result set then using PHP to do the filtering. This isn't necessarily a problem if there is a way to do pagination wit

Re: Searching and filtering on "id" -- problem with form behavior (forms helper)

2009-07-15 Thread geste
 So I got the notion to qualify each input with the model name > > like so: > > > echo $form->create('Budgets',array('url'=>array('action'=>'index'))); > > echo $form->input('Budget.id'); > > echo $form->

Re: Searching and filtering on "id" -- problem with form behavior (forms helper)

2009-07-15 Thread Carlos Gonzalez Lavin
both inputs appear but neither are applied by the filter when I hit >> search. So I got the notion to qualify each input with the model name >> like so: >> >> echo $form->create('Budgets',array('url'=>array('action'=>'index'))); >>

Re: Searching and filtering on "id" -- problem with form behavior (forms helper)

2009-07-15 Thread Carlos Gonzalez Lavin
cho $form->create('Budgets',array('url'=>array('action'=>'index'))); > echo $form->input('Budget.id'); > echo $form->input('Budget.budget_name'); > echo $form->end('Search'); > > Now I get 1 inp

Re: Searching and filtering on "id" -- problem with form behavior (forms helper)

2009-07-15 Thread Bernardo Vieira
> like so: > > echo $form->create('Budgets',array('url'=>array('action'=>'index'))); > echo $form->input('Budget.id'); > echo $form->input('Budget.budget_name'); > echo $form->end('Search'); >

Searching and filtering on "id" -- problem with form behavior (forms helper)

2009-07-15 Thread geste
got the notion to qualify each input with the model name like so: echo $form->create('Budgets',array('url'=>array('action'=>'index'))); echo $form->input('Budget.id'); echo $form->input('Budget.budget_name'); echo $form-&

Re: Filtering pagination

2009-07-14 Thread thatsgreat2345
Just set it in the session On Jul 14, 3:06 am, Arnau wrote: > Hi! > > I need paginated lists, and I see Cake really helps with it. > I use a searcher that filters the list and when I change the page the > filter dissapears. > I see I need to send the conditions of the filter from one page to > a

Filtering pagination

2009-07-14 Thread Arnau
Hi! I need paginated lists, and I see Cake really helps with it. I use a searcher that filters the list and when I change the page the filter dissapears. I see I need to send the conditions of the filter from one page to another but I think is not a very good idea to pass all the information usin

Re: HABTM filtering on find()

2009-07-06 Thread Teh Treag
centro, This is covered in the manual. http://book.cakephp.org/view/78/Associations-Linking-Models-Together#hasAndBelongsToMany-HABTM-83 Good luck. -teh On Jul 6, 2:01 am, centr0 wrote: > I have a Book and Author model thats a many to many relationship.  I > was wondering if there was a way i

HABTM filtering on find()

2009-07-06 Thread centr0
I have a Book and Author model thats a many to many relationship. I was wondering if there was a way in the BooksController that i can filter out books by author name, and in the AuthorsController filter out authors by book title. --~--~-~--~~~---~--~~ You received

Filtering results based on ACL

2009-06-10 Thread Saviq
Hi all, I'm using the Acl component for some of my models to have CRUD control. Now I need to filter results based on read rights to a model, I was thinking $model->afterFind() would be a good place, but I can't access the Acl component from within a model. What would be a proper way to do that?

Filtering subform values

2009-05-08 Thread Ernesto
Hello. i have a simple view with a form like this input("Order.Code"); for ($i = 0, $i < 10, $i++) { echo $form->input("Order_Items.". $i .".Code"); echo $form->checkbox("Order_Items.". $i .".Bargain"); } ?> the view returns an array like this Array => ( [Order] => Arra

Re: Smarty not filtering

2009-04-20 Thread timtrice
I see I have files in my 'tmp/smart/compile' directory. I don't know if that helps narrow it down...hopefully On Apr 20, 5:06 pm, timtrice wrote: > Miles, > > I've avoided using Smarty in Cake for almost a year, now.  But I have > an application that has become rather tiresome to sort thorugh w

Re: Smarty not filtering

2009-04-20 Thread timtrice
Miles, I've avoided using Smarty in Cake for almost a year, now. But I have an application that has become rather tiresome to sort thorugh with all of the programming code (foreach loops, switches, etc.). While I would prefer to not have to use another system inside of a system (because of prob

Re: Smarty not filtering

2009-04-20 Thread timtrice
blckspder, I don't think it's code as my application is running fine. I'm simply using: {$title_for_layout} inside my default template. I was following the tutorial located > (http://bakery.cakephp.org/articles/view/the-cakephp-blog-tutorial- with-smarty). I have the latest version of Smarty w

Re: Smarty not filtering

2009-04-20 Thread Miles J
Im still baffled why people would use smarty within a framework. Smart is horrible. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.com To un

Re: Smarty not filtering

2009-04-20 Thread blckspder
ariables inside the {} are not > executing.  it's all showing up as text.  Anyone happen to have a > quick solution?  I've Googled "smarty not filtering", "smarty not > parsing" among other things and nothing seems to explain what the deal > is. > > Thanks

Smarty not filtering

2009-04-20 Thread timtrice
? I've Googled "smarty not filtering", "smarty not parsing" among other things and nothing seems to explain what the deal is. Thanks --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP

Re: find('list'): Filtering by a related table's field

2009-04-19 Thread AD7six
On Apr 19, 1:42 am, mattalexx wrote: > Okay, thanks. > > By the way, there is nothing about recursion on that page. That's why it'd be useful if you could add something. Cheers, AD --~--~-~--~~~---~--~~ You received this message because you are subscribed to t

Re: find('list'): Filtering by a related table's field

2009-04-18 Thread mattalexx
Okay, thanks. By the way, there is nothing about recursion on that page. On Apr 17, 4:22 pm, AD7six wrote: > On Apr 17, 11:49 pm, mattalexx wrote: > > > 'all joins the other table and doesn't give me an error. 'list' on the > > other hand, does not join the table and therefore 'array > > ('Pro

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread AD7six
On Apr 17, 11:49 pm, mattalexx wrote: > 'all joins the other table and doesn't give me an error. 'list' on the > other hand, does not join the table and therefore 'array > ('Property.mls' => '80578'),' is not available. find('list') has a default recrusive value of -1 Please add to the docs h

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread mattalexx
'all joins the other table and doesn't give me an error. 'list' on the other hand, does not join the table and therefore 'array ('Property.mls' => '80578'),' is not available. On Apr 17, 3:41 pm, fain182 wrote: > > PropertyImage hasOne Property. > > > Why can't I do this: > > > > // APP/control

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread fain182
> PropertyImage hasOne Property. > > Why can't I do this: > > // APP/controllers/properties_controllers.php > $check_property_images = $this->PropertyImage->find('list', array( >        'fields' => array('id'), >        'conditions' => array( >                array('Property.mls' => '80578'), >  

Re: find('list'): Filtering by a related table's field

2009-04-17 Thread mattalexx
array() ); } ?> On Apr 17, 12:43 am, John Andersen wrote: > How is your PropertyImage model defined? > Does it have a hasMany to the Property model? > > I am asking, because your fields definition does not contain the model > name, and the conditions definition contains Property

Re: find('list'): Filtering by a related table's field

2009-04-16 Thread John Andersen
How is your PropertyImage model defined? Does it have a hasMany to the Property model? I am asking, because your fields definition does not contain the model name, and the conditions definition contains Property model name, not PropertyImage model name. John On Apr 17, 6:29 am, mattalexx wro

find('list'): Filtering by a related table's field

2009-04-16 Thread mattalexx
PropertyImage hasOne Property. Why can't I do this: PropertyImage->find('list', array( 'fields' => array('id'), 'conditions' => array( array('Property.mls' => '80578'), ), )); debug($check_property_images); ?> But when I use find('all') it

filtering with the containable behavior

2009-04-02 Thread RyOnLife
t_id' => $vl_id ), //'limit' => 3, 'contain' => array('VideoItem.Video') )); Can someone please clue me in on a workable way to get that result? -- View this message in context: http://n2.nabble.com/filtering-with-the-containable-behavior-tp2578823p2

Re: Querying / filtering an array done by find('threaded')

2009-03-31 Thread toka...@gmail.com
Okay, I got it!! I don't know if there is some Cake's better solution but this works fine for me I have made my own function that goes trough the whole threaded array and extracts childs for top level section specified by ID. /** * Extracts child node(s) for specific top level section id

Re: Querying / filtering an array done by find('threaded')

2009-03-30 Thread toka...@gmail.com
I have tried also $this->Section->children($id), that seems to be ok, but it doesnt generate such nice nested structure like find ('threaded'). Is there any change to filter threaded array similar way like getting childs from the tree? Tnkx Tomas --~--~-~--~~~---~--~--

Querying / filtering an array done by find('threaded')

2009-03-30 Thread Tokasa
> 4 [parent_id] => 1 [name] => Computer ) ) ) ) ) Thanks a lot! Tomas -- View this message in context: http://www.nabble.com/Querying---filtering-an-

Re: Filtering by HABTM model count

2009-03-27 Thread grigri
When you use the `bindModel` call, use a different alias. Example: $this->bindModel(array('hasOne'=>array( 'AlbumsImageBacon'=>array( 'className' => 'AlbumsImage' ), 'ImageBacon'=>array( 'className'=>'Image', 'fo

Filtering by HABTM model count

2009-03-26 Thread volve
My problem: Show the user 4 Albums where each Album has >= 1 Images. I started this project in CakePHP 1.1 and realized quickly I couldn't create an elegant solution, so I've recently upgraded to 1.2.2 and am trying again. My code below works correctly and returns a wonderful array with all the

Filtering by paths.

2009-01-14 Thread atlantageek
Is there a method to filter access to certain web pages in a cake application using apache. --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups "CakePHP" group. To post to this group, send email to cake-php@googlegroups.c

Re: Pagination & Filtering Conditions

2008-12-03 Thread Juan Sierra
I post here the way I solved in case someone found it useful as well. I was reading several of the solutions available on the group but none of them was working 100% for me, so I tried to figure it out the best I could: in the controller: class ExpensesController extends AppController { ... va

Pagination & Filtering Conditions

2008-11-27 Thread Juan Sierra
Hi there, I'm trying to do a very simple thing, I'm sure there is something important missing - I just started a few days ago with CakePHP. I want to display an expenses table with pagination and two controls for filtering the year and month. The filtering works fine, the paginati

Re: CSS aggregation / asset filtering

2008-11-18 Thread Dardo Sordi Bogado
Hi, On Tue, Nov 18, 2008 at 4:00 PM, the_woodsman <[EMAIL PROTECTED]> wrote: > > Hey Bakers, > > I came across Asset/filter.css in my core file, and thought I'd try > and get it working - so far no luck! > I'm assuming its supposed to aggregate all my CSS files into one big > one? > > I've saved

CSS aggregation / asset filtering

2008-11-18 Thread the_woodsman
Hey Bakers, I came across Asset/filter.css in my core file, and thought I'd try and get it working - so far no luck! I'm assuming its supposed to aggregate all my CSS files into one big one? I've saved the csspp file in the vendors/csspp/csspp.php I did find the core setting a bit confusing -

Re: Filtering controller

2008-10-14 Thread machuidel
Hi David, Thank you. That was very helpful. I added the following route: Router::connect('/countries/:country_id/cities/*', array('controller' => 'cities')); This route points to the following function inside the "cities" controller: function index() { $this->City->rec

Re: Filtering controller

2008-10-14 Thread David C. Zentgraf
http://book.cakephp.org/view/542/Defining-Routes Your route would look something like: Router::connect('/countries/:country_id/cities/*', array('controller' => 'cities', 'action' => 'someCityAction')); The 'country_id' will be available in $this->params in the controller. On 15 Oct 2008, at

Filtering controller

2008-10-14 Thread machuidel
Hello, How can I map a controller to an URL like "/countries/12/cities/" such that the index of cities will be filtered by the specified country? I would like that URL to dispatch the "city" controller (not the "country" controller) with the specified country as its argument. Something like: cla

Re: Filtering on sub table

2008-09-29 Thread glenda guo
n models when you create relation with >> models. >> >> If you don't know how to use the query result in view, you can use print_r >> function to print the results, then you can know how to use it. >> Also , you can reference this page >> http://book.cakeph

Re: Filtering on sub table

2008-09-28 Thread Mickael Gentil
uery result in view, you can use print_r > function to print the results, then you can know how to use it. > Also , you can reference this page > http://book.cakephp.org/view/78/Associations-Linking-Models-Together > > > > > > > On Sun, Sep 28, 2008 at 4:30 PM, Mickael Gen

Re: Filtering on sub table

2008-09-28 Thread glenda guo
ew/78/Associations-Linking-Models-Together On Sun, Sep 28, 2008 at 4:30 PM, Mickael Gentil <[EMAIL PROTECTED]>wrote: > Ok, but the conditions are for the select and not for filtering datas wich > is the result from this select, no ? > > And on my view what name for my select i can

Re: Filtering on sub table

2008-09-28 Thread Mickael Gentil
Ok, but the conditions are for the select and not for filtering datas wich is the result from this select, no ? And on my view what name for my select i can use ? Because $this->ProgramBroadcaster->Program->ProgramFile->ProgramState is a very deeper relationship. Thanks. Yudao. On

Re: Filtering on sub table

2008-09-27 Thread glenda guo
$this->set('programStateList', $this->ProgramBroadcaster-> Program->ProgramFile->ProgramState->find('list')); You can add condition in it. On Sat, Sep 27, 2008 at 10:43 PM, Mickael Gentil <[EMAIL PROTECTED]>wrote: > Hi all, > > I need some help with a problem. > > This is my controller : > >

Filtering on sub table

2008-09-27 Thread Mickael Gentil
Hi all, I need some help with a problem. This is my controller : 20, 'page'=>1, 'order'=>'ProgramBroadcaster.created DESC', 'fields'=>array('id','broadcaster_id','program_id','play_date','delivery_date','case_number','video_tape_number'), 'contain'=>

Re: Paginator w/ Filtering

2008-09-11 Thread Mark
tp://groups.google.com/group/cake-php/browse_thread/thread/b78215bd... > > http://groups.google.com/group/cake-php/browse_thread/thread/78633ae5... > > On Sep 11, 1:41 pm, Mark <[EMAIL PROTECTED]> wrote: > > > Hi guys, > > > I'm trying to get paginat

Re: Paginator w/ Filtering

2008-09-11 Thread [EMAIL PROTECTED]
?lnk=gst&q=paginate+search#6913a6cf3958b4b9 http://groups.google.com/group/cake-php/browse_thread/thread/78633ae512f6e4e1/81a9ce4d83332fb6?lnk=gst&q=paginate+search#81a9ce4d83332fb6 On Sep 11, 1:41 pm, Mark <[EMAIL PROTECTED]> wrote: > Hi guys, > > I'm trying to

Paginator w/ Filtering

2008-09-11 Thread Mark
Hi guys, I'm trying to get pagination working with filtering/conditions/where- clause. Here's the solution I've got so far: 2, 'order' => array('Article.created' => 'desc') ); function index() {

Filtering on HABTM

2008-04-29 Thread [EMAIL PROTECTED]
I have two model with HABTM relationship. I would use findAll with condition on this relation. I have found many posts on this but there isn't noone very clear. Is someone that can learn clearly how do this? Many thanks --~--~-~--~~~---~--~~ You received this messag

Filtering hasMany tables

2008-04-18 Thread matw8
G'day all, I've written a telco billing system using CakePHP (which made life very easy! Hooray for Cake!) and I have run into an issue while writing some reports. I have customers A Customer hasMany ServiceNumbers A ServiceNumber hasMany CallRecords The problem is that I don't want ALL the Cal

Re: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread Nasko
grigri, I've upgraded my CakePHP core to current beta: rev. 6311 and can verify that what you suggested works just fine! AD7six, grigri, thank you both for your help! On Feb 11, 2:24 pm, grigri <[EMAIL PROTECTED]> wrote: > What version are you using? I just did a quick test using my > playgroun

Re: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread Nasko
I'm using rev. 5693. Didn't want to upgrade whenever a newer revision appeared in the branch, and when the pre-beta was released we were close to finishing the project - I didn't want to take the risk of missing deadlines by fixing backward inconsistencies, etc. Your example produced identical er

Re: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread grigri
What version are you using? I just did a quick test using my playground database, and this: $this->set('test', $this->Tag->find('count', array('conditions' => array('2=2','3=3'), 'recursive' => 0, 'fields' => array('(COUNT(DISTINCT Tag.parent_id)) AS count'; Generated this SQL: SELECT (

Re: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread Nasko
grigri, I tried this an got this SQL query: SELECT Array, 1, COUNT(DISTINCT User.id) AS count, `User`., `User`.`id` FROM `users` AS `User` LEFT JOIN `groups` AS `Group` ON (`User`.`group_id` = `Group`.`id`) LEFT JOIN `genders` AS `Gender` ON (`User`.`gender_id` = `Gender`.`id`) LEFT JOIN `countr

Re: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread grigri
the frequent > discussion page :) The thing is I've actually read that specific > discussion (plus a bunch of other threads/articles), but because I > also read that specific thread back half an year ago when searching > for a solution to a different problem - the trivial filtering of

Re: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread Nasko
cause I also read that specific thread back half an year ago when searching for a solution to a different problem - the trivial filtering of HABTM model - I haven't paid attention to the extra info on how to setup multiple joins. This time I just browsed the first couple of lines and thou

Re: Help needed with filtering by (multiple) a HABTM model(s)

2008-02-11 Thread AD7six
ssociation model - that > could be used to filter by the foreign habtm model, but the problem is > that all articles or discussions in the groups I've read are dealing > with a single HABTM association on which the filtering is done. > > In my case I couldn't paginate or fin

Help needed with filtering by (multiple) a HABTM model(s)

2008-02-10 Thread Nasko
discussions in the groups I've read are dealing with a single HABTM association on which the filtering is done. In my case I couldn't paginate or findAll() via the habtm model, because I have search conditions in other models associated with 'Post' - e.g. I need all posts be

Re: HABTM filtering with indirect model relationship

2008-02-07 Thread Dardo Sordi Bogado
o put the dummy bindModel() in the beforeFind() > function in Model2. Then I did my paginate() call on Model2, but of > course now I'm querying the wrong data because I really need > paginate() support for Model1. Arg. > > Has anyone had any success solving this problem? I'

HABTM filtering with indirect model relationship

2008-02-06 Thread patcoll
as anyone had any success solving this problem? I've seen lots of solutions for filtering between two models that have a HABTM relationship and the dummy bindModel() calls seem to work for that, but this problem seems to be a different animal. Any ideas? --~--~-~--~~~--

RE: Filtering views to show selected data

2007-12-05 Thread Gould, Adrian
Thanks Adam will give it a go (well, will forward the answer to the person who needed to know). Adrian -Original Message- From: cake-php@googlegroups.com on behalf of Adam Royle Sent: Thu 12/6/2007 12:46 To: Cake PHP Subject: Re: Filtering views to show selected data Use

Re: Filtering views to show selected data

2007-12-05 Thread Adam Royle
Use bindModel() to define the conditions. Something like this... $this->User->bindModel(array('hasMany' => array('Loan' => array('conditions' => array('on_loan' => 'L'); $users = $this->User->findAll(); Adam On Dec 6, 1:17 pm, "Gould, Adrian" <[EMAIL PROTECTED]> wrote: > When retrieving the

Filtering views to show selected data

2007-12-05 Thread Gould, Adrian
When retrieving the information for a User, we get associated models, such as "loans". The view is the Users (for a particulat ID), with hasMany Loans, and Equipment hasMany Loans. How can I filter the loans model to give me only those which have been marked as "L" for on loan. User (id, na

  1   2   >