Returns classcontent by category.

@param string  $name  category's name
@param integer $start
@param integer $count

@return null|Paginator
964595
private function getClassContentByCategory($name, $start, $count)
    {
        return $this->findContentsByCriteria($this->getClassContentClassnamesByCategory($name), $start, $count);
    }
467436
public function startSection($name, $content = null)
    {

        $section = $this->getSectionCollection()->findOrCreate($name);

        $content ? $section->setContent($content) : $section->setContent('')->start();

        return $this;
    }
345247
public function read($count = 0)
    {
        if (0 === $count) {
            $count = -1;
        }
        fseek($this->resource, $this->readPosition);
        $content = stream_get_contents($this->resource, $count);
        $this->readPosition = ftell($this->resource);
        return $content;
    }
102841
public function getItems($count = null, $start = 0)
    {
        $columns = [];

        foreach ($this->columns as $key => $value) {
            $columns[] = $this->applyTableAlias($value);
        }

        $builder = $this->connection->createQueryBuilder();
        $builder
            ->select(empty($columns) ? $this->applyTableAlias('*') : $columns)
            ->from($this->tableName, $this->tableAlias)
        ;

        $builder = $this->applyConditions($builder);
        $builder = $this->applyOrdering($builder);

        if (!is_null($count)) {
            $builder
                ->setMaxResults($count)
                ->setFirstResult($start)
            ;
        }

        $this->dispatcher->dispatch('onQueryDatabase', new QueryDatabaseEvent($this->entityClass, $builder));

        try {
            $rows = $builder
                ->execute()
                ->fetchAll(\PDO::FETCH_ASSOC)
            ;
        } catch (SyntaxErrorException $e) {
            throw new InvalidOperatorException($e->getMessage(), 0, $e);
        } catch (DBALException $e) {
            throw new EntityNotFoundException();
        }

        foreach ($this->patterns as $column => $pattern) {
            $column = $this->stripTableAlias($column);
            $rows   = array_filter(
                $rows,
                function ($row) use ($column, $pattern) {
                    return preg_match("~{$pattern}~", $row[$column]);
                }
            );
        }

        if (empty($rows)) {
            return [];
        }

        if (empty($this->columns)) {
            $rows = $this->castToEntity($rows);
        }

        if (count($this->columns) == 1 && $this->columns[0] != '*') {
            $result = [];

            foreach ($rows as $match) {
                $result[] = $match[$this->columns[0]];
            }

            return $result;
        }

        return array_values($rows);
    }
819290
public function list(int $begin, int $count)
    {
        $params = [
            'begin' => $begin,
            'count' => $count,
        ];

        return $this->httpPostJson('shakearound/device/group/getlist', $params);
    }
1187311
public function getContent($name)
    {
        return $this->getContents()->filter(function (Content $content) use ($name) {
            return $content->getArea()->getName() == $name;
        })->first();
    }
1275481
public function slice($start, $length = null)
    {
        $answer = new HArraySlice($this);
        return new static($answer->slice($start, $length));
    }
507588
protected function getListReportLibrary($count = false)
    {
        $list = $this->library->getList();
        $this->prepareListLibrary($list);

        $allowed = $this->getAllowedFiltersReportLibrary();

        $this->filterList($list, $allowed, $this->query_filter);
        $this->sortList($list, $allowed, $this->query_filter, array('name' => 'desc'));

        if ($count) {
            return count($list);
        }

        $this->limitList($list, $this->data_limit);
        return $list;
    }
693297
public static function to_assoc($start = 1)
	{
		$segments = array_slice(static::segments(), ($start - 1));
		count($segments) % 2 and $segments[] = null;

		return \Arr::to_assoc($segments);
	}
759354
public function get_entries($start=0, $limit=10) {
        global $DB;

        if ($this->entries === null) {
            if ($sqlarray = $this->get_entry_fetch_sql(false, 'created DESC')) {
                $this->entries = $DB->get_records_sql($sqlarray['sql'], $sqlarray['params'], $start, $limit);
                if (!$start && count($this->entries) < $limit) {
                    $this->totalentries = count($this->entries);
                }
            } else {
                return false;
            }
        }

        return $this->entries;
    }
673531
public function getSection($name, $forceRefresh = false)
    {
        if(isset($this->sectionsRendered[$name]) && $forceRefresh === false)
        {
            return $this->sectionsRendered[$name];
        }

        $sections = $this->getSections();

        if(isset($sections[$name]) === false)
        {
            return false;
        }

        $name = $sections[$name];

        ob_start();
        $this->{$name}();
        $content = ob_get_clean();

        return $this->sectionsRendered[$name] = $content;
    }
689672
public function getAdverts($start, $end, $section=null)
    {
    
        if($count == 0){
            $count2 = 0;

            $qb2 = $this->getQueryBuilder() 
            ->join('a.located', 'l')
            ->where('l.name = :section')
            ->andWhere('a.from <= :start')
            ->andWhere('a.to >= :end')
            ->andWhere('a.active = :active')
            ->setParameters(array(
                'section' => $section, 
                'start' => $start, 
                'end' => $end,
                'active' => true,
                ));

            $query = $qb2->getQuery();
        }
        
        //->orderBy('s.day', 'ASC')
        $adverts = array();
        if(is_object($query)){
            $adverts = $query->getResult();
        }
        
        $arr = new \Doctrine\Common\Collections\ArrayCollection();
        foreach ($adverts as $ad) {
            $arr->add($ad);
        }
        
        return $arr;
    }
506851
public function startList($name)
    {
        $this->checkStartList($name);

        $array = new Json\ArrayObject($this->json);

        $this->json->$name = $array;
        $this->json = $array;
    }
851035
public function slice( int$start=0, int...$lengths ):string
	{
		return substr($this->getContent(),$start,...array_slice($lengths,0,1));
	}
658159
private function getClassContentClassnamesByCategory($name)
    {
        try {
            return $this->getCategoryManager()->getClassContentClassnamesByCategory($name);
        } catch (\InvalidArgumentException $e) {
            throw new NotFoundHttpException($e->getMessage());
        }
    }
30968
protected function getAlterMigrationName($name, $count)
    {
        $filename = sprintf('%s_alter_%s_table_%s.php', date('Y_m_d_His'), strtolower($name), $count);

        return Helpers::postFixWith($filename, '.php');
    }
116643
public function getCollectionByContentAction($type, $uid, $start, $count)
    {
        $content = $this->findOneByTypeAndUid($type, $uid);
        $this->granted('VIEW', $content);

        $revisions = $this->getEntityManager()
                ->getRepository('BackBee\ClassContent\Revision')
                ->getRevisions($content, [Revision::STATE_COMMITTED], $start, $count);

        $result = [];
        foreach ($revisions as $revision) {
            $result[] = $revision->jsonSerialize(Revision::JSON_REVISION_FORMAT);
        }

        $response = $this->createJsonResponse();
        $response->setData($result);

        if ($revisions instanceof Paginator) {
            $response->headers->set('Content-Range', sprintf('%d-%d/%d', $start, $start +
                            count($result) - 1, count($revisions)));
        }

        return $response;
    }