Exemplo n.º 1
0
 public function testExtends()
 {
     $objDc = $this->objProperty->getDataContainer();
     $objNew = $objDc->createProperty('neu');
     $this->assertEquals($objNew, $objNew->extend($this->objProperty));
     $this->assertEquals($objNew->getLabel(), $this->objProperty->getLabel());
     $this->assertEquals($objNew->getEvaluation(), $this->objProperty->getEvaluation());
     $this->assertEquals($objNew->getParent(), $this->objProperty->getParent());
     $this->assertEquals($objNew->isSearchable(), $this->objProperty->isSearchable());
     $this->assertEquals($objNew->isSortable(), $this->objProperty->isSortable());
     $this->assertEquals($objNew->isFilterable(), $this->objProperty->isFilterable());
     $this->assertNotEquals($objNew->getName(), $this->objProperty->getName());
     $this->assertNotEmpty($GLOBALS['TL_DCA']['tl_test']['fields']['neu'], $GLOBALS['TL_DCA']['tl_test']['fields']['test']);
 }
Exemplo n.º 2
0
 /**
  * Get activated
  *
  * @param Property $objProperty
  * @param ModelInterface $objModel
  *
  * @return Definition\SubPalette|null
  */
 public static function getActivePropertySubPalette(Property $objProperty, ModelInterface $objModel)
 {
     $objProperty->getDataContainer();
     $varValue = $objModel->getProperty($objProperty->getName());
     if ($objProperty->hasSubPalette($varValue)) {
         return $objProperty->getSubPalette($varValue);
     }
     return null;
 }