Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9172109
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T16:16:03+00:00 2026-06-17T16:16:03+00:00

When I use findFirst of mongo extension I can use var_dump on its out

  • 0

When I use findFirst of mongo extension I can use var_dump on its out put and see actual mongo document easliy.

But when I do that on output of \Phalcon\Mvc\Collection::findFirst tens of properties and methods are outputed and I can not find desired data easily.

Is there any way to get just main data when using var_dump on this class and other classes?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T16:16:04+00:00Added an answer on June 17, 2026 at 4:16 pm

    One way to do this is to add a method to your collection that uses reflection and filters only the public properties:

    class MyCollection extends \Phalcon\Mvc\Collection {
        public function getProperties() {
            $reflector = new \ReflectionObject($this);
            ob_start();
            foreach($reflector->getProperties(\ReflectionProperty::IS_PUBLIC) as $property) {
                echo "Property: ";
                var_dump($property->getName());
                echo "Value: ";
                var_dump($property->getValue($this));
            }
            $output = ob_get_contents();
            ob_end_clean();
    
            return $output;
        }
    }
    

    A better formatting could probably be desired. In order to see the document:

    $collection = MyCollection::findFirst();
    echo $collection->getProperties();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How can you use stringstream to tokenize a line that looks like this. [label]
When we use ActiveRecord, we can use: User.find(:first, :conditions=>[name=?, name]) It looks like ActiveRecord
I have a Model with data that I want to use to populate a
Been working on this program which requires the use of a function that compares
Consider that I have a MainWindow that has the following button declared in its
I know I can use $this->Model->save() to update a particular record if I pass
I want to enumerate all the file in the C:\Windows\Fonts\ First I use FindFirst&FindNext
How to find first non-repeating element in an array. Provided that you can only
If I just use File to install fonts, installation goes fine, but the fonts
I can't seem to find the _findfirst / findfirst, _findnext / findnext API on

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.