public function getItemsFromRequest($array) { $items = array(); foreach ($array as $id) { $item = \Concrete\Core\Block\BlockType\BlockType::getByID($id); if (is_object($item)) { $blockType = new \PortlandLabs\Concrete5\MigrationTool\Entity\Export\BlockType(); $blockType->setItemId($item->getBlockTypeID()); $items[] = $blockType; } } return $items; }
public function get($itemsToGet = 0, $offset = 0) { if (!$this->includeInternalBlockTypes) { $this->filter('btIsInternal', false); } $r = parent::get($itemsToGet, intval($offset)); $blocktypes = array(); foreach ($r as $row) { $bt = BlockType::getByID($row['btID']); if (is_object($bt)) { $blocktypes[] = $bt; } } return $blocktypes; }
public function getBlockTypes() { $db = Loader::db(); $r = $db->Execute('select btID from BlockTypeSetBlockTypes where btsID = ? order by displayOrder asc', $this->getBlockTypeSetID()); $types = array(); while ($row = $r->FetchRow()) { $bt = BlockType::getByID($row['btID']); if (is_object($bt)) { $types[] = $bt; } } return $types; }
/** * @param FileList $list * @param $request */ public function filterList(ItemList $list) { $bt = BlockType::getByID($this->data['btID']); $list->filterByBlockType($bt); }
public function getRssUrl($b, $tool = 'rss') { $uh = Loader::helper('concrete/urls'); if (!$b) { return ''; } $btID = $b->getBlockTypeID(); $bt = BlockType::getByID($btID); $c = $b->getBlockCollectionObject(); $a = $b->getBlockAreaObject(); $rssUrl = $uh->getBlockTypeToolsURL($bt) . "/" . $tool . "?bID=" . $b->getBlockID() . "&cID=" . $c->getCollectionID() . "&arHandle=" . $a->getAreaHandle(); return $rssUrl; }