Add back $pdo

This commit is contained in:
DariusIII
2017-12-18 11:15:15 +01:00
parent 8b4f2b495c
commit 291e09da3a
2 changed files with 11 additions and 2 deletions
+7 -1
View File
@@ -26,6 +26,7 @@ use App\Models\Video;
use App\Models\TvInfo;
use App\Models\VideoAlias;
use Illuminate\Support\Facades\Cache;
use nntmux\db\DB;
/**
* Parent class for TV/Film and any similar classes to inherit from.
@@ -37,6 +38,10 @@ abstract class Videos
protected const TYPE_FILM = 1; // Type of video is a Film/Movie
protected const TYPE_ANIME = 2; // Type of video is a Anime
/**
* @var \nntmux\db\DB
*/
protected $pdo;
/**
* @var bool
*/
@@ -60,6 +65,7 @@ abstract class Videos
];
$options += $defaults;
$this->pdo = ($options['Settings'] instanceof DB ? $options['Settings'] : new DB());
$this->echooutput = ($options['Echo'] && NN_ECHOCLI);
$this->titleCache = [];
}
@@ -119,7 +125,7 @@ abstract class Videos
protected function getVideoIDFromSiteID($siteColumn, $siteID)
{
if (\in_array($siteColumn, self::$sites, false)) {
$result = Video::query()->where($siteColumn, $siteID)->first(['id']);
$result = Video::query()->where($siteColumn, '=', $siteID)->first(['id']);
return $result !== null ? (int) $result['id'] : false;
}
+4 -1
View File
@@ -46,7 +46,10 @@ class TVDB extends TV
private $local;
/**
* @param array $options Class instances / Echo to cli?
* TVDB constructor.
*
* @param array $options
* @throws \Exception
*/
public function __construct(array $options = [])
{