コード例 #1
0
ファイル: BridgeAbstract.php プロジェクト: GemsTracker/MUtil
 /**
  * Switch to single row mode and set that row.
  *
  * @param array $row Or load from model
  * @return \MUtil_Model_Format_DisplayFormatter (continuation pattern)
  * @throws \MUtil_Model_ModelException
  */
 public function setRow(array $row = null)
 {
     $this->setMode(self::MODE_SINGLE_ROW);
     if (null === $row) {
         // Stop tracking usage, in row mode it is unlikely
         // all fields have been set.
         $this->model->trackUsage(false);
         $row = $this->model->loadFirst();
         if (!$row) {
             $row = array();
         }
     }
     $this->_data = $row;
     if ($this->_chainedBridge) {
         $this->_chainedBridge->_data = $this->_data;
     }
     $this->setRepeater(array($this->_data));
     return $this;
 }