concrete/src/Block/Block.php
public function queueForDefaultsUpdate($data, $queue, $includeThisBlock = true)
    {
        $blocks = [];
        $db = \Database::connection();
        $rows = $db->GetAll('select cID, max(cvID) as cvID, cbRelationID from CollectionVersionBlocks where cbRelationID = ? group by cID order by cID', [$this->getBlockRelationID()]);

        $oc = $this->getBlockCollectionObject();
        $ocID = $oc->getCollectionID();
        $ocvID = $oc->getVersionID();

        foreach ($rows as $row) {
            $row2 = $db->GetRow('select bID, arHandle from CollectionVersionBlocks where cID = ? and cvID = ? and cbRelationID = ?', [
                $row['cID'], $row['cvID'], $row['cbRelationID'],
                ]);

            if ($includeThisBlock || ($row['cID'] != $ocID || $row['cvID'] != $ocvID || $row2['arHandle'] != $this->getAreaHandle() || $row2['bID'] != $this->getBlockID())) {
                $blocks[] = [
                    'cID' => $row['cID'],
                    'cvID' => $row['cvID'],
                    'cbRelationID' => $row['cbRelationID'],
                    'bID' => $row2['bID'],
                    'arHandle' => $row2['arHandle'],
                    'data' => $data,
                ];
            }
        }

        $name = $queue->getName();
        $queue->deleteQueue();
        $queue = Queue::get($name);

        foreach ($blocks as $block) {
            $queue->send(serialize($block));
        }

        return $queue;
    }
public function queueForDefaultsUpdate($data, $queue, $includeThisBlock = true)
    {
        $blocks = [];
        $db = \Database::connection();
        $rows = $db->GetAll('select cID, max(cvID) as cvID, cbRelationID from CollectionVersionBlocks where cbRelationID = ? group by cID order by cID', [$this->getBlockRelationID()]);

        $oc = $this->getBlockCollectionObject();
        $ocID = $oc->getCollectionID();
        $ocvID = $oc->getVersionID();

        foreach ($rows as $row) {
            $row2 = $db->GetRow('select bID, arHandle from CollectionVersionBlocks where cID = ? and cvID = ? and cbRelationID = ?', [
                $row['cID'], $row['cvID'], $row['cbRelationID'],
                ]);

            if ($includeThisBlock || ($row['cID'] != $ocID || $row['cvID'] != $ocvID || $row2['arHandle'] != $this->getAreaHandle() || $row2['bID'] != $this->getBlockID())) {
                $blocks[] = [
                    'cID' => $row['cID'],
                    'cvID' => $row['cvID'],
                    'cbRelationID' => $row['cbRelationID'],
                    'bID' => $row2['bID'],
                    'arHandle' => $row2['arHandle'],
                    'data' => $data,
                ];
            }
        }

        $name = $queue->getName();
        $queue->deleteQueue();
        $queue = Queue::get($name);

        foreach ($blocks as $block) {
            $queue->send(serialize($block));
        }

        return $queue;
    }
public function queueForDefaultsUpdate ( $ data , $ queue , $ includeThisBlock = true ) { $ blocks = [ ] ; $ db = \ Database :: connection ( ) ; $ rows = $ db -> GetAll ( 'select cID, max(cvID) as cvID, cbRelationID from CollectionVersionBlocks where cbRelationID = ? group by cID order by cID' , [ $ this -> getBlockRelationID ( ) ] ) ; $ oc = $ this -> getBlockCollectionObject ( ) ; $ ocID = $ oc -> getCollectionID ( ) ; $ ocvID = $ oc -> getVersionID ( ) ; foreach ( $ rows as $ row ) { $ row2 = $ db -> GetRow ( 'select bID, arHandle from CollectionVersionBlocks where cID = ? and cvID = ? and cbRelationID = ?' , [ $ row [ 'cID' ] , $ row [ 'cvID' ] , $ row [ 'cbRelationID' ] , ] ) ; if ( $ includeThisBlock || ( $ row [ 'cID' ] != $ ocID || $ row [ 'cvID' ] != $ ocvID || $ row2 [ 'arHandle' ] != $ this -> getAreaHandle ( ) || $ row2 [ 'bID' ] != $ this -> getBlockID ( ) ) ) { $ blocks [ ] = [ 'cID' => $ row [ 'cID' ] , 'cvID' => $ row [ 'cvID' ] , 'cbRelationID' => $ row [ 'cbRelationID' ] , 'bID' => $ row2 [ 'bID' ] , 'arHandle' => $ row2 [ 'arHandle' ] , 'data' => $ data , ] ; } } $ name = $ queue -> getName ( ) ; $ queue -> deleteQueue ( ) ; $ queue = Queue :: get ( $ name ) ; foreach ( $ blocks as $ block ) { $ queue -> send ( serialize ( $ block ) ) ; } return $ queue ; }
Populate the queue to be used to work on the block and it aliases.


@param mixed $data Custom data to be added to the queue messages
@param \ZendQueue\Queue $queue The queue to add the messages too (it will be emptied before adding the new messages)
@param bool $includeThisBlock Include this block instance in the queue?

@return \ZendQueue\Queue
Populate the queue to be used to work on the block and it aliases .