Scalr\System\Zmq\Cron\Task\DbMsrMaintenance::enqueue PHP Method

enqueue() public method

public enqueue ( )
    public function enqueue()
    {
        $queue = new ArrayObject([]);
        $db = \Scalr::getDb();
        $rs = $db->Execute("\n            SELECT id FROM farm_roles\n            WHERE role_id IN (SELECT role_id FROM role_behaviors WHERE behavior IN (?,?,?,?))\n        ", [ROLE_BEHAVIORS::POSTGRESQL, ROLE_BEHAVIORS::REDIS, ROLE_BEHAVIORS::MYSQL2, ROLE_BEHAVIORS::PERCONA]);
        while ($row = $rs->FetchRow()) {
            $obj = new stdClass();
            $obj->id = $row["id"];
            $queue->append($obj);
        }
        if ($cnt = count($queue)) {
            $this->getLogger()->info("%d farm role%s with database behavior found", $cnt, $cnt == 1 ? '' : 's');
        }
        return $queue;
    }