for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
* Class BlocksVersionedObjectsTask
*/
class BlocksVersionedObjectsTask extends BuildTask
{
* @var string
protected $title = 'Publish Block Objects';
protected $description = 'Migrate block objects from alpha releases';
* @var bool
protected $enabled = true;
* @param $request
public function run($request)
$this->updateObjects();
}
* migrate all promos based on page type.
public function updateObjects()
$objects = [
'AccordionPanel',
'PageSectionObject',
'PhotoGalleryBlockImage',
'PromoObject',
];
$ct = 0;
foreach ($objects as $object) {
$results = $object::get();
foreach ($results as $result) {
$result->doPublish('Stage', 'Live');
$ct++;
echo '<p>'.$ct.' block objects updated.</p>';