/**
  * @param int $uploadId
  * @param array $options (OPT_* supported)
  * @param string $uploadTreeTableName
  */
 public function __construct($uploadId, $options, $uploadTreeTableName, $uploadTreeViewName = null)
 {
     $this->uploadId = $uploadId;
     $this->uploadTreeTableName = $uploadTreeTableName;
     $dbViewName = $uploadTreeViewName ?: 'UploadTreeView' . (isset($this->dbViewName) ?: '');
     $dbViewQuery = $this->createUploadTreeViewQuery($options, $uploadTreeTableName);
     parent::__construct($dbViewQuery, $dbViewName);
 }
 public function testAsCTE()
 {
     assertThat($this->dbViewDao->asCTE(), is("WITH {$this->dbViewName} AS (" . $this->dbViewQuery . ")"));
 }
 /**
  * @param ItemTreeBounds $itemTreeBounds
  * @param array $constraints
  * @param string $viewSuffix
  */
 public function __construct(ItemTreeBounds $itemTreeBounds, $constraints = array(), $viewSuffix = null)
 {
     $dbViewQuery = self::getUploadTreeView($itemTreeBounds, $constraints);
     parent::__construct($dbViewQuery, 'UploadTreeView' . ($viewSuffix ? '.' . $viewSuffix : ''));
 }