HEX
Server: Microsoft-IIS/8.5
System: Windows NT YDAWBH120 6.3 build 9600 (Windows Server 2012 R2 Standard Edition) AMD64
User: tentjecom_web (0)
PHP: 7.4.14
Disabled: NONE
Upload Files
File: D:/HostingSpaces/SBogers100/femmassebv.com/workbench/komma/kms/src/Komma/Kms/Core/KmsRepository.php
<?php
/**
 * Short description for the file.
 *
 * @author      Komma <info@komma.pro>
 * @copyright   (c) 2012-2015, Komma Mediadesign
 */

namespace Komma\Kms\Core;

use Illuminate\Support\Collection;
use Komma\Kms\Images\Models\Image;

abstract class KmsRepository
{
    protected $kms;
    public $buttons;

    function __construct(Kms $kms)
    {
        $this->kms = $kms;
        $this->buttons = [
            ['value' => 'about', 'content' => 'Meer over ons'],
            ['value' => 'contact', 'content' => 'Neem contact op']
        ];
    }

    /**
     * This loads the images for a given model
     * Based on the id, and type of a model
     * and filtered by the attribute_key
     * It collects the images from db
     *
     * @param $id
     * @param $type
     * @param null $attributeKey
     * @return mixed
     */
    protected function getImages($id, $type, $attributeKey = 'images')
    {
        $imageRecords = Image::where('imageble_type', $type)
            ->where('imageble_id', $id)
            ->where('attribute_key', $attributeKey)
            ->orderBy('sort_order', 'asc')
            ->get();        $images = $imageRecords->toArray();
        return $images;
    }


    /*
    abstract public function newEntity();
    abstract public function getEntity($id);
    abstract public function getEntities();
    abstract public function saveEntity($entity);
    abstract public function destroyEntity($id);
    */
}