Вход Регистрация
Файл: concrete5.7.5.6/concrete/src/Gathering/Item/Template/Tile/TitleDateCommentsTemplate.php
Строк: 44
<?php

namespace ConcreteCoreGatheringItemTemplateTile;

use 
ConcreteCoreGatheringItemItem as GatheringItem;

class 
TitleDateCommentsTemplate extends Template
{
    public function 
getGatheringItemTemplateData(GatheringItem $item)
    {
        
$items parent::getGatheringItemTemplateData($item);
        
$totalPosts 0;
        if (
is_array($items['conversation'])) {
            foreach (
$items['conversation'] as $cnv) {
                
$conversation $cnv->getConversationObject();
                
$totalPosts += $conversation->getConversationMessagesTotal();
            }
        } elseif (
is_object($items['conversation'])) {
            
$cnv $items['conversation'];
            
$conversation $cnv->getConversationObject();
            
$totalPosts $conversation->getConversationMessagesTotal();
        }
        
$items['totalPosts'] = $totalPosts;

        return 
$items;
    }
}
Онлайн: 3
Реклама