<commit_before><?php

namespace SlidesLive\SlidesLiveBundle\Repository;

use Doctrine\ORM\EntityRepository;
use \SlidesLive\SlidesLiveBundle\Entity\Folder;

/**
 * PresentationRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class PresentationRepository extends EntityRepository
{    

    public function findFolderPresentations($folderId, $privacyLevel) {
        $em = $this->getEntityManager();
        $query = $em->createQuery("
            SELECT p FROM SlidesLiveBundle:Presentation p
            JOIN p.folder f
            WHERE f.id = :folderId
            AND
            p.privacy <= :privacyLevel
            ORDER BY p.dateRecorded DESC")
        ->setParameters(array(
          'folderId' => sprintf('%s', $folderId),
          'privacyLevel' => $privacyLevel)
        );
        return $query->getResult();
    }
	
	/*
    $query = $em->createQuery(
      'SELECT f
      FROM SlidesLiveBundle:Folder f
      JOIN f.account a
      WHERE a.id = :accountId
      AND a.privacy <= :privacyLevel
      AND f.privacy <= :privacyLevel
      ORDER BY f.name ASC')
      ->setParameters(array(
          'accountId' => $accountId,
          'privacyLevel' => $privacyLevel
        )
      );	
	  */
	
	public function findPublicPresentationsInCategory($categoryId) {
		$privacyLevel = 1;
        $em = $this->getEntityManager();
        $query = $em->createQuery("
            SELECT p FROM SlidesLiveBundle:Presentation p
            INNER JOIN  p.categories c
			LEFT JOIN  p.account a			
            WHERE c.id = :categoryId
			AND p.privacy <= :privacyLevel
			AND a.privacy <= :privacyLevel			
            ORDER BY p.dateRecorded DESC")
        ->setParameters(array(
          'categoryId' => sprintf('%s', $categoryId),
		  'privacyLevel' => $privacyLevel)
        );

		$recievedPresentations = $query->getResult();
		return $recievedPresentations;
	}	
    
    
}<commit_msg>PReparation for doctrine update<commit_after><?php

namespace SlidesLive\SlidesLiveBundle\Repository;

use Doctrine\ORM\EntityRepository;
use \SlidesLive\SlidesLiveBundle\Entity\Folder;

/**
 * PresentationRepository
 *
 * This class was generated by the Doctrine ORM. Add your own custom
 * repository methods below.
 */
class PresentationRepository extends EntityRepository
{    

    public function findFolderPresentations($folderId, $privacyLevel) {
        $em = $this->getEntityManager();
        $query = $em->createQuery("
            SELECT p FROM SlidesLiveBundle:Presentation p
            JOIN p.folder f
            WHERE f.id = :folderId
            AND
            p.privacy <= :privacyLevel
            ORDER BY p.dateRecorded DESC")
        ->setParameters(array(
          'folderId' => sprintf('%s', $folderId),
          'privacyLevel' => $privacyLevel)
        );
        return $query->getResult();
    }
	
	
	// DANGER! There is one special constrain AND a.id != 112 for internalRelease, might be dangerous in the FUTURE (if id's changed!!!
	public function findPublicPresentationsInCategory($categoryId) {
		$privacyLevel = 1;
        $em = $this->getEntityManager();
        $query = $em->createQuery("
            SELECT p FROM SlidesLiveBundle:Presentation p
            INNER JOIN  p.categories c
			LEFT JOIN  p.account a			
            WHERE c.id = :categoryId
			AND p.privacy <= :privacyLevel
			AND a.privacy <= :privacyLevel
			AND a.id != 112					
            ORDER BY p.dateRecorded DESC")
        ->setParameters(array(
          'categoryId' => sprintf('%s', $categoryId),
		  'privacyLevel' => $privacyLevel)
        );

		$recievedPresentations = $query->getResult();
		return $recievedPresentations;
	}	
    
    
}
{'fraction_non_alphanumeric': 0.10594245764990588, 'fraction_numerical': 0.0021511158913686476, 'mean_word_length': 2.4380776340110906, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 31, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5629806', 'n_tokens_mistral': 1138, 'n_tokens_neox': 1072, 'n_words': 266}