Model/ResourceModel/Automation/Collection.php
public function getCollectionByType($type, $limit)
    {
        $collection = $this->addFieldToFilter(
            'enrolment_status',
            [
                'in' => [
                    \Dotdigitalgroup\Email\Model\Sync\Automation::AUTOMATION_STATUS_PENDING,
                    \Dotdigitalgroup\Email\Model\Sync\Automation::CONTACT_STATUS_CONFIRMED
                ]
            ]
        )->addFieldToFilter(
            'automation_type',
            $type
        );
        //limit because of the each contact request to get the id
        $collection->getSelect()->limit($limit);

        return $collection;
    }
public function getCollectionByType($type, $limit)
    {
        $collection = $this->addFieldToFilter(
            'enrolment_status',
            [
                'in' => [
                    \Dotdigitalgroup\Email\Model\Sync\Automation::AUTOMATION_STATUS_PENDING,
                    \Dotdigitalgroup\Email\Model\Sync\Automation::CONTACT_STATUS_CONFIRMED
                ]
            ]
        )->addFieldToFilter(
            'automation_type',
            $type
        );
        //limit because of the each contact request to get the id
        $collection->getSelect()->limit($limit);

        return $collection;
    }
public function getCollectionByType ( $ type , $ limit ) { $ collection = $ this -> addFieldToFilter ( 'enrolment_status' , [ 'in' => [ \ Dotdigitalgroup \ Email \ Model \ Sync \ Automation :: AUTOMATION_STATUS_PENDING , \ Dotdigitalgroup \ Email \ Model \ Sync \ Automation :: CONTACT_STATUS_CONFIRMED ] ] ) -> addFieldToFilter ( 'automation_type' , $ type ) ; //limit because of the each contact request to get the id $ collection -> getSelect ( ) -> limit ( $ limit ) ; return $ collection ; }
Get collection by type.

@param string $type
@param string $limit

@return $this
Get collection by type .