コード例 #1
0
 /**
  * Define the hydration schema based on a query object.
  * Fills the Formatter's properties using a Criteria as source
  *
  * @param \Propel\Runtime\ActiveQuery\BaseModelCriteria $criteria
  * @param \Propel\Runtime\DataFetcher\DataFetcherInterface|null $dataFetcher
  *
  * @return $this|\Propel\Runtime\Formatter\AbstractFormatter The current formatter object
  */
 public function init(BaseModelCriteria $criteria, DataFetcherInterface $dataFetcher = null)
 {
     $this->dbName = $criteria->getDbName();
     $this->setClass($criteria->getModelName());
     $this->setWith($criteria->getWith());
     $this->asColumns = array_merge($criteria->getSelectColumns(), $criteria->getAsColumns());
     $this->hasLimit = $criteria->getLimit() !== -1;
     if ($dataFetcher) {
         $this->setDataFetcher($dataFetcher);
     }
     return $this;
 }
コード例 #2
0
 /**
  * Ensures deep cloning of attached objects
  */
 public function __clone()
 {
     parent::__clone();
     foreach ($this->with as $key => $join) {
         $this->with[$key] = clone $join;
     }
     if (null !== $this->formatter) {
         $this->formatter = clone $this->formatter;
     }
 }
コード例 #3
0
ファイル: ModelCriteria.php プロジェクト: sungwookpark/myapi
 /**
  * Override method to prevent an addition of self columns.
  *
  * @param string $name
  * @return $this|Criteria
  */
 public function addSelectColumn($name)
 {
     $this->isSelfSelected = true;
     return parent::addSelectColumn($name);
 }