# |
Aug 9th 2008, 04:16 |
Theaxiom |
skua Thank you |
# |
Aug 9th 2008, 04:15 |
kabturek |
Theaxiom: you did use google/groups ? |
# |
Aug 9th 2008, 04:15 |
skua |
theaxiom .. try $this->here = $this->here.DS in app_controller.php |
# |
Aug 9th 2008, 04:15 |
ichsan |
Thanks |
# |
Aug 9th 2008, 04:15 |
ichsan |
Ok, I got that |
# |
Aug 9th 2008, 04:15 |
Theaxiom |
Facebook appends to my links, it won't break them? |
# |
Aug 9th 2008, 04:15 |
Theaxiom |
I have an issue, Facebook appends "?and_fb_fromhash=ade2ac6fdb307c1b18556d20090dd9ed" to all of my links, and it breaks everything in the application because it will turn a link like http://apps.new.facebook.com/exquisitesoftware/DEV/_arrested/quotes/add into http://apps.new.facebook.com/exquisitesoftware/DEV/_arrested/quotes/add?and_fb_fromhash=ade2ac6fdb307c1b18556d20090dd9ed - does anyone know how I can at least put a / after the original link so when |
# |
Aug 9th 2008, 04:14 |
ichsan |
kalileo: So, that's how CakePHP handle methods of a model instance |
# |
Aug 9th 2008, 04:12 |
kalileo |
your method would be, as skua started to explain, $data = $this->Medicine->latest_stock($condition); and in your $condition you would put the id or similar of your xobile |
# |
Aug 9th 2008, 04:12 |
ichsan |
kalileo: I'm looking for a clean way to describe behaviours of medicine model |
# |
Aug 9th 2008, 04:12 |
kabturek |
ichsan: generally no and yes ;) |
# |
Aug 9th 2008, 04:11 |
kalileo |
ichsan: dunno what your after |
# |
Aug 9th 2008, 04:10 |
ichsan |
So, is it possible to create instance methods? Not class methods. I mean methods that belong to an object not a class |
# |
Aug 9th 2008, 04:10 |
kalileo |
you would just do a $this->Medicine->find($condition) and give the condition the id or similar of your xobile |
# |
Aug 9th 2008, 04:09 |
kalileo |
ichsan: if you write it that way that is not what you usually do |
# |
Aug 9th 2008, 04:08 |
ichsan |
kalileo: I know, it's just a pseudo |
# |
Aug 9th 2008, 04:08 |
kalileo |
The Medicine Model is automatically there |
# |
Aug 9th 2008, 04:08 |
kalileo |
ichsan: in cake you would not do that usually: $xobile = new Medicine(xobile) |
# |
Aug 9th 2008, 04:08 |
skua |
you should use countercache |
# |
Aug 9th 2008, 04:07 |
ichsan |
not other medicine |
# |
Aug 9th 2008, 04:07 |
ichsan |
The function is meant to return the stock of that medicine. The xobile medicine |
# |
Aug 9th 2008, 04:07 |
ichsan |
No, the result is not an array |
# |
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 |