
Public Member Functions | |
| init () | |
| preSave ($create=false) | |
Static Public Member Functions | |
| static | addTo ($object, $action='') |
Public Attributes | |
| $_model = __CLASS__ | |
What you do is that you push in the queue an object and what was done on the object. Then later one, a simple script will go through the queue and will check if something has to be done for the given object.
For example, you have articles with for each articles a list of authors. You want to index the article with also the name of the authors. So it means that you need to update the index when an author is changed and when an article is changed. But you do not want to do the indexing of all the articles of an author when you update the author information (if this take 0.5s per article, with 100 articles, you would have to wait nearly 1 minute!).
So when you update an author you push in the queue: "author x has been updated". Then you have a script that will go in the queue, find that the author has been updated and index each of his articles.
| Pluf_Queue::init | ( | ) |
Reimplemented from Pluf_Model.
| Pluf_Queue::preSave | ( | $ | create = false |
) |
Hook run just before saving a model in the database.
Just overwrite it into your model to perform custom actions.
| bool | Create. |
Reimplemented from Pluf_Model.
| static Pluf_Queue::addTo | ( | $ | object, | |
| $ | action = '' | |||
| ) | [static] |
| Pluf_Queue::$_model = __CLASS__ |
Reimplemented from Pluf_Model.