PHP code example of thelia / attribute-type-module

1. Go to this page and download the library: Download thelia/attribute-type-module library. Choose the download type require.

2. Extract the ZIP file and open the index.php.

3. Add this code to the index.php.
    
        
<?php
require_once('vendor/autoload.php');

/* Start to develop here. Best regards https://php-download.com/ */

    

thelia / attribute-type-module example snippets


    /**
     * Returns a value based on the slug, attribute_av_id and locale
     *
     * <code>
     * $value  = AttributeType::getValue('color', 2);
     * </code>
     *
     * @param string $slug
     * @param int $attributeAvId
     * @param string $locale
     * @return string
     * @throws \Propel\Runtime\Exception\PropelException
     */
    public static function getValue($slug, $attributeAvId, $locale = 'en_US')

    /**
     * Returns a set of values
     * If the value does not exist, it is replaced by null
     *
     * <code>
     * $values = AttributeType::getValue(['color','texture'], [4,7]);
     * </code>
     *
     * <sample>
     *  array(
     *  'color' => [4 => '#00000', 7 => '#FFF000'],
     *  'texture' => [4 => null, 7 => 'lines.jpg']
     * )
     * </sample>
     *
     * @param string[] $slugs
     * @param int[] $attributeAvIds
     * @param string $locale
     * @return string
     * @throws \Propel\Runtime\Exception\PropelException
     */
    public static function getValues(array $slugs, array $attributeAvIds, $locale = 'en_US')

    /**
     * Returns a set of first values
     * If the value does not exist, it is replaced by null
     *
     * <code>
     * $values = AttributeType::getFirstValues(['color','texture', 'other'], [4,7]);
     * </code>
     *
     * <sample>
     *  array(
     *  'color' => '#00000',
     *  'texture' => 'lines.jpg',
     *  'other' => null
     * )
     * </sample>
     *
     * @param string[] $slugs
     * @param int[] $attributeAvIds
     * @param string $locale
     * @return array
     */
    public static function getFirstValues(array $slugs, array $attributeAvIds, $locale = 'en_US')

    /**
     * Find AttributeAv by slugs, attributeIds, values, locales
     *
     * <code>
     * $attributeAv = AttributeType::getAttributeAv('color', '1', '#00000');
     * </code>
     *
     * @param null|string|array $slugs
     * @param null|string|array $attributeIds
     * @param null|string|array $values meta values
     * @param null|string|array $locale
     *
     * @return \Thelia\Model\AttributeAv
     */
    public static function getAttributeAv($slugs = null, $attributeIds = null, $values = null, $locale = 'en_US')

    /**
     * Find AttributeAvs by slug, attributeId, value, locale
     *
     * <code>
     * $attributeAvs = AttributeType::getAttributeAvs('color', '1', '#00000');
     * </code>
     *
     * @param null|string|array $slugs
     * @param null|string|array $attributeIds
     * @param null|string|array $values meta values
     * @param null|string|array $locale
     *
     * @return \Thelia\Model\AttributeAv
     */
    public static function getAttributeAvs($slugs = null, $attributeIds = null, $values = null, $locale = 'en_US')