Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

__::bind() and __::bindAll() #6

Open
jrschumacher opened this issue Mar 20, 2012 · 0 comments
Open

__::bind() and __::bindAll() #6

jrschumacher opened this issue Mar 20, 2012 · 0 comments

Comments

@jrschumacher
Copy link

By implementing a references couldn't these two functions be implemented?

I can see a situation where they may be useful as a type of observer similar to backbone, although limited.

// My Model definitions
$person = new PersonModel();

$persons = new PersonsCollection();
$persons->add($person);

//... somewhere in the controller
public function broadcast() {
  $args = func_get_args();
  $persons = $args[0];
  $v1 = $args[1];
  $v2 = $args[2];
  $v3 = $args[3];
}

// add some controller events
__::bind($this->addRole, array(&$person), 1, 2, 3);
__::bind($this->broadcast, array(&$persons), 1, 2, 3);

Thinking about this more it may just be outside the scope of this project for bindAll, too many systems needed to manage events and triggering events.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant