Hi,
Ok I managed solution.
Thanks
On Thursday, January 29, 2015 at 8:26:57 PM UTC+5:30, Cake Developer wrote:
>
> Hi Mark Story,
>
> any help please?
>
> thanks
>
> On Friday, January 23, 2015 at 6:02:46 PM UTC+5:30, Cake Developer wrote:
>>
>> Hi Josh,
>>
>> I tried both PlumSearch and Search P
Hi Mark Story,
any help please?
thanks
On Friday, January 23, 2015 at 6:02:46 PM UTC+5:30, Cake Developer wrote:
>
> Hi Josh,
>
> I tried both PlumSearch and Search Plugin in my application and they are
> not working as expected.
>
> They are adding search arguments in existing conditions in qu
Hi Josh,
I tried both PlumSearch and Search Plugin in my application and they are
not working as expected.
They are adding search arguments in existing conditions in query object.
Failing Situation.
Existing condition has Users.active = 1 and If new condition array has
Users.active = 0 so this
What have you tried so far?
On Friday, January 23, 2015 at 9:25:21 AM UTC+1, Cake Developer wrote:
>
> Hi Experts,
>
> Can anyone solve my problem please?
>
--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
---
You received this message becau
Hi Experts,
Can anyone solve my problem please?
--
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 receivin
t;>
>> I am trying to write a generic solution to filter records with less code.
>> Is there any way to get original conditions from query object as an array
>> format.
>>
>> For e.g.
>>
>> $this->paginate = ['conditions'=>['Users.acti
ts.
>
> I am trying to write a generic solution to filter records with less code.
> Is there any way to get original conditions from query object as an array
> format.
>
> For e.g.
>
> $this->paginate = ['conditions'=>['Users.active'=>1]];
>
.
$this->paginate = ['conditions'=>['Users.active'=>1]];
I want original conditions in beforeFind method like
function beforeFind(Event $event, Query $query, $options, $primary) {
$orgCondtions = $query->clause('where'); //it re
to hint the beforeFind() or any other finder method
on what to do or overwrite. That way you can avoid traversing the
conditions tree.
If you are in absolute need of inspecting the where clause and modifying
stuff, you will need to do as follows:
$query->clause('where')->t
t; I guess the best way I can help you find the best strategy is if you
> mention what exactly you are trying to do :D
> On Thursday, January 15, 2015 at 3:26:09 PM UTC+1, Cake Developer wrote:
>>
>> Hello,
>>
>> I am trying to get and modify query conditions in beforeFi
;", Active, Inactive) etc these should be anything based on
configuration
[Search][Reset] buttons
Users data in HTML table
Searchable Behaviour
FYI- In Search Component I attach a Search behaviour with current model
table and pass predefined Search Form Fields(same we displayed in
available from the previous finder, I can add more
conditions here based on that
}
}
I guess the best way I can help you find the best strategy is if you
mention what exactly you are trying to do :D
On Thursday, January 15, 2015 at 3:26:09 PM UTC+1, Cake Developer wrote:
>
> Hello,
&
Hello,
I am trying to get and modify query conditions in beforeFind function of
Behaviour.
function beforeFind(Event $event, Query $query, $options, $primary) {
// here is what I tried so far.
$conditions = $query->clause('where');
// this gives me Object of Expression Interface
oogle.com/group/cake-php?hl=en .
If you reply to this email, your
message will be added to the discussion below:
http://cakephp.1045679.n5.nabble.com/add-subquery-to-every-find-statement-in-beforeFind-tp5712054.html
Hi,
i have a model which belongs to another like "model car belongs to
rent-time".
in table for rent-time there are two timestamps (start and end).
now i want to modify every find-statement for model car and add a subquery
like this:
select *, (select id from rent-time where start >= time() and
I was wondering if anyone has used the Expandable Behavior and created
a beforeFind() method that allows you to pull meta data through a
condition, as follows:
$this->Upload-
>find('first',array('conditions'=>array('UploadField.key' =>
'width'
I have two different models, Skatepark and Weather. I am calling $this-
>Skatepark->read(). The Weather's beforeFind() never gets called but
it's afterFind() does. Any ideas why this is happening?
Check out the new CakePHP Questions site http://cakeqs.org and help others wit
cket`.`ticket_status` = 'New' AND
> `Ticket`.`ticket_support_group_id` = 2 AND `Ticket`.`ticket_status` !=
> 'Deleted' AND ((`Ticket`.`ticket_client_group_id` = 84) AND
> (`ClientUser`.`user_group_id` = 204) AND (((`Ticket`.`ticket_openedby`
> = 1024) OR (`Ticket`.`ticket
s` !=
'Deleted' AND ((`Ticket`.`ticket_client_group_id` = 84) AND
(`ClientUser`.`user_group_id` = 204) AND (((`Ticket`.`ticket_openedby`
= 1024) OR (`Ticket`.`ticket_client_user_id` = 1024 LIMIT 51
On 21 Aug, 09:24, Adrian wrote:
> Hi
>
> I am trying to set my contain array f
Btw when I add debug($queryData); it confirms the contain array is
present:
app\models\ticket.php (line 175)
Array
(
[conditions] => Array
(
[Ticket.ticket_status] => New
)
[fields] => Array
(
[0] => Ticket.ticket_id
)
[joins]
Hi
I am trying to set my contain array from within the models beforeFind
() callback so a certain model is always contained. I have the
following code:
function beforeFind($queryData) {
// Always contain the client user
if(empty($queryData['co
Be aware of this bug when using beforeFind in a behavior to to
permission stuff:
https://trac.cakephp.org/ticket/2056
If you really want to do such things. To it in afterFind with array
filtering (see Set:: and array_)
Have fun and good luck.
On Aug 13, 2:14 pm, subnoodle wrote:
> Hello,
&g
ds of a
model. And exactly there is the difference:
Model::beforeFind($queryData) => this appears as the only one in api-
doc
ModelBehavior::beforeFind(&$model,$query)
For me, i really couldn't guess that the header of the one beforeFind
is different than another beforeFind-Header, si
nditions'][$model->alias.'.YOUR_FIELD' = 'YOUR_CONDITION';
... should be:
$queryData['conditions'][$this->alias.'.YOUR_FIELD'] = 'YOUR_CONDITION';
... when it's in Model::beforeFind(). When in a Behavior's
beforeFind(), you
" in models in general way.
>
> > So, i put some filtering in beforeFind, first.
> > SInce i regognized, that parameter $queryData does not work as
> > expected.
>
> > In CakeDoc is described, that queryData is an arrray of find-
> > parameters. But is
On Thu, Aug 13, 2009 at 8:14 AM, subnoodle wrote:
>
> Hello,
> i'd like to add "ownership-support" in models in general way.
>
> So, i put some filtering in beforeFind, first.
> SInce i regognized, that parameter $queryData does not work as
> expecte
Hello,
i'd like to add "ownership-support" in models in general way.
So, i put some filtering in beforeFind, first.
SInce i regognized, that parameter $queryData does not work as
expected.
In CakeDoc is described, that queryData is an arrray of find-
parameters. But is '
For anyone that's interested, I decided to go a completely different
route:
http://www.sitepoint.com/forums/showthread.php?t=608370
On Mar 19, 1:49 pm, Miles J wrote:
> Oops I meant to say "Your not able to pass controller data to the
> behavior". I was thinking something like this.
>
> In the
Oops I meant to say "Your not able to pass controller data to the
behavior". I was thinking something like this.
In the controller:
$this->Model->data['Thumbnail'] = array('image', 294, 200);
Then in then behavior, grab that data.
$Model->data['Thumbnail'];
--~--~-~--~~
Something like this?
loadModel('IndustryLink');
$this->IndustryLink->actsAs['Thumbnail'] = array('image', 294, 200);
$industry_links = $this->IndustryLink->find('all', array(
'conditions' => array('IndustryLink.active <>' => '0'),
));
?>
This seems to work, but is there a better
Your not able to pass controller data to the model. You should store
the data into the Model object and then use that.
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups
"CakePHP" group.
To post to this group, send email
I have a table named 'IndustryLinks'. Each record in that table
corresponds to an image file of the company's logo. I store these
image files in a directory on the server's filesystem.
I have created (rather, I'm trying to create) a behavior class to
handle the action of thumbnailing these image
I'd say that beforeFind should be used for thing that you want to run
at all times.
Instead of doing this in beforeFind you might want to create a custom
find which is a good way to enforce custom logic to the find operation
while leaving any associations and other internal queries alone.
t;http://book.cakephp.org/view/73/Retrieving-Your-Data
>
> > On Feb 1, 11:59 am, Fred wrote:
>
> > > I am using BeforeFind in my Model to filter based on criteria for a
> > > logged in user. This works great and I love how easy this is to do...
> > > However, I
Fred
On Feb 1, 4:33 pm, Miles J wrote:
> In your find() queries, you can add a parameter: 'callbacks' => false
>
> http://book.cakephp.org/view/73/Retrieving-Your-Data
>
> On Feb 1, 11:59 am, Fred wrote:
>
> > I am using BeforeFind in my Model to filter based
In your find() queries, you can add a parameter: 'callbacks' => false
http://book.cakephp.org/view/73/Retrieving-Your-Data
On Feb 1, 11:59 am, Fred wrote:
> I am using BeforeFind in my Model to filter based on criteria for a
> logged in user. This works great and I love how
I am using BeforeFind in my Model to filter based on criteria for a
logged in user. This works great and I love how easy this is to do...
However, I am running into a problem. There are certain times that I
don't want to add the filter. For example I have a tree of company's
that a user
Hey All,
I have a model, hasMany associated-model, and I'm finding when using
the beforeFind callback inside associated-model, it is called more
times than I'm expecting. For each associated record found it is
called (with results like [0][associated-model]), and then for all
t
On Jan 25, 5:57 pm, powtac <[EMAIL PROTECTED]> wrote:
> In the beforeFind() I delete some data of the current user which
> should only be in the database for 60 minutes.
> But when I want to take a look on the data as admin I dont want to
> delete anything...
In your mo
Write wrappers for the find() function in your Library model.
function adminFind() {
return $this->find();
}
fuction userFind() {
$this->deleteStuff();
return $this->find();
}
On Jan 25, 9:57 am, powtac <[EMAIL PROTECTED]> wrote:
> In the beforeFind() I delete some data o
In the beforeFind() I delete some data of the current user which
should only be in the database for 60 minutes.
But when I want to take a look on the data as admin I dont want to
delete anything...
--~--~-~--~~~---~--~~
You received this message because you are
it to, which
DOES know if the user is an administrator or not.
What are you doing in your model's beforeFind() that needs to be
deactivated for administrators?
On Jan 25, 4:11 pm, powtac <[EMAIL PROTECTED]> wrote:
> Hi red,
> I'm sorry this seems not to be working in the
Hi red,
I'm sorry this seems not to be working in the (1.2) model:
Undefined property: library::$params
How can I access to the params in model?
powtac
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" gro
Don't know any. But you can still put this 'global' things in global
AppController.
On 25 Sty, 16:49, powtac <[EMAIL PROTECTED]> wrote:
> Great! Thanks.
>
> Is there an other more global solution to prevent before*() after*()
> functions to be executed?
--~--~-~--~~~-
16:39, powtac <[EMAIL PROTECTED]> wrote:
> How can I avoid the execution of any before*() function in the modell
> when calling an admin function in ancontroller?
>
> Example:http://www.example.com/admin/libraries/
>
> In my Libraries-controller I have a function named admin
Great! Thanks.
Is there an other more global solution to prevent before*() after*()
functions to be executed?
--~--~-~--~~~---~--~~
You received this message because you are subscribed to the Google Groups "Cake
PHP" group.
To post to this group, send email to cak
How can I avoid the execution of any before*() function in the modell
when calling an admin function in ancontroller?
Example:
http://www.example.com/admin/libraries/
In my Libraries-controller I have a function named admin_index().
Now the beforeFind() in my model "Library" is cal
d twice in the same
> form. To differentiate between the two ajax call, the [modelname]
> [fieldname] needs to be different. Since I can't change the way the
> Ajax method makes the call, I though I'd use beforeFind in the model
> to return "SELECT fieldname AS tempname WHERE...".
I'm using Ajax calls from the same table and field twice in the same
form. To differentiate between the two ajax call, the [modelname]
[fieldname] needs to be different. Since I can't change the way the
Ajax method makes the call, I though I'd use beforeFind in the model
to
a join on User.id is invoked before users is
aliased?
the JOIN to relationships is shoved into the query via a beforeFind()
call - it just adds the hardcoded sql into $queryData["joins"] (in
theory this is to filter the display of data by a user's social
network). is there a way to get
Do not modify the queryData as the parameter, but instead return the
modified data:
function beforeFind($queryData)
{
if (!empty($queryData['fields']))
{
foreach ($this->fieldsRequired as $required_field)
{
mikee
On 23/02/07, Mikee Freedom <[EMAIL PROTECTED]> wrote:
> afternoon all,
>
> a very simple one. all i would like to do is make sure certain fields
> are being included in any read / find / findAll. Could someone have a
> look at the code and see where my problem might lie?
afternoon all,
a very simple one. all i would like to do is make sure certain fields
are being included in any read / find / findAll. Could someone have a
look at the code and see where my problem might lie?
function beforeFind(&$queryData)
{
if (!empty($queryData[
53 matches
Mail list logo