Esempio n. 1
0
 /**
  * Function returns all the blocks for the module
  * @return <Array of Vtiger_Block_Model> - list of block models
  */
 public function getBlocks()
 {
     if (empty($this->blocks)) {
         $blocksList = array();
         $moduleBlocks = Vtiger_Block_Model::getAllForModule($this);
         foreach ($moduleBlocks as $block) {
             $blocksList[$block->get('label')] = $block;
         }
         $this->blocks = $blocksList;
     }
     return $this->blocks;
 }
Esempio n. 2
0
 /**
  * Function to retrieve block instances for a module
  * @param <type> $moduleModel - module instance
  * @return <array> - list of Vtiger_Block_Model
  */
 public static function getAllForModule($moduleModel)
 {
     $blockObjects = parent::getAllForModule($moduleModel);
     $blockModelList = array();
     if ($blockObjects) {
         foreach ($blockObjects as $blockObject) {
             $blockModelList[] = self::getInstanceFromBlockObject($blockObject);
         }
     }
     return $blockModelList;
 }