# |
Aug 9th 2008, 04:07 |
skua |
that will give you an array with results you need |
# |
Aug 9th 2008, 04:06 |
skua |
then in your controller you do a $this->Medicine->find('all', array(yourconditions) ); |
# |
Aug 9th 2008, 04:06 |
ichsan |
skua: Ok then? |
# |
Aug 9th 2008, 04:05 |
skua |
hmmm create a model named Medicine.php |
# |
Aug 9th 2008, 04:05 |
ichsan |
$xobile = Medicine->find(3); |
# |
Aug 9th 2008, 04:05 |
ichsan |
Because, I see that CakePHP model is created from array |
# |
Aug 9th 2008, 04:04 |
ichsan |
.. |
# |
Aug 9th 2008, 04:04 |
ichsan |
more or less |
# |
Aug 9th 2008, 04:04 |
ichsan |
$xobile->current_stock() |
# |
Aug 9th 2008, 04:04 |
ichsan |
$xobile = new Medicine(xobile) |
# |
Aug 9th 2008, 04:03 |
ichsan |
Say, I have a medicine named xobile |
# |
Aug 9th 2008, 04:03 |
ichsan |
No |
# |
Aug 9th 2008, 04:03 |
skua |
you want to create a model function to return an array of the lastest stock directly from the controller right ? |
# |
Aug 9th 2008, 04:01 |
ichsan |
So, this function is a class method? not an instance method? |
# |
Aug 9th 2008, 04:00 |
skua |
in your controller to return data |
# |
Aug 9th 2008, 04:00 |
skua |
then $this->Medicine->latest_stock(); |
# |
Aug 9th 2008, 04:00 |
skua |
function latest_stock() in Medicine.php model |
# |
Aug 9th 2008, 04:00 |
ichsan |
Where should I put model's method of Medicine, named latest_stock()? |
# |
Aug 9th 2008, 03:53 |
Theaxiom |
hehe |
# |
Aug 9th 2008, 03:53 |
Martz |
ACTION charges like a wounded rino |
# |
Aug 9th 2008, 03:52 |
Martz |
no problems. That will be $16,525 please. |
# |
Aug 9th 2008, 03:52 |
Theaxiom |
ACTION feels stupid |
# |
Aug 9th 2008, 03:52 |
Theaxiom |
Martz that worked |
# |
Aug 9th 2008, 03:52 |
Theaxiom |
Martz thanks |
# |
Aug 9th 2008, 03:51 |
Martz |
Theaxiom: do you have a database configuration defined as "default"? |
# |
Aug 9th 2008, 03:51 |
Theaxiom |
skua do you have any idea? |
# |
Aug 9th 2008, 03:50 |
Theaxiom |
argh, I just tried baking another app and it is working, but not for this particular app...what is going on? |
# |
Aug 9th 2008, 03:48 |
Theaxiom |
I have MySQL ODBC driver installed properly, and it worked a couple weeks ago... |
# |
Aug 9th 2008, 03:48 |
Theaxiom |
http://bin.cakephp.org/view/1900076842 |
# |
Aug 9th 2008, 03:48 |
Theaxiom |
oops |
# |
Aug 9th 2008, 03:48 |
Theaxiom |
I am trying to bake my app, but I am getting this error, can someone please help? http://bin.cakephp.org/add/Theaxiom |
# |
Aug 9th 2008, 03:21 |
skua |
no |
# |
Aug 9th 2008, 03:20 |
JeffEmbracedDC |
you by chance use objective C? |
# |
Aug 9th 2008, 03:20 |
JeffEmbracedDC |
ha |
# |
Aug 9th 2008, 03:20 |
skua |
nobody's perfect :p |
# |
Aug 9th 2008, 03:19 |
skua |
it's not your fault |
# |
Aug 9th 2008, 03:19 |
JeffEmbracedDC |
I ain't french |
# |
Aug 9th 2008, 03:19 |
skua |
aye comme ça y est ? :D |
# |
Aug 9th 2008, 03:17 |
JeffEmbracedDC |
aye |
# |
Aug 9th 2008, 03:08 |
skua |
? |
# |
Aug 9th 2008, 03:08 |
skua |
you got it |