Current File : //var/www/vinorea/src/PrestaShopBundle/Bridge/Helper/Listing/HelperListConfiguration.php
<?php
/**
 * Copyright since 2007 PrestaShop SA and Contributors
 * PrestaShop is an International Registered Trademark & Property of PrestaShop SA
 *
 * NOTICE OF LICENSE
 *
 * This source file is subject to the Open Software License (OSL 3.0)
 * that is bundled with this package in the file LICENSE.md.
 * It is also available through the world-wide-web at this URL:
 * https://opensource.org/licenses/OSL-3.0
 * If you did not receive a copy of the license and are unable to
 * obtain it through the world-wide-web, please send an email
 * to license@prestashop.com so we can send you a copy immediately.
 *
 * DISCLAIMER
 *
 * Do not edit or add to this file if you wish to upgrade PrestaShop to newer
 * versions in the future. If you wish to customize PrestaShop for your
 * needs please refer to https://devdocs.prestashop.com/ for more information.
 *
 * @author    PrestaShop SA and Contributors <contact@prestashop.com>
 * @copyright Since 2007 PrestaShop SA and Contributors
 * @license   https://opensource.org/licenses/OSL-3.0 Open Software License (OSL 3.0)
 */

declare(strict_types=1);

namespace PrestaShopBundle\Bridge\Helper\Listing;

use AdminController;
use HelperList;
use PrestaShopBundle\Bridge\AdminController\ControllerConfiguration;
use Symfony\Component\OptionsResolver\OptionsResolver;

/**
 * This object contains the configuration needed to generate a list using the legacy HelperList class.
 */
class HelperListConfiguration
{
    /**
     * Sql SELECT clause
     *
     * @see AdminController::$_select
     *
     * @var string
     */
    public $select = '';

    /**
     * Sql WHERE clause
     *
     * @see AdminController::$_where
     *
     * @var string
     */
    public $where = '';

    /**
     * Sql JOIN clause
     *
     * @see AdminController::$_join
     *
     * @var string
     */
    public $join = '';

    /**
     * Sql GROUP clause
     *
     * @see AdminController::$_group
     *
     * @var string
     */
    public $group = '';

    /**
     * Sql ORDER BY clause
     *
     * @see AdminController::$_orderBy
     *
     * @var string
     */
    public $orderBy = '';

    /**
     * Sql value for ORDER BY clause argument e.g. ASC|DESC
     *
     * @see AdminController::$_orderWay
     *
     * @var string
     */
    public $orderWay = '';

    /**
     * Sql HAVING clause
     *
     * @see AdminController::$_having
     *
     * @var string
     */
    public $having = '';

    /**
     * Sql HAVING clause for filters
     *
     * @see AdminController::$_filterHaving
     *
     * @var string
     */
    public $filterHaving;

    /**
     * Contains various sql clauses for filtering the list
     *
     * @see AdminController::$filter
     *
     * @var string
     */
    public $filter = '';

    /**
     * The definition of list fields
     *
     * @see HelperList::$fields_list
     *
     * @var array<string, array<string, mixed>>
     *
     * @see self::setFieldsList() for defined array structure
     */
    public $fieldsList = [];

    /**
     * List record rows
     *
     * @see HelperList::$_list
     *
     * @var array<int, array<string, mixed>>|null
     */
    public $list;

    /**
     * Total count of records found. Used for pagination.
     *
     * @see HelperList::$listTotal
     *
     * @var int
     */
    public $listTotal;

    /**
     * @see ControllerConfiguration::$tabId
     *
     * @var int
     */
    private $tabId;

    /**
     * @see ControllerConfiguration::$tableName
     * @see HelperList::$table
     *
     * @var string
     */
    private $tableName;

    /**
     * Identifier of the list.
     * Based on this value the submit request key is built to allow identifying which list is performing certain action.
     * Most of the time it matches table name, but custom value can be provided as well.
     *
     * @see HelperList::$list_id
     *
     * @var string
     */
    private $listId;

    /**
     * @see ControllerConfiguration::$objectModelClassName
     *
     * @var string
     */
    private $objectModelClassName;

    /**
     * @see ControllerConfiguration::$legacyControllerName
     * @see HelperList::$controller_name
     *
     * @var string
     */
    private $legacyControllerName;

    /**
     * Name of id field (e.g. id_feature)
     *
     * @see HelperList::$identifier
     *
     * @var string
     */
    private $identifierKey;

    /**
     * @see ControllerConfiguration::$token
     *
     * @var string
     */
    private $token;

    /**
     * Default value of sql ORDER BY clause
     *
     * @see HelperList::$_defaultOrderBy
     *
     * @var string
     */
    private $defaultOrderBy;

    /**
     * Default value for sql ORDER BY clause argument e.g. ASC|DESC
     *
     * @var string
     */
    private $defaultOrderWay = 'ASC';

    /**
     * Defines if language table should be joined when querying sql or not
     *
     * @see AdminController::$lang
     *
     * @var bool
     */
    private $autoJoinLanguageTable;

    /**
     * @see AdminController::$multishop_context
     *
     * @var int
     */
    private $multiShopContext;

    /**
     *  If set to true, then includes records flagged with "deleted=0" when fetching list query
     * (yes, for some reason it seems to work backwards than the variable naming suggests)
     *
     * @see HelperList::$deleted
     * @see AdminController::getWhereClause for original usage
     *
     * @var bool
     */
    private $deleted;

    /**
     * If set to true, then sql all columns select ("a.*") is not used.
     *
     * @see AdminController::$explicitSelect
     * @see AdminController::getList() for original usage
     *
     * @var bool
     */
    private $explicitSelect;

    /**
     * @var bool Use SQL_CALC_FOUND_ROWS / FOUND_ROWS to count the number of records
     *
     * @see AdminController::$_use_found_rows
     */
    private $useFoundRows;

    /**
     * @see ControllerConfiguration::$positionIdentifierKey
     * @see HelperList::$position_identifier
     *
     * @var string|null
     */
    private $positionIdentifierKey;

    /**
     * @see ControllerConfiguration::$bootstrap
     * @see HelperList::$bootstrap
     *
     * @var bool
     */
    private $bootstrap;

    /**
     * @see ControllerConfiguration::$legacyCurrentIndex
     * @see HelperList::$currentIndex
     *
     * @var string|null
     */
    private $legacyCurrentIndex;

    /**
     * Template variables passed to delete action button.
     *
     * @see HelperList::$tpl_delete_link_vars
     *
     * @var array<string, mixed>
     */
    private $deleteLinkVars = [];

    /**
     * @see AdminController::$shopLinkType
     *
     * @var string
     */
    private $shopLinkType = '';

    /**
     * Pagination limit options for list.
     *
     * @see AdminController::$_pagination
     * @see HelperList::$_pagination
     *
     * @var int[]
     */
    private $paginationLimits = [20, 50, 100, 300, 1000];

    /**
     * Default pagination limit option for list.
     *
     * @see AdminController::$_default_pagination
     * @see HelperList::$_default_pagination
     *
     * @var int
     */
    private $defaultPaginationLimit = 50;

    /**
     * Actions shown in list toolbar.
     *
     * @see HelperList::$toolbar_btn
     * @see self::addToolbarAction() for array structure definition.
     *
     * @var array<string, array<string, mixed>>
     */
    private $toolbarActions = [];

    /**
     * Actions for every list row.
     *
     * @see HelperList::$actions
     *
     * @var string[]
     */
    private $rowActions = [];

    /**
     * Bulk actions for list.
     *
     * @see HelperList::$bulk_actions
     * @see self::addBulkAction() for array structure definition.
     *
     * @var array<string, array<string, mixed>>
     */
    private $bulkActions = [];

    /**
     * Defines where list filters and other POST actions should be submitted.
     * Without this property, HelperList would always submit back to legacy controller.
     *
     * @see HelperList::$frameworkIndexUrl
     *
     * @var string|null
     */
    private $indexUrl;

    /**
     * If true - joins related shop tables when querying sql.
     *
     * @see AdminController::$shopShareDatas
     *
     * @var bool
     */
    private $shopShareData = false;

    /**
     * @param int $tabId
     * @param string $tableName
     * @param string $listId
     * @param string $objectModelClassName
     * @param string $identifierKey
     * @param string|null $positionIdentifierKey
     * @param bool $isJoinLanguageTableAuto
     * @param bool $deleted
     * @param string $defaultOrderBy
     * @param bool $explicitSelect
     * @param bool $useFoundRows
     * @param string $legacyControllerName
     * @param string $token
     * @param bool $bootstrap
     * @param string $legacyCurrentIndex
     * @param int $multiShopContext
     * @param string $indexUrl
     */
    public function __construct(
        int $tabId,
        string $tableName,
        string $listId,
        string $objectModelClassName,
        string $identifierKey,
        ?string $positionIdentifierKey,
        bool $isJoinLanguageTableAuto,
        bool $deleted,
        string $defaultOrderBy,
        bool $explicitSelect,
        bool $useFoundRows,
        string $legacyControllerName,
        string $token,
        bool $bootstrap,
        string $legacyCurrentIndex,
        int $multiShopContext,
        string $indexUrl
    ) {
        $this->tabId = $tabId;
        $this->tableName = $tableName;
        $this->listId = $listId;
        $this->objectModelClassName = $objectModelClassName;
        $this->identifierKey = $identifierKey;
        $this->positionIdentifierKey = $positionIdentifierKey;
        $this->autoJoinLanguageTable = $isJoinLanguageTableAuto;
        $this->deleted = $deleted;
        $this->defaultOrderBy = $defaultOrderBy;
        $this->explicitSelect = $explicitSelect;
        $this->useFoundRows = $useFoundRows;
        $this->legacyControllerName = $legacyControllerName;
        $this->token = $token;
        $this->bootstrap = $bootstrap;
        $this->legacyCurrentIndex = $legacyCurrentIndex;
        $this->multiShopContext = $multiShopContext;
        $this->indexUrl = $indexUrl;
    }

    /**
     * @return int
     */
    public function getTabId(): int
    {
        return $this->tabId;
    }

    /**
     * @return string
     */
    public function getTableName(): string
    {
        return $this->tableName;
    }

    /**
     * @return string
     */
    public function getListId(): string
    {
        return $this->listId;
    }

    /**
     * @return string
     */
    public function getObjectModelClassName(): string
    {
        return $this->objectModelClassName;
    }

    /**
     * @return string
     */
    public function getLegacyControllerName(): string
    {
        return $this->legacyControllerName;
    }

    /**
     * @return string
     */
    public function getIdentifierKey(): string
    {
        return $this->identifierKey;
    }

    /**
     * @return string
     */
    public function getToken(): string
    {
        return $this->token;
    }

    /**
     * @return string
     */
    public function getDefaultOrderBy(): string
    {
        return $this->defaultOrderBy;
    }

    /**
     * @return bool
     */
    public function autoJoinLanguageTable(): bool
    {
        return $this->autoJoinLanguageTable;
    }

    /**
     * @return int
     */
    public function getMultiShopContext(): int
    {
        return $this->multiShopContext;
    }

    /**
     * @return bool
     */
    public function isDeleted(): bool
    {
        return $this->deleted;
    }

    /**
     * @return bool
     */
    public function isExplicitSelect(): bool
    {
        return $this->explicitSelect;
    }

    /**
     * @return bool
     */
    public function useFoundRows(): bool
    {
        return $this->useFoundRows;
    }

    /**
     * @return string|null
     */
    public function getPositionIdentifierKey(): ?string
    {
        return $this->positionIdentifierKey;
    }

    /**
     * @return bool
     */
    public function isBootstrap(): bool
    {
        return $this->bootstrap;
    }

    /**
     * @return string|null
     */
    public function getLegacyCurrentIndex(): ?string
    {
        return $this->legacyCurrentIndex;
    }

    /**
     * @return string
     */
    public function getDefaultOrderWay(): string
    {
        return $this->defaultOrderWay;
    }

    /**
     * @param string $defaultOrderWay
     *
     * @return HelperListConfiguration
     */
    public function setDefaultOrderWay(string $defaultOrderWay): self
    {
        $this->defaultOrderWay = $defaultOrderWay;

        return $this;
    }

    /**
     * list of vars for delete button
     *
     * @return array<string, mixed>
     */
    public function getDeleteLinkVars(): array
    {
        return $this->deleteLinkVars;
    }

    /**
     * @param array<string, mixed> $deleteLinkVars
     *
     * @return HelperListConfiguration
     */
    public function setDeleteLinkVars(array $deleteLinkVars): HelperListConfiguration
    {
        $this->deleteLinkVars = $deleteLinkVars;

        return $this;
    }

    /**
     * @return string
     */
    public function getShopLinkType(): string
    {
        return $this->shopLinkType;
    }

    /**
     * @param string $shopLinkType
     *
     * @return HelperListConfiguration
     */
    public function setShopLinkType(string $shopLinkType): HelperListConfiguration
    {
        $this->shopLinkType = $shopLinkType;

        return $this;
    }

    /**
     * @return int[]
     */
    public function getPaginationLimits(): array
    {
        return $this->paginationLimits;
    }

    /**
     * @param int[] $paginationLimits
     *
     * @return HelperListConfiguration
     */
    public function setPaginationLimits(array $paginationLimits): HelperListConfiguration
    {
        $this->paginationLimits = $paginationLimits;

        return $this;
    }

    /**
     * @return int
     */
    public function getDefaultPaginationLimit(): int
    {
        return $this->defaultPaginationLimit;
    }

    /**
     * @param int $defaultPaginationLimit
     *
     * @return HelperListConfiguration
     */
    public function setDefaultPaginationLimit(int $defaultPaginationLimit): HelperListConfiguration
    {
        $this->defaultPaginationLimit = $defaultPaginationLimit;

        return $this;
    }

    /**
     * @param string $label
     * @param array{href?:string, desc?:string, class?:string} $config
     *
     * @return $this
     */
    public function addToolbarAction(string $label, array $config): self
    {
        $optionsResolver = new OptionsResolver();
        $optionsResolver
            ->setDefined(['href', 'desc', 'class'])
            ->setAllowedTypes('class', ['string', 'null'])
            ->setAllowedTypes('href', ['string', 'null'])
            ->setAllowedTypes('desc', ['string', 'null'])
        ;

        $this->toolbarActions[$label] = $optionsResolver->resolve($config);

        return $this;
    }

    /**
     * @return array<string, array<string, mixed>>
     */
    public function getToolbarActions(): array
    {
        return $this->toolbarActions;
    }

    /**
     * @param string $action
     *
     * @return $this
     */
    public function addRowAction(string $action): self
    {
        $this->rowActions[] = $action;

        return $this;
    }

    /**
     * @return string[]
     */
    public function getRowActions(): array
    {
        return $this->rowActions;
    }

    /**
     * @param string $label
     * @param array{text: string, icon?: string, confirm?: string} $config
     *
     * @return $this
     */
    public function addBulkAction(string $label, array $config): self
    {
        $optionsResolver = new OptionsResolver();
        $optionsResolver
            ->setDefined(['text', 'icon', 'confirm'])
            ->setAllowedTypes('text', ['string'])
            ->setAllowedTypes('icon', ['string', 'null'])
            ->setAllowedTypes('confirm', ['string', 'null'])
        ;

        $this->bulkActions[$label] = $optionsResolver->resolve($config);

        return $this;
    }

    /**
     * @return array<string, array<string, mixed>>
     */
    public function getBulkActions(): array
    {
        return $this->bulkActions;
    }

    /**
     * @param array<string, array<string, mixed>> $fieldsList
     *
     * @return $this
     */
    public function setFieldsList(array $fieldsList): self
    {
        $optionsResolver = new OptionsResolver();

        $optionsResolver
            ->setRequired([
                'title',
            ])
            ->setDefined([
                'align',
                'class',
                'filter_type',
                'filter_key',
                'orderby',
                'position',
                'search',
                'width',
                'havingFilter',
                'icon',
                'list',
            ])
            ->addAllowedTypes('title', 'string')
            ->addAllowedTypes('orderby', 'boolean')
            ->addAllowedTypes('search', 'boolean')
            ->addAllowedTypes('havingFilter', 'boolean')
            ->setDefaults([
                'havingFilter' => false,
            ])
        ;

        foreach ($fieldsList as $field => $config) {
            $this->fieldsList[$field] = $optionsResolver->resolve($config);
        }

        return $this;
    }

    /**
     * @return string|null
     */
    public function getIndexUrl(): ?string
    {
        return $this->indexUrl;
    }

    /**
     * @return bool
     */
    public function isShopShareData(): bool
    {
        return $this->shopShareData;
    }

    /**
     * @param bool $shopShareData
     *
     * @return HelperListConfiguration
     */
    public function setShopShareData(bool $shopShareData): self
    {
        $this->shopShareData = $shopShareData;

        return $this;
    }
}
¿Qué es la limpieza dental de perros? - Clínica veterinaria


Es la eliminación del sarro y la placa adherida a la superficie de los dientes mediante un equipo de ultrasonidos que garantiza la integridad de las piezas dentales a la vez que elimina en profundidad cualquier resto de suciedad.

A continuación se procede al pulido de los dientes mediante una fresa especial que elimina la placa bacteriana y devuelve a los dientes el aspecto sano que deben tener.

Una vez terminado todo el proceso, se mantiene al perro en observación hasta que se despierta de la anestesia, bajo la atenta supervisión de un veterinario.

¿Cada cuánto tiempo tengo que hacerle una limpieza dental a mi perro?

A partir de cierta edad, los perros pueden necesitar una limpieza dental anual o bianual. Depende de cada caso. En líneas generales, puede decirse que los perros de razas pequeñas suelen acumular más sarro y suelen necesitar una atención mayor en cuanto a higiene dental.


Riesgos de una mala higiene


Los riesgos más evidentes de una mala higiene dental en los perros son los siguientes:

  • Cuando la acumulación de sarro no se trata, se puede producir una inflamación y retracción de las encías que puede descalzar el diente y provocar caídas.
  • Mal aliento (halitosis).
  • Sarro perros
  • Puede ir a más
  • Las bacterias de la placa pueden trasladarse a través del torrente circulatorio a órganos vitales como el corazón ocasionando problemas de endocarditis en las válvulas. Las bacterias pueden incluso acantonarse en huesos (La osteomielitis es la infección ósea, tanto cortical como medular) provocando mucho dolor y una artritis séptica).

¿Cómo se forma el sarro?

El sarro es la calcificación de la placa dental. Los restos de alimentos, junto con las bacterias presentes en la boca, van a formar la placa bacteriana o placa dental. Si la placa no se retira, al mezclarse con la saliva y los minerales presentes en ella, reaccionará formando una costra. La placa se calcifica y se forma el sarro.

El sarro, cuando se forma, es de color blanquecino pero a medida que pasa el tiempo se va poniendo amarillo y luego marrón.

Síntomas de una pobre higiene dental
La señal más obvia de una mala salud dental canina es el mal aliento.

Sin embargo, a veces no es tan fácil de detectar
Y hay perros que no se dejan abrir la boca por su dueño. Por ejemplo…

Recientemente nos trajeron a la clínica a un perro que parpadeaba de un ojo y decía su dueño que le picaba un lado de la cara. Tenía molestias y dificultad para comer, lo que había llevado a sus dueños a comprarle comida blanda (que suele ser un poco más cara y llevar más contenido en grasa) durante medio año. Después de una exploración oftalmológica, nos dimos cuenta de que el ojo tenía una úlcera en la córnea probablemente de rascarse . Además, el canto lateral del ojo estaba inflamado. Tenía lo que en humanos llamamos flemón pero como era un perro de pelo largo, no se le notaba a simple vista. Al abrirle la boca nos llamó la atención el ver una muela llena de sarro. Le realizamos una radiografía y encontramos una fístula que llegaba hasta la parte inferior del ojo.

Le tuvimos que extraer la muela. Tras esto, el ojo se curó completamente con unos colirios y una lentilla protectora de úlcera. Afortunadamente, la úlcera no profundizó y no perforó el ojo. Ahora el perro come perfectamente a pesar de haber perdido una muela.

¿Cómo mantener la higiene dental de tu perro?
Hay varias maneras de prevenir problemas derivados de la salud dental de tu perro.

Limpiezas de dientes en casa
Es recomendable limpiar los dientes de tu perro semanal o diariamente si se puede. Existe una gran variedad de productos que se pueden utilizar:

Pastas de dientes.
Cepillos de dientes o dedales para el dedo índice, que hacen más fácil la limpieza.
Colutorios para echar en agua de bebida o directamente sobre el diente en líquido o en spray.

En la Clínica Tus Veterinarios enseñamos a nuestros clientes a tomar el hábito de limpiar los dientes de sus perros desde que son cachorros. Esto responde a nuestro compromiso con la prevención de enfermedades caninas.

Hoy en día tenemos muchos clientes que limpian los dientes todos los días a su mascota, y como resultado, se ahorran el dinero de hacer limpiezas dentales profesionales y consiguen una mejor salud de su perro.


Limpiezas dentales profesionales de perros y gatos

Recomendamos hacer una limpieza dental especializada anualmente. La realizamos con un aparato de ultrasonidos que utiliza agua para quitar el sarro. Después, procedemos a pulir los dientes con un cepillo de alta velocidad y una pasta especial. Hacemos esto para proteger el esmalte.

La frecuencia de limpiezas dentales necesaria varía mucho entre razas. En general, las razas grandes tienen buena calidad de esmalte, por lo que no necesitan hacerlo tan a menudo e incluso pueden pasarse la vida sin requerir una limpieza. Sin embargo, razas pequeñas como el Yorkshire o el Maltés, deben hacérselas todos los años desde cachorros si se quiere conservar sus piezas dentales.

Otro factor fundamental es la calidad del pienso. Algunas marcas han diseñado croquetas que limpian la superficie del diente y de la muela al masticarse.

Ultrasonido para perros

¿Se necesita anestesia para las limpiezas dentales de perros y gatos?

La limpieza dental en perros no es una técnica que pueda practicarse sin anestesia general , aunque hay veces que los propietarios no quieren anestesiar y si tiene poco sarro y el perro es muy bueno se puede intentar…… , pero no se va a poder pulir ni acceder a todas la zona de la boca …. Además los limpiadores dentales van a irrigar agua y hay riesgo de aspiración a vías respiratorias si no se realiza una anestesia correcta con intubación traqueal . En resumen , sin anestesia no se va hacer una correcta limpieza dental.

Tampoco sirve la sedación ya que necesitamos que el animal esté totalmente quieto, y el veterinario tenga un acceso completo a todas sus piezas dentales y encías.

Alimentos para la limpieza dental

Hay que tener cierto cuidado a la hora de comprar determinados alimentos porque no todos son saludables. Algunos tienen demasiado contenido graso, que en exceso puede causar problemas cardiovasculares y obesidad.

Los mejores alimentos para los dientes son aquellos que están elaborados por empresas farmacéuticas y llevan componentes químicos con tratamientos específicos para el diente del perro. Esto implica no solo limpieza a través de la acción mecánica de morder sino también un tratamiento antibacteriano para prevenir el sarro.

Conclusión

Si eres como la mayoría de dueños, por falta de tiempo , es probable que no estés prestando la suficiente atención a la limpieza dental de tu perro. Por eso te animamos a que comiences a limpiar los dientes de tu perro y consideres atender a su higiene bucal con frecuencia.

Estas simples medidas pueden conllevar a que tu perro tenga una vida más larga y mucho más saludable.

Si te resulta imposible introducir un cepillo de dientes a tu perro en la boca, pásate con él por clínica Tus Veterinarios y te explicamos cómo hacerlo.

Necesitas hacer una limpieza dental profesional a tu mascota?
Llámanos al 622575274 o contacta con nosotros

Deja un comentario

Tu dirección de correo electrónico no será publicada. Los campos obligatorios están marcados con *

¡Hola!