I am updating all of my code from v1 of RedBeanPHP to the current version. With Gabor's advice, I have made quite a lot of progress, but am stuck on updating a bean.
I have the following save function within a class for each bean:
public function save(){
global $redbean;
global $rb_adapter;
$this->id = R::store($this->video);
return $this->id;
}
The page is either blank or retrieves a bean like this:
$video = new Video($videoId);
collects the values from the form like this:
$video->title = $_POST["title"];
$video->date_created = $_POST["date_created"];
and saves them like this:
$video->save();
If there is no bean, then save creates a new one, but does not populate any of the fields.
If it does have a $videoId then nothing updates.
Any help would be very gratefully received.
Thank you