yii\mongodb\Query::select PHP Method

select() public method

Sets the list of fields of the results to return.
public select ( array $fields )
$fields array fields of the results to return.
    public function select(array $fields)
    {
        $this->select = $fields;
        return $this;
    }

Usage Example

Exemplo n.º 1
0
 public function actionEdit()
 {
     $id = $_GET['id'];
     $query = new Query();
     $query->select(['type_name', 'level', 'p_id'])->from('type')->where(['_id' => $id]);
     $data['rows'] = $query->one();
     $query->select(['type_name', 'level', 'p_id'])->from('type')->where(['p_id' => '0']);
     $data['arr'] = $query->all();
     return $this->renderPartial("edit", $data);
 }
All Usage Examples Of yii\mongodb\Query::select