File: /var/www/heifetz/heifetz-app/models/AbstractExternalDictionary.php
<?php
namespace Models;
/**
* Class AbstractExternalDictionary
*
* @property int $id
* @property string $name
* @property int $deleted
* @property int $active
* @property string $external_id
* @property int $company_id
*/
abstract class AbstractExternalDictionary extends AbstractDictionary
{
public static function getExternalId($dictionaryId)
{
$externalId = static::$db->select('external_id')->from(static::$tableName)->where('id = ?', (int) $dictionaryId)->fetchOne();
return empty($externalId) ? '' : $externalId;
}
public static function setExternalId($dictionaryId, $externalId)
{
return static::update(['external_id' => $externalId], ['id' => $dictionaryId]);
}
}