Кемеровские программисты php общаются здесь
-
Anonymous
Ошибка с пользовательской моделью. Попытка получить свойство необъектного Codeigniter 2.x.
Сообщение
Anonymous »
Я пытаюсь исправить приложение codeigniter. В модели всегда говорилось: Сообщение: Попытка получить свойство необъекта
Вот моя модель:
Код: Выделить всё
class Custom_lesson extends Domain_class
{
//private $customSftObj = null;
public $customSftObj = null;
public $custom_sft = null;
public function __construct()
{
parent::__construct();
}
public function getCustomSft()
{
if (FALSE == empty($this->customSftObj))
return $this->customSftObj;
$customSftDAO = $this->loadDAO('custom_sft');
$this->customSftObj = $customSftDAO->find($this->custom_sft);
return $this->customSftObj;
}
public function getSft() {
return $this->getCustomSft();
}
public function doDestroy()
{
$custom_sft = $this->getCustomSft();
if ( $this->hasSM() )
unlink( custom_sft_path($custom_sft->owner_id, $custom_sft->subject, $custom_sft->grade) . 'lessons/_lesson_' . $this->id . '_SM.pdf' );
if ( $this->hasTM() )
unlink( custom_sft_path($custom_sft->owner_id, $custom_sft->subject, $custom_sft->grade) . 'lessons/_lesson_' . $this->id . '_TM.pdf' );
}
public function hasSM()
{
$custom_sft = $this->getCustomSft();
return file_exists( custom_sft_path($custom_sft->owner_id, $custom_sft->subject, $custom_sft->grade) . 'lessons/_lesson_' . $this->id . '_SM.pdf');
}
public function hasTM()
{
$custom_sft = $this->getCustomSft();
return file_exists( custom_sft_path($custom_sft->owner_id, $custom_sft->subject, $custom_sft->grade) . 'lessons/_lesson_' . $this->id . '_TM.pdf');
}
а это моя собственная модель Дао:
Код: Выделить всё
Подробнее здесь: [url]https://stackoverflow.com/questions/23572739/error-with-custom-model-trying-to-get-property-of-non-object-codeigniter-2-x[/url]
1768900942
Anonymous
Я пытаюсь исправить приложение codeigniter. В модели всегда говорилось: Сообщение: Попытка получить свойство необъекта
Вот моя модель:
[code]class Custom_lesson extends Domain_class
{
//private $customSftObj = null;
public $customSftObj = null;
public $custom_sft = null;
public function __construct()
{
parent::__construct();
}
public function getCustomSft()
{
if (FALSE == empty($this->customSftObj))
return $this->customSftObj;
$customSftDAO = $this->loadDAO('custom_sft');
$this->customSftObj = $customSftDAO->find($this->custom_sft);
return $this->customSftObj;
}
public function getSft() {
return $this->getCustomSft();
}
public function doDestroy()
{
$custom_sft = $this->getCustomSft();
if ( $this->hasSM() )
unlink( custom_sft_path($custom_sft->owner_id, $custom_sft->subject, $custom_sft->grade) . 'lessons/_lesson_' . $this->id . '_SM.pdf' );
if ( $this->hasTM() )
unlink( custom_sft_path($custom_sft->owner_id, $custom_sft->subject, $custom_sft->grade) . 'lessons/_lesson_' . $this->id . '_TM.pdf' );
}
public function hasSM()
{
$custom_sft = $this->getCustomSft();
return file_exists( custom_sft_path($custom_sft->owner_id, $custom_sft->subject, $custom_sft->grade) . 'lessons/_lesson_' . $this->id . '_SM.pdf');
}
public function hasTM()
{
$custom_sft = $this->getCustomSft();
return file_exists( custom_sft_path($custom_sft->owner_id, $custom_sft->subject, $custom_sft->grade) . 'lessons/_lesson_' . $this->id . '_TM.pdf');
}
[/code]
а это моя собственная модель Дао:
[code]
Подробнее здесь: [url]https://stackoverflow.com/questions/23572739/error-with-custom-model-trying-to-get-property-of-non-object-codeigniter-2-x[/url]