Anatoliy
Well-known member
Following the "Let's build addon" I added two columns to xf_user table: av_aw_processed and av_aw_ignored.
I added code event listener as instructed. I'm stuck with a code in the Listener.php
What should go for
Thanks in advance.
PHP:
public function installStep1()
{
$this->schemaManager()->alterTable('xf_user', function(Alter $table)
{
$table->addColumn('av_aw_processed', 'int')->setDefault(0);
});
}
public function installStep2()
{
$this->schemaManager()->alterTable('xf_user', function(Alter $table)
{
$table->addColumn('av_aw_ignored', 'tinyint')->setDefault(0);
});
}
I added code event listener as instructed. I'm stuck with a code in the Listener.php
PHP:
class Listener
{
public static function userEntityStructure(\XF\Mvc\Entity\Manager $em, \XF\Mvc\Entity\Structure &$structure)
{
$structure->columns['av_aw_processed'] = ['type' => Entity::BOOL, 'default' => time()];
$structure->columns['av_aw_ignored'] = ['type' => Entity::BOOL, 'default' => false];
}
}
What should go for
av_aw_processed
instead of Entity::BOOL
? self::UINT
? Or what?Thanks in advance.