Phundament-Packages
[ class tree: Phundament-Packages ] [ index: Phundament-Packages ] [ all elements ]

Source for file LMediaCriteria.php

Documentation is available at LMediaCriteria.php

  1. <?php
  2.  
  3.  
  4. /**
  5.  * Class file.
  6.  *
  7.  * @license http://opensource.org/licenses/mozilla1.1.php Mozilla Public License
  8.  * @copyright 2005, diemeisterei GmbH. All rights reserved.
  9.  * @author $Author: schmunk $
  10.  * @version $Revision: 233 $  $Date: 2006-05-30 17:14:13 +0200 (Di, 30 Mai 2006) $
  11.  * @package Phundament.Packages
  12.  * @subpackage LMediaManager
  13.  */
  14.  
  15. /**
  16.  * builts predefined criterias for LContent
  17.  *
  18.  * @package System.Data
  19.  * @subpackage Criterias
  20.  */
  21. {
  22.     private $_parameters;
  23.  
  24.     function __construct()
  25.     {
  26.         $this->_parameters new TMap;
  27.         Prado::using("LMediaManagerCore");
  28.     }
  29.     function setActive($value)
  30.     {
  31.         $this->_parameters['Active']$value;
  32.     }
  33.     function getActive()
  34.     {
  35.         if ($this->_parameters['Active'!== false)
  36.             $this->_parameters['Active'true;
  37.         return $this->_parameters['Active'];
  38.     }
  39.     function setMissing($value)
  40.     {
  41.         $this->_parameters['Missing']$value;
  42.     }
  43.     function getMissing()
  44.     {
  45.         return $this->_parameters['Missing'];
  46.     }
  47.     function setSearchString($value)
  48.     {
  49.         $this->_parameters['SearchString']$value;
  50.     }
  51.     function getSearchString()
  52.     {
  53.         return $this->_parameters['SearchString'];
  54.     }
  55.     function setRecordIds($value)
  56.     {
  57.         $this->_parameters['RecordIds']$value;
  58.     }
  59.     function getRecordIds()
  60.     {
  61.         return $this->_parameters['RecordIds'];
  62.     }
  63.  
  64.     function build()
  65.     {
  66.         $cnew Criteria;
  67.  
  68.         $c->addAscendingOrderByColumn(LMediaManagerFilesPeer :: DIRECTORY);
  69.         $c->addAscendingOrderByColumn(LMediaManagerFilesPeer :: FILE_NAME);
  70.  
  71.         if ($param$this->getSearchString())
  72.         {
  73.             $arrayLithron :: createArrayFromString($param);
  74.             foreach ($array AS $string)
  75.             {
  76.                 #echo $string;
  77.  
  78.                 $c1$c->getNewCriterion(LMediaManagerFilesPeer :: DESCRIPTION"%{$string}%"Criteria :: LIKE);
  79.                 $c2$c->getNewCriterion(LMediaManagerFilesPeer :: DIRECTORY"%{$string}%"Criteria :: LIKE);
  80.                 $c3$c->getNewCriterion(LMediaManagerFilesPeer :: FILE_NAME"%{$string}%"Criteria :: LIKE);
  81.                 $c4$c->getNewCriterion(LMediaManagerFilesPeer :: TYPE"%{$string}%"Criteria :: LIKE);
  82.                 $c1->addOr($c4);
  83.                 $c1->addOr($c3);
  84.                 $c1->addOr($c2);
  85.                 $c->addAnd($c1);
  86.             }
  87.             $c->add(LMediaManagerFilesPeer :: STATUS1);
  88.         }
  89.  
  90.  
  91.         if ($param$this->getMissing())
  92.         {
  93.             $c->add(LMediaManagerFilesPeer :: STATUS0);
  94.         }
  95.         if ($param$this->getActive())
  96.         {
  97.             $c->add(LMediaManagerFilesPeer :: STATUS1);
  98.         }
  99.  
  100.         if ($param$this->getRecordIds())
  101.         {
  102.             $c->add(LMediaManagerFilesPeer :: ID$paramCriteria::IN);
  103.  
  104.             #$criterion= $c->getNewCriterion(LMediaManagerFilesPeer :: ID, null, Criteria :: EQUAL);
  105.             #foreach ($param AS $id)
  106.             #{
  107.             #    $_c= $c->getNewCriterion(LMediaManagerFilesPeer :: ID, $id);
  108.             #    $c->addOr($_c);
  109.             #}
  110.             #$c->add($criterion);
  111.         }
  112.  
  113.         return $c;
  114.     }
  115. }
  116. ?>

Documentation generated on Sun, 25 Feb 2007 16:10:52 +0100 by phpDocumentor 1.3.1