Exemple #1
0
 function getMailContent($title)
 {
     // table Folder
     $tblFolder = new Kutu_Core_Orm_Table_Folder();
     $where = $tblFolder->getAdapter()->quoteInto("title=?", $title);
     $rowFolder = $tblFolder->fetchRow($where);
     // table CatalogFolder
     $tblCatalogFolder = new Kutu_Core_Orm_Table_CatalogFolder();
     $find = $tblCatalogFolder->getAdapter()->quoteInto("folderGuid=?", $rowFolder->guid);
     $rowCatFolder = $tblCatalogFolder->fetchRow($find);
     if (isset($rowCatFolder)) {
         $catalogGuid = $rowCatFolder->catalogGuid;
     } else {
         $catalogGuid = '';
     }
     // table Catalog
     $tblCatalog = new Kutu_Core_Orm_Table_Catalog();
     $rowCatalog = $tblCatalog->find($catalogGuid)->current();
     // table ProfileAttribute
     $tblProfileAttributes = new Kutu_Core_Orm_Table_ProfileAttribute();
     $search = $tblProfileAttributes->getAdapter()->quoteInto("profileGuid=?", $rowCatalog->profileGuid);
     $rowsetProfileAttributes = $tblProfileAttributes->fetchAll($search, array('viewOrder ASC'));
     $rowsetCatalogAttribute = $rowCatalog->findDependentRowsetCatalogAttribute();
     $i = 0;
     foreach ($rowsetProfileAttributes as $row) {
         $rowCatalogAttribute = $rowsetCatalogAttribute->findByAttributeGuid($row->attributeGuid);
         $rowAttribute = $row->findParentRow('Kutu_Core_Orm_Table_Attribute');
         if (isset($rowCatalogAttribute->value)) {
             $attributeValue = $rowCatalogAttribute->value;
         } else {
             $attributeValue = '';
         }
         $mailcontent = $attributeValue;
         $i++;
     }
     return $mailcontent;
 }