@@ 560-566 (lines=7) @@ | ||
557 | { |
|
558 | // use native php function if field without subdocument |
|
559 | if(false === strpos($fieldName, '.') && function_exists('array_column')) { |
|
560 | if($this->isResultAsArray()) { |
|
561 | $result = $this->findAll(); |
|
562 | } else { |
|
563 | $cursor = clone $this; |
|
564 | $result = $cursor->asArray()->findAll(); |
|
565 | unset($cursor); |
|
566 | } |
|
567 | ||
568 | return array_column($result, $fieldName, '_id'); |
|
569 | } |
|
@@ 583-589 (lines=7) @@ | ||
580 | */ |
|
581 | private function pluckDotNoteted($fieldName) |
|
582 | { |
|
583 | if($this->isResultAsArray()) { |
|
584 | $cursor = clone $this; |
|
585 | $result = $cursor->asObject()->findAll(); |
|
586 | unset($cursor); |
|
587 | } else { |
|
588 | $result = $this->findAll(); |
|
589 | } |
|
590 | ||
591 | $list = array(); |
|
592 | foreach($result as $key => $document) { |