components/DbFixtureManager.php
public function getRecord($name,$alias)
  {
    if(isset($this->_records[$name][$alias]))
    {
      if(is_string($this->_records[$name][$alias]))
      {
        $row=$this->_rows[$name][$alias];
        $model=ActiveRecord::model($this->_records[$name][$alias]);
        $key=$model->getRawTableNameSchema()->primaryKey;
        if(is_string($key))
          $pk=$row[$key];
        else
        {
          foreach($key as $k)
            $pk[$k]=$row[$k];
        }
        $this->_records[$name][$alias]=$model->find($pk);
      }
      return $this->_records[$name][$alias];
    }
    else
      return false;
  }
public function getRecord($name,$alias)
  {
    if(isset($this->_records[$name][$alias]))
    {
      if(is_string($this->_records[$name][$alias]))
      {
        $row=$this->_rows[$name][$alias];
        $model=ActiveRecord::model($this->_records[$name][$alias]);
        $key=$model->getRawTableNameSchema()->primaryKey;
        if(is_string($key))
          $pk=$row[$key];
        else
        {
          foreach($key as $k)
            $pk[$k]=$row[$k];
        }
        $this->_records[$name][$alias]=$model->find($pk);
      }
      return $this->_records[$name][$alias];
    }
    else
      return false;
  }
public function getRecord ( $ name , $ alias ) { if ( isset ( $ this -> _records [ $ name ] [ $ alias ] ) ) { if ( is_string ( $ this -> _records [ $ name ] [ $ alias ] ) ) { $ row = $ this -> _rows [ $ name ] [ $ alias ] ; $ model = ActiveRecord :: model ( $ this -> _records [ $ name ] [ $ alias ] ) ; $ key = $ model -> getRawTableNameSchema ( ) -> primaryKey ; if ( is_string ( $ key ) ) $ pk = $ row [ $ key ] ; else { foreach ( $ key as $ k ) $ pk [ $ k ] = $ row [ $ k ] ; } $ this -> _records [ $ name ] [ $ alias ] = $ model -> find ( $ pk ) ; } return $ this -> _records [ $ name ] [ $ alias ] ; } else return false ; }
Returns the specified ActiveRecord instance in the fixture data.
@param string $name the fixture name
@param string $alias the alias for the fixture data row
@return ActiveRecord the ActiveRecord instance. False is returned if there is no such fixture row.
Returns the specified ActiveRecord instance in the fixture data .