PHP Classes

setProperty Not Working

Recommend this page to a friend!

      Properties  >  All threads  >  setProperty Not Working  >  (Un) Subscribe thread alerts  
Subject:setProperty Not Working
Summary:setProperty fails with a Fatal Error
Messages:4
Author:Tim Rhoades
Date:2006-01-24 16:30:30
Update:2011-08-30 15:00:08
 

  1. setProperty Not Working   Reply   Report abuse  
Picture of Tim Rhoades Tim Rhoades - 2006-01-24 16:30:30
When I try to run this function:
public function addFeed($newFeed) {
$feeds=$this->p->getProperty('feeds');
$feeds.=",\/n/t".$newFeed;

$this->p->setProperty('feeds',$feeds);
}
it fails with a Fatal Error:
"PHP Fatal Error: Call to undefined method Properties_Section_Property::testKey() on line 200"

I went in and played with the code a bit to see if I could solve the problem and it led me on a chain of similar error until the it quit failing and then it failed to add the property at all. Help please?! =) I really think this is a killer idea and Zend should think of adding something like this in to the Core.

  2. Re: setProperty Not Working   Reply   Report abuse  
Picture of Herve Cros Herve Cros - 2006-08-09 14:41:12 - In reply to message 1 from Tim Rhoades
I,
I had the same error,
To make it works, I just deleted the 2 test lines (testKey and testValue on lines 200 and 201).
It should exist a better way to make it works, so if the author can fix it, it would be nice :-)

I know your problem is quite old but I post my solution to eventualy help anyone confronted to the same problem...

  3. Re: setProperty Not Working   Reply   Report abuse  
Picture of nekromana nekromana - 2011-08-30 15:00:08 - In reply to message 2 from Herve Cros
Hello, where is your solution for the problem? I didn't found it. I have the same problem and the solution with the deleting was not a solution for me.

Thanks a lot!

  4. Re: setProperty Not Working   Reply   Report abuse  
Picture of Yusuf Gündüz Yusuf Gündüz - 2017-04-04 11:26:04 - In reply to message 3 from nekromana
Hello, those who has problems with the Properties_Section_Property::testKey() methods
can fix this problem by adding the appropriate method in the Properties_Section_Property class public and static. This method should return the same class' _testKey() static method. testValue method is the same.

I like this project and i'll make some testing upon this code. So far i've found the testKey problem and some preg_replace warnings.
I'll comment about them later. Hooraay to the people who likes both java and php.