Hallo, ich super per findBy Werte aus der Datenbank. Das Model aussenrum sieht so aus:
PHP-Code:
class VideoModel extends \Model
{
/**
* Table name
* @var string
*/
protected static $strTable = 'tl_videos';
/**
* Count published videos items by their parent ID
*
* @param array $arrPids An array of videos archive IDs
* @param boolean $blnFeatured If true, return only featured videos, if false, return only unfeatured videos
* @param array $arrOptions An optional options array
*
* @return integer The number of videos items
*/
public static function countPublishedByPageId($pageId, $blnFeatured=null, array $arrOptions=array())
{
if (empty($pageId)) return 0;
$t = static::$strTable;
$arrColumns = array("$t.jumpTo = ?");
if ($blnFeatured === true)
{
$arrColumns[] = "$t.featured='1'";
}
elseif ($blnFeatured === false)
{
$arrColumns[] = "$t.featured=''";
}
if (!BE_USER_LOGGED_IN)
{
$time = \Date::floorToMinute();
$arrColumns[] = "($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "') AND $t.published='1'";
}
return static::countBy($arrColumns, $pageId, $arrOptions);
}
/**
* Find published videos items by page ID
*
* @param integer $intId The videos archive ID
* @param integer $intLimit An optional limit
* @param array $arrOptions An optional options array
*
* @return \Model\Collection|\videoModel|null A collection of models or null if there are no videos
*/
public static function findPublishedByPageId($pageId, $blnFeatured=null, $intLimit=0, $intOffset=0, array $arrOptions=array())
{
$t = static::$strTable;
if(empty($pageId)) return false;
$arrColumns = array("$t.jumpTo = ?");
if (!BE_USER_LOGGED_IN)
{
$time = \Date::floorToMinute();
$arrColumns[] = "($t.start='' OR $t.start<='$time') AND ($t.stop='' OR $t.stop>'" . ($time + 60) . "') AND $t.published='1'";
}
if ($intLimit > 0)
{
$arrOptions['limit'] = $intLimit;
}
if($intOffset > 0)
{
$arrOptions['offset'] = $intOffset;
}
return static::findBy($arrColumns, $pageId, $arrOptions);
}
}
Das countBy in der countPublishedByPageId() funktioniert. Das findBy gibt die Fehlermeldung, genauso findAll
HTML-Code:
Fatal error: Class 'VideosModel' not found in ***system/modules/core/library/Contao/Model/Collection.php on line 141
Das seltsame ist: Die Klasse VideosModel gibt es gar nicht! Die kommt auch nirgendwo vor, die Klasse heisst VideoModel (ohne s). Ich hab schon per SSH nach grep 'VideosModel' * -R gesucht, aber nur das Error Log gefunden.
Contao 3.5.4
Hat jemand eine Idee wo ich noch suchen kann?? DANKE
Lesezeichen