Skip to content

Commit

Permalink
Return single document if limit 1
Browse files Browse the repository at this point in the history
Signed-off-by: Adam Engebretson <[email protected]>
  • Loading branch information
adamgoose committed Oct 17, 2013
1 parent 0b0f396 commit e0ec3bc
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion src/Adamgoose/PrismicIo/Prismic.php
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ public function get()
$return = $ctx->submit();

if($this->offset != 0 || isset($this->limit))
return array_slice($return, $this->offset, $this->limit);
$return = array_slice($return, $this->offset, $this->limit);

if(count($return) == 1)
return $return[0];
else
return $return;
}
Expand Down

0 comments on commit e0ec3bc

Please sign in to comment.