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

why not return value in setter of UserModule (UserModule::__set()) as CComponent::__set() does #196

Open
abos5 opened this issue Oct 8, 2014 · 0 comments

Comments

@abos5
Copy link

abos5 commented Oct 8, 2014

public function __set($name,$value) {
    if(substr($name,-3)==='Url') {
      if(isset($this->_urls[substr($name,0,-3)]))
        $this->_urls[substr($name,0,-3)]=$value;
    }
    if(substr($name,-4)==='View') {
      if(isset($this->_views[substr($name,0,-4)]))
        $this->_views[substr($name,0,-4)]=$value;
    }

    //parent::__set($name,$value);
  }

could be :

public function __set($name,$value) {
    if(substr($name,-3)==='Url') {
      if(isset($this->_urls[substr($name,0,-3)]))
        return $this->_urls[substr($name,0,-3)]=$value;
    }
    if(substr($name,-4)==='View') {
      if(isset($this->_views[substr($name,0,-4)]))
        return $this->_views[substr($name,0,-4)]=$value;
    }

    return parent::__set($name,$value);
  }
@abos5 abos5 changed the title why not return value in setter of UserModule (UserModule::__set()) as CComponen why not return value in setter of UserModule (UserModule::__set()) as CComponent::__set() does Oct 8, 2014
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