Welcome Guest, Not a member yet? Register   Sign In
Using isset() to check if model exists
#1

[eluser]Unknown[/eluser]
Hi everyone,

I have a problem with my model that has been bugging me for quite a while now. Here's how my __construct method looks like:

Code:
private $is_team;

public function __construct(){
parent::__construct();
$this->is_team = isset($this->team);

// does some other stuff bellow
}

In this model I wanted to check if another model called "team" exists. But for some reason it returns me this error:
Quote:A PHP Error was encountered

Severity: Notice
Message: Undefined property: Dashboard::$team
Filename: core/Model.php
Line Number: 51

The error disappears if I remove the line completely, so I guess it can't be caused from somewhere else.

Any ideas on how to fix or replace this?

Thanks in advance.


Messages In This Thread
Using isset() to check if model exists - by El Forum - 06-23-2012, 04:33 AM
Using isset() to check if model exists - by El Forum - 06-23-2012, 04:46 AM



Theme © iAndrew 2016 - Forum software by © MyBB