Beispiel #1
0
 /**
  * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection
  */
 protected function getArgDefinitions()
 {
     $collection = new ArgumentCollection(Argument::createIntListTypeArgument('id'), Argument::createIntListTypeArgument('exclude'), Argument::createBooleanOrBothTypeArgument('visible', 1), new Argument('order', new TypeCollection(new EnumListType(array('alpha', 'alpha-reverse', 'manual', 'manual-reverse', 'random'))), 'manual'), Argument::createIntTypeArgument('lang'), Argument::createIntTypeArgument('category'), Argument::createIntTypeArgument('product'), Argument::createIntTypeArgument('folder'), Argument::createIntTypeArgument('content'), Argument::createAnyTypeArgument('source'), Argument::createIntTypeArgument('source_id'), Argument::createBooleanTypeArgument('force_return', true));
     // Add possible document sources
     foreach ($this->possible_sources as $source) {
         $collection->addArgument(Argument::createIntTypeArgument($source));
     }
     return $collection;
 }
Beispiel #2
0
 /**
  * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection
  */
 protected function getArgDefinitions()
 {
     $collection = new ArgumentCollection(Argument::createIntListTypeArgument('id'), Argument::createIntListTypeArgument('exclude'), Argument::createBooleanOrBothTypeArgument('visible', 1), new Argument('order', new TypeCollection(new EnumListType(array('alpha', 'alpha-reverse', 'manual', 'manual-reverse', 'random'))), 'manual'), Argument::createIntTypeArgument('width'), Argument::createIntTypeArgument('height'), Argument::createIntTypeArgument('rotation', 0), Argument::createAnyTypeArgument('background_color'), Argument::createIntTypeArgument('quality'), new Argument('resize_mode', new TypeCollection(new EnumType(array('crop', 'borders', 'none'))), 'none'), Argument::createAnyTypeArgument('effects'), Argument::createIntTypeArgument('category'), Argument::createIntTypeArgument('product'), Argument::createIntTypeArgument('folder'), Argument::createIntTypeArgument('content'), Argument::createAnyTypeArgument('source'), Argument::createIntTypeArgument('source_id'), Argument::createBooleanTypeArgument('force_return', true), Argument::createBooleanTypeArgument('ignore_processing_errors', true));
     // Add possible image sources
     foreach ($this->possible_sources as $source) {
         $collection->addArgument(Argument::createIntTypeArgument($source));
     }
     return $collection;
 }
 /**
  * @return \Thelia\Core\Template\Loop\Argument\ArgumentCollection
  */
 protected function getArgDefinitions()
 {
     $imageCollection = parent::getArgDefinitions();
     $collection = new ArgumentCollection();
     foreach ($imageCollection as $argument) {
         if (!in_array($argument->name, $this->possible_sources) and $argument->name != 'source') {
             $collection->addArgument($argument);
         }
     }
     return $collection;
 }
 public function testArgumentCollectionCreateAndWalk()
 {
     $collection = new ArgumentCollection(new Argument('arg0', new TypeCollection(new Type\AnyType())), new Argument('arg1', new TypeCollection(new Type\AnyType())));
     $collection->addArgument(new Argument('arg2', new TypeCollection(new Type\AnyType())));
     $this->assertTrue($collection->getCount() == 3);
     $this->assertTrue($collection->key() == 'arg0');
     $collection->next();
     $this->assertTrue($collection->key() == 'arg1');
     $collection->next();
     $this->assertTrue($collection->key() == 'arg2');
     $collection->next();
     $this->assertFalse($collection->valid());
     $collection->rewind();
     $this->assertTrue($collection->key() == 'arg0');
 }