コード例 #1
0
 /**
  * The functions that fixes and returns a value.
  *
  * Be warned: this function may return a lazy value.
  *
  * @param \MUtil_Lazy_StackInterface $stack A \MUtil_Lazy_StackInterface object providing variable data
  * @return mixed
  */
 public function __toValue(\MUtil_Lazy_StackInterface $stack)
 {
     if (!$this->repeater) {
         $this->repeater = $this->bridge->getRepeater();
     }
     $out = null;
     $current = $this->repeater->__current();
     if ($current) {
         if (isset($current->{$this->fieldName})) {
             $out = $current->{$this->fieldName};
         }
     }
     return $this->bridge->format($this->fieldName, $out);
 }
コード例 #2
0
ファイル: BridgeAbstract.php プロジェクト: GemsTracker/MUtil
 /**
  * is there a repeater source for the lazy data
  *
  * @return boolean
  */
 public function hasRepeater()
 {
     return $this->_repeater instanceof \MUtil_Lazy_RepeatableInterface || $this->_chainedBridge && $this->_chainedBridge->hasRepeater();
 }
コード例 #3
0
 /**
  * Set the repeater source for the lazy data
  *
  * @param mixed $repeater \MUtil_Lazy_RepeatableInterface or something that can be made into one.
  * @return \MUtil_Model_Format_DisplayFormatter (continuation pattern)
  */
 public function setRepeater($repeater)
 {
     parent::setRepeater($repeater);
     $this->table->setRepeater($this->_repeater);
     return $this;
 }