for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/**
*
* @package sitemaker
* @copyright (c) 2013 Daniel A. (blitze)
* @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License v2
*/
namespace blitze\sitemaker\migrations\v20x;
* Initial schema changes needed for Extension installation
class m12_add_hidden_forum_column extends \phpbb\db\migration\migration
{
* Skip this migration if the hidden_forum column already exists
* @return bool True to skip this migration, false to run it
* @access public
public function effectively_installed()
return $this->db_tools->sql_column_exists($this->table_prefix . 'forums', 'hidden_forum');
}
* Update forums table schema
* @return array Array of table schema
public function update_schema()
return array(
'add_columns' => array(
$this->table_prefix . 'forums' => array(
'hidden_forum' => array('BOOL', 0),
),
);
* @inheritdoc
public function update_data()
array('custom', array(array($this, 'set_hidden_forums'))),
public function update_blocks_settings()
$data = array(
'hidden_forum' => 1,
$sql = 'UPDATE ' . FORUMS_TABLE . ' SET ' . $this->db->sql_build_array('UPDATE', $data) . ' WHERE forum_id = ' . (int) $this->config['sitemaker_parent_forum_id'];
$this->db->sql_query($sql);