Source for file jSelectorActFast.class.php

Documentation is available at jSelectorActFast.class.php

  1. <?php
  2. /**
  3. * see jISelector.iface.php for documentation about selectors.
  4. @package     jelix
  5. @subpackage  core_selector
  6. @author      Laurent Jouanneau
  7. @contributor Thibault Piront (nuKs)
  8. @copyright   2005-2012 Laurent Jouanneau
  9. @copyright   2007 Thibault Piront
  10. @link        http://www.jelix.org
  11. @licence    GNU Lesser General Public Licence see LICENCE file or http://www.gnu.org/licenses/lgpl.html
  12. */
  13.  
  14. /**
  15.  * Special Action selector for jcoordinator
  16.  * Don't use it ! Only for internal purpose.
  17.  * @internal
  18.  * @package    jelix
  19.  * @subpackage core_selector
  20.  */
  21. class jSelectorActFast extends jSelectorModule {
  22.     protected $type = 'act';
  23.     /**
  24.      * @var string type of request
  25.      */
  26.     public $request = '';
  27.     public $controller = '';
  28.     public $method='';
  29.     protected $_dirname='actions/';
  30.  
  31.     /**
  32.      * @var string $requestType type of request ('classic', 'soap'...)
  33.      */
  34.     function __construct($requestType$module$action){
  35.         $this->module = $module;
  36.         $r explode(':',$action);
  37.         if(count($r== 1){
  38.             $this->controller = 'default';
  39.             $this->method = $r[0]==''?'index':$r[0];
  40.         }else{
  41.             $this->controller = $r[0]=='' 'default':$r[0];
  42.             $this->method = $r[1]==''?'index':$r[1];
  43.         }
  44.         if (substr($this->method,0,2== '__')
  45.             throw new jExceptionSelector('jelix~errors.selector.method.invalid'$this->toString());
  46.         $this->resource = $this->controller.':'.$this->method;
  47.         $this->request = $requestType;
  48.         $this->_createPath();
  49.     }
  50.  
  51.     protected function _createPath(){
  52.         if(!isset(jApp::config()->_modulesPathList[$this->module])){
  53.             throw new jExceptionSelector('jelix~errors.selector.module.unknown'$this->toString());
  54.         }else{
  55.             $this->_path = jApp::config()->_modulesPathList[$this->module].'controllers/'.$this->controller.'.'.$this->request.'.php';
  56.         }
  57.     }
  58.  
  59.     protected function _createCachePath(){
  60.         $this->_cachePath = '';
  61.     }
  62.  
  63.     public function toString($full=false){
  64.         if($full)
  65.             return $this->type.':'.$this->module.'~'.$this->resource.'@'.$this->request;
  66.         else
  67.             return $this->module.'~'.$this->resource.'@'.$this->request;
  68.     }
  69.  
  70.     public function getClass(){
  71.         return $this->controller.'Ctrl';
  72.     }
  73.  
  74.     public function isEqualTo(jSelectorActFast $otherAction{
  75.         return ($this->module == $otherAction->module &&
  76.                 $this->controller == $otherAction->controller &&
  77.                 $this->method == $otherAction->method &&
  78.                 $this->request == $otherAction->request
  79.                 );
  80.     }
  81. }

Documentation generated on Wed, 04 Jan 2017 22:56:37 +0100 by phpDocumentor 1.4.3