/**
  * @param Format|int $format
  * @return Preprocessing
  */
 public function findPreprocessingEachOne($format)
 {
     if (!$format instanceof Format) {
         $format = $this->findFormat($format);
     }
     try {
         $preprocessings = $format->preprocessings;
         if (!empty($preprocessings)) {
             foreach ($preprocessings as $preprocessing) {
                 if (isset($preprocessing->specialType) && $preprocessing->specialType == Preprocessing::SPECIALTYPE_EACHONE) {
                     return $preprocessing;
                 }
             }
         }
     } catch (\Exception $e) {
         /*chybu ignorujeme*/
     }
     $preprocessing = new Preprocessing();
     $preprocessing->name = Preprocessing::NEW_PREPROCESSING_EACHONE_NAME;
     $preprocessing->specialType = Preprocessing::SPECIALTYPE_EACHONE;
     $preprocessing->shared = true;
     $preprocessing->format = $format;
     $this->preprocessingsRepository->persist($preprocessing);
     return $preprocessing;
 }
 /**
  * @param array $params = array()
  * @param int $offset = null
  * @param int $limit = null
  * @return Preprocessing[]|null
  */
 public function findPreprocessings($params = array(), $offset = null, $limit = null)
 {
     $paramsArr = array();
     return $this->preprocessingsRepository->findAllBy($paramsArr, $offset, $limit);
 }