oDb = new BxDolStudioFormsQuery(); $this->_oLabel = BxDolLabel::getInstance(); $this->_iParent = bx_get('parent') !== false ? (int)bx_get('parent') : 0; $this->_aQueryAppend['parent'] = $this->_iParent; $this->_aParent = array(); if(!empty($this->_iParent)) $this->_aParent = $this->_oLabel->getLabels(array('type' => 'id', 'id' => $this->_iParent)); } protected function _delete ($mixedId) { $aChildren = $this->_oLabel->getLabels(['type' => 'parent', 'parent' => $mixedId]); if(!empty($aChildren) && is_array($aChildren)) foreach($aChildren as $aChild) $this->_delete($aChild['id']); $this->_oLabel->onDelete($mixedId); return parent::_delete($mixedId); } protected function _getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage) { $this->_aOptions['source'] .= $this->oDb->prepareAsString(" AND `parent`=?", $this->_iParent); return parent::_getDataSql($sFilter, $sOrderField, $sOrderDir, $iStart, $iPerPage); } } /** @} */