Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * Retireve count of collection loaded items
- *
- * @return int
- */
- public function count()
- {
- $this->load();
- return count($this->_items);
- }
- /**
- * Get collection size
- *
- * @return int
- */
- public function getSize()
- {
- if (is_null($this->_totalRecords)) {
- $sql = $this->getSelectCountSql();
- $this->_totalRecords = $this->getConnection()->fetchOne($sql, $this->_bindParams);
- }
- return intval($this->_totalRecords);
- }
- $collection = Mage::getModel('zzz/zzz')->getCollection();
- var_dump($collection->getSize());
- if (!$datas->getData() || empty($datas->getData())) {
- // do things
- }
- $collection = Mage::getModel('zzz/zzz')->getCollection();
- var_dump($collection->count());
- <?php
- if(isset($pro_collection) && count($pro_collection) > 0) {
- /* Your code here */
- }
- ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement