Skip to content
Permalink
Browse files

Removing incorrect method implementation.

Adding documentation to Component::beforeRedirect()
Adding documentation to ObjectCollection::trigger().
  • Loading branch information...
markstory committed Aug 11, 2010
1 parent 4463ff7 commit 74a12940cbfd14711e062bf41a1e22cfd9625b1e
Showing with 18 additions and 24 deletions.
  1. +15 −23 cake/libs/controller/component.php
  2. +3 −1 cake/libs/object_collection.php
@@ -95,7 +95,6 @@ public function __get($name) {
*
* @param object $controller Controller with components to initialize
* @return void
* @access public
* @link http://book.cakephp.org/view/998/MVC-Class-Access-Within-Components
*/
public function initialize(&$controller) { }
@@ -105,7 +104,6 @@ public function initialize(&$controller) { }
*
* @param object $controller Controller with components to startup
* @return void
* @access public
* @link http://book.cakephp.org/view/998/MVC-Class-Access-Within-Components
*/
public function startup(&$controller) { }
@@ -116,7 +114,6 @@ public function startup(&$controller) { }
*
* @param object $controller Controller with components to beforeRender
* @return void
* @access public
*/
public function beforeRender(&$controller) { }
@@ -125,32 +122,27 @@ public function beforeRender(&$controller) { }
*
* @param object $controller Controller with components to shutdown
* @return void
* @access public
*/
function shutdown(&$controller) { }
/**
* Called before Controller::redirect().
* Called before Controller::redirect(). Allows you to replace the url that will
* be redirected to with a new url. The return of this method can either be an array or a string.
*
* If the return is an array and contains a 'url' key. You may also supply the following:
*
* - `status` The status code for the redirect
* - `exit` Whether or not the redirect should exit.
*
* If your response is a string or an array that does not contain a 'url' key it will
* be used as the new url to redirect to.
*
* @param object $controller Controller with components to beforeRedirect
* @return void
* @param mixed $url Either the string or url array that is being redirected to.
* @param int $status The status code of the redirect
* @param bool $exit Will the script exit.
* @return mixed Either an array or null.
*/
public function beforeRedirect(&$controller, $url, $status = null, $exit = true) {
$response = array();
foreach ($this->_primary as $name) {
$component =& $this->_loaded[$name];
if ($component->enabled === true && method_exists($component, 'beforeRedirect')) {
$resp = $component->beforeRedirect($controller, $url, $status, $exit);
if ($resp === false) {
return false;
}
$response[] = $resp;
}
}
return $response;
}
public function beforeRedirect(&$controller, $url, $status = null, $exit = true) {}
}
@@ -54,7 +54,9 @@ abstract class ObjectCollection {
*
* - `breakOn` Set to the value or values you want the callback propagation to stop on.
* Defaults to `false`
* - `break` Set to true to enabled breaking.
* - `break` Set to true to enabled breaking. Defaults to `false`.
* - `collectReturn` Set to true to collect the return of each object into an array.
* This array of return values will be returned from the trigger() call. Defaults to `false`.
*
* @param string $callback Method to fire on all the objects. Its assumed all the objects implement
* the method you are calling.

0 comments on commit 74a1294

Please sign in to comment.
You can’t perform that action at this time.