<?php

/**
 * NGauge Accounts Extended
 * php version 8.0.0+
 *
 * @category Model
 * @package  Yii
 * @author   Andrew Pickstock <a.pickstock@portalpeople.uk>
 * @license  "Portal People 2024"
 * @link     "/NGauge/accounts"
 */

namespace backend\models;

use Yii;
use common\models\DynamicModel;

class Accounts_extended extends DynamicModel
{
    /**
    * Constructor.
    * @param array $attributes the attributes (name-value pairs, or names) being defined.
    * @param array $config the configuration array to be applied to this object.
    */
    public function __construct(array $attributes = [], $config = [])
    {
        foreach ($this->localattributes() as $name => $details) {
            $attributes[$name] = $name;
        }
        parent::__construct($attributes, $config);
    }


    public static function localattributes()
    {

        return [
            'allowlocaldelivery' => [
                'rules' => [
                    ['boolean']
                ],
                'label' => Yii::t('app', "Allow Van Delivery",),
                'input' => [
                    'input' => 'checkbox',
                    'fieldclass' => null,
                    'fieldlist' => null,
                    'options' => ['label' => false],
                    'width' => 'col-12 col-md-3',
                ],
                'param_name' => 'pagesize',
            ],

        ];
    }
}
