Exemplo n.º 1
0
 /**
  * Initialize Accessor.
  *
  * @param   string      $id         element identifier (if null - "0" will be used)
  * @param   array       $relations  relations array array('near' => accessor, 'under' => accessor)
  * @param   Connection  $con        Sahi connection
  */
 public function __construct($id, array $relations, Connection $con)
 {
     parent::__construct($con);
     foreach ($relations as $relation => $accessor) {
         $this->{$relation}($accessor);
     }
     $this->id = $id;
 }
Exemplo n.º 2
0
 /**
  * Initialize Accessor.
  *
  * @param   string      $class      tag class name
  * @param   string      $tag        tag name
  * @param   array       $relations  relations
  * @param   Connection  $con        Sahi connection
  */
 public function __construct($class, $tag, array $relations, Connection $con)
 {
     parent::__construct($con);
     foreach ($relations as $relation => $accessor) {
         $this->{$relation}($accessor);
     }
     $this->class = $class;
     $this->tag = $tag;
 }
    /**
     * Initialize Accessor.
     *
     * @param string     $xpath     XPath expression
     * @param array      $relations Relations
     * @param Connection $con       Sahi connection
     */
    public function __construct($xpath, array $relations, Connection $con)
    {
        parent::__construct($con);

        foreach ($relations as $relation => $accessor) {
            $this->$relation($accessor);
        }

        $this->xpath = $xpath;
    }