Model/Behavior/GalleryBehavior.php
public function getGallery(Model $Model, $object_id = null)
    {
        $Album = new Album();

        if (!$object_id) {
            $object_id = $Model->id;
        }

        return $Album->getAttachedAlbum($Model->alias, $object_id);
    }
public function getGallery(Model $Model, $object_id = null)
    {
        $Album = new Album();

        if (!$object_id) {
            $object_id = $Model->id;
        }

        return $Album->getAttachedAlbum($Model->alias, $object_id);
    }
Get model gallery
@param Model $Model
@return mixed