/**
  * @param DleCategory $objDleCategory The DB ORM object to process
  */
 protected function process_object($objDleCategory)
 {
     // wp: term_taxonomy_id, term_id, description, parent
     // dl: id,               id,      descr,       parentid
     $wpTerms = $objDleCategory->LoadWpTerms();
     if (!$wpTerms) {
         throw QCallerException(QApplication::Translate("Failed to find the WpTerm object for DleCategory."));
     }
     $wpTermsParent = null;
     if ($objDleCategory->ParentidObject) {
         $wpTermsParent = $objDleCategory->ParentidObject->LoadWpTerms();
     }
     $intWpTermsParentId = 0;
     if ($wpTermsParent) {
         $intWpTermsParentId = $wpTermsParent->TermId;
     }
     // check if already copied
     if (!WpTermTaxonomy::QueryCount(QQ::AndCondition(QQ::Equal(QQN::WpTermTaxonomy()->TermId, $wpTerms->TermId), QQ::Equal(QQN::WpTermTaxonomy()->Parent, $intWpTermsParentId)))) {
         $objWpTermTaxonomy = new WpTermTaxonomy();
         $objWpTermTaxonomy->Initialize();
         // set defaults
         $objWpTermTaxonomy->TermId = $wpTerms->TermId;
         $objWpTermTaxonomy->Description = $objDleCategory->Descr;
         $objWpTermTaxonomy->Parent = $intWpTermsParentId;
         $objWpTermTaxonomy->Taxonomy = "category";
         $objWpTermTaxonomy->Count = 0;
         $objWpTermTaxonomy->Save();
         $this->intTermTaxonomyCount++;
     }
 }
 /**
  * Count WpTermTaxonomies
  * by Parent Index(es)
  * @param integer $intParent
  * @return int
  */
 public static function CountByParent($intParent)
 {
     // Call WpTermTaxonomy::QueryCount to perform the CountByParent query
     return WpTermTaxonomy::QueryCount(QQ::Equal(QQN::WpTermTaxonomy()->Parent, $intParent));
 }