schmunk42\giiant\generators\model\Generator::generateBlameable PHP Method

generateBlameable() protected method

protected generateBlameable ( yii\db\TableSchema $table ) : string[]
$table yii\db\TableSchema the table schema
return string[]
    protected function generateBlameable($table)
    {
        $createdBy = $table->getColumn($this->createdByColumn) !== null ? $this->createdByColumn : false;
        $updatedBy = $table->getColumn($this->updatedByColumn) !== null ? $this->updatedByColumn : false;
        if ($this->useBlameableBehavior && ($createdBy || $updatedBy)) {
            return ['createdByAttribute' => $createdBy, 'updatedByAttribute' => $updatedBy];
        }
        return [];
    }