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 7174211
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T15:59:14+00:00 2026-05-28T15:59:14+00:00

I am working with phpActiveRecord as my ORM. So when I query it spits

  • 0

I am working with phpActiveRecord as my ORM. So when I query it spits out objects. My problem is when iterating over the objects with the code I run in some objects that are empty/null or otherwise useless, which throw an exception in the form of a “Notice”, which I know “Notice” isn’t a make a break error, but I don’t like to leave that margin of error in my code. So now Im trying to figure out how I can check to see if something like

$this->object

is empty, null, or otherwise set. I’ve tried

if(!isset($this->object))
if(!empty($this->object))
if(trim($this->object)!=='')

which all break it seems as I’m trying to get a property of a non-object. Which would normally imply to me I am accessing an array over an object, but thats not the case as the same $this->object works for all the results where the object actually has data

  • 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-05-28T15:59:15+00:00Added an answer on May 28, 2026 at 3:59 pm

    if you’re trying to verify the existence of an method use method_exists() or is_callable()

    EDIT

    indeed, if you need to check a property of an object you can use property_exists()

    • http://www.php.net/manual/en/function.is-callable.php
    • http://php.net/manual/en/function.method-exists.php
    • http://www.php.net/manual/en/function.property-exists.php
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Working with a SqlCommand in C# I've created a query that contains a IN
Working on some matrix code, I'm concerned of performance issues. here's how it works
Working on some legacy hibernate code. How do I do the following with hbm.xml(hibernate
Working on a console application using Delphi 7, and have run into a problem.
Working with phoneGap implementing drawing with Canvas. The catch we've run into is that
Working on a little Ruby script that goes out to the web and crawls
Working on a project that parses a log of events, and then updates a
Working with python interactively, it's sometimes necessary to display a result which is some
Working on a project where a sequential set of methods must be run every
Working on a .NET app, I've run in a 'cross-thread operation not valid' exception,

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.