I am using RedBean and i want to remove the relationships existing at sharedList. Right now i am using
$bean->sharedList = array();
R::store($bean);
But it does not work. Any suggestions?
I am using RedBean and i want to remove the relationships existing at sharedList. Right now i am using
$bean->sharedList = array();
R::store($bean);
But it does not work. Any suggestions?
The property containing the collection needs to have the name of a bean type in it;
e.g.
$class->sharedStudent = array();
R::store($class);
This will remove the relationship between the $class bean and any student beans it was previously related to. The student beans will not be deleted however.
Your example would only work if the shared bean type was of type 'list' (which I doubt it is.)
Incidentally, you don't need to add 'List' onto the end of a shared collection any more. This was deprecated a few versions back, near the beginning of Redbean 4 I believe.
As per RedBean documentation
In your code you are not sharing it with any other list. Would you share what exactly you are trying to achieve.