self::TABLE, 'primary' => self::CUSTOMER_ID, 'fields' => [ self::CUSTOMER_ID => ['type' => self::TYPE_INT], self::ALIAS => ['type' => self::TYPE_STRING], self::LAST_ORDER_ID => ['type' => self::TYPE_INT], ], ]; /** * Creates new entity or returns existing one with cleared alias * * @param int $customerId * * @return Przelewy24BlikAlias */ public static function prepareEmptyModel($customerId) { $model = new Przelewy24BlikAlias($customerId); $model->customer_id = $customerId; $model->alias = null; if (!Validate::isLoadedObject($model)) { $model->save(); } return $model; } }