Try this to get collection,
In your block add the below code
<?php
namespace Vendor\Module\Block;
use Magento\Framework\View\Element\Template;
class Block_Name extends Template{
public function __construct(
\Vendor\Module\Model\model_nameFactory $collectionFactory
) {
$this->collectionFactory = $collectionFactory;
}
public function getCheckoutSessiongetCollection($productId = '')
{
$collection = $this->collectionFactory->create()->getCollection()->addFieldToSelect('*')->addFieldToFilter('serial_number', array(
'eq' => '1'
));
//$this->collectionFactory->create()->getCollection()->addFieldToFilter('serial_number', '1');
$getCollection = array();
foreach ($collection as $item) {
$collection$getCollection[] = $item->getSomeText(); //Get some text
}
return $getCollection;
}}
Hope it helps :)