original_string: public function aliasCallback($pattern, $path, $alias)
      {
          if (!empty($alias['entity']) && !empty($alias['entity_id'])) {
              if (strpos($pattern, "{$alias['entity']}/") === 0) {
                  $this->callController($pattern, array($alias['entity_id']));
              }
          }
  
          if (!isset($alias)) {
  
              $arguments = array();
  
              if (gplcart_path_match($path, $pattern, $arguments)) {
                  $conditions = array(strtok($pattern, '/'), reset($arguments));
                  $sql = 'SELECT alias FROM alias WHERE entity=? AND entity_id=?';
                  $alias_path = $this->db->fetchColumn($sql, $conditions);
              }
  
              if (!empty($alias_path)) {
                  $this->url->redirect($alias_path);
              }
          }
      }
code: public function aliasCallback($pattern, $path, $alias)
      {
          if (!empty($alias['entity']) && !empty($alias['entity_id'])) {
              if (strpos($pattern, "{$alias['entity']}/") === 0) {
                  $this->callController($pattern, array($alias['entity_id']));
              }
          }
  
          if (!isset($alias)) {
  
              $arguments = array();
  
              if (gplcart_path_match($path, $pattern, $arguments)) {
                  $conditions = array(strtok($pattern, '/'), reset($arguments));
                  $sql = 'SELECT alias FROM alias WHERE entity=? AND entity_id=?';
                  $alias_path = $this->db->fetchColumn($sql, $conditions);
              }
  
              if (!empty($alias_path)) {
                  $this->url->redirect($alias_path);
              }
          }
      }
code_tokens: public function aliasCallback ( $ pattern , $ path , $ alias ) { if ( ! empty ( $ alias [ 'entity' ] ) && ! empty ( $ alias [ 'entity_id' ] ) ) { if ( strpos ( $ pattern , "{$alias['entity']}/" ) === 0 ) { $ this -> callController ( $ pattern , array ( $ alias [ 'entity_id' ] ) ) ; } } if ( ! isset ( $ alias ) ) { $ arguments = array ( ) ; if ( gplcart_path_match ( $ path , $ pattern , $ arguments ) ) { $ conditions = array ( strtok ( $ pattern , '/' ) , reset ( $ arguments ) ) ; $ sql = 'SELECT alias FROM alias WHERE entity=? AND entity_id=?' ; $ alias_path = $ this -> db -> fetchColumn ( $ sql , $ conditions ) ; } if ( ! empty ( $ alias_path ) ) { $ this -> url -> redirect ( $ alias_path ) ; } } }
docstring: Route alias callback
  @param string $pattern
  @param string $path
  @param array $alias
docstring_tokens: Route alias callback