Exemplo n.º 1
0
 public function __construct($postIds, $periodFirst, $periodSecond, $fetchEmps = true, $fetchSubEmps = true, $func)
 {
     if (!empty($postIds)) {
         $table = 'user_rp_tree_posts_employees_PM';
         if ($fetchEmps) {
             $this->rows = $this->_fetch('post_id', $postIds, $periodFirst, $periodSecond, $table);
             $treePosts = new Rp_Db_View_TreePosts();
             $this->postNames = $treePosts->fetchNames($postIds);
         }
         if ($fetchSubEmps) {
             $this->subRows = $this->_fetch('post_pid', $postIds, $periodFirst, $periodSecond, $table);
         }
         if ($func) {
             $table = 'user_rp_tree_posts_func';
             $this->subRows = $this->_fetch('post_func_id', $postIds, $periodFirst, $periodSecond, $table);
         }
     } else {
         if ($fetchEmps) {
             $this->rows = array();
         }
         if ($fetchSubEmps) {
             $this->subRows = array();
         }
         if ($func) {
             $this->subRows = array();
         }
     }
     $this->periodFirst = $periodFirst;
     $this->periodSecond = $periodSecond;
 }