55 lines
1.5 KiB
PHP
55 lines
1.5 KiB
PHP
<?php
|
|
/**
|
|
* 2012 - 2020 HiPresta
|
|
*
|
|
* MODULE Gallery
|
|
*
|
|
* @author HiPresta <support@hipresta.com>
|
|
* @copyright HiPresta 2020
|
|
* @license Addons PrestaShop license limitation
|
|
* @link https://hipresta.com
|
|
*
|
|
* NOTICE OF LICENSE
|
|
*
|
|
* Don't use this module on several shops. The license provided by PrestaShop Addons
|
|
* for all its modules is valid only once for a single shop.
|
|
*/
|
|
|
|
class GallerySocialAccount extends ObjectModel
|
|
{
|
|
public $id_higallerysocialnetwork;
|
|
public $active;
|
|
public $title;
|
|
public $access_token;
|
|
public $social_network;
|
|
|
|
public static $definition = array(
|
|
'table' => 'higallerysocialnetwork',
|
|
'primary' => 'id_higallerysocialnetwork',
|
|
'multilang' => false,
|
|
'fields' => array(
|
|
'active' => array('type' => self::TYPE_INT, 'validate' => 'isInt'),
|
|
'title' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml', 'size' => 255, 'required' => true),
|
|
'access_token' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml'),
|
|
'social_network' => array('type' => self::TYPE_STRING, 'validate' => 'isCleanHtml')
|
|
)
|
|
);
|
|
|
|
public static function getAccounts($active = false)
|
|
{
|
|
$query = new DbQuery();
|
|
|
|
$query
|
|
->select('a.*')
|
|
->from('higallerysocialnetwork', 'a');
|
|
|
|
if ($active) {
|
|
$query->where('a.active = 1');
|
|
}
|
|
|
|
$query->orderBy('a.id_higallerysocialnetwork ASC');
|
|
|
|
return Db::getInstance(_PS_USE_SQL_SLAVE_)->executeS($query);
|
|
}
|
|
}
|