Hello, help please
Portfolio model
use Phalcon\Mvc\Collection; class Portfolio extends Collection { public $name; public $content; public $status; }
Portfolio controller
use Modules\Admin\Models\Portfolio; class Portfolio extends Collection { public function removePortfolio() { $this->view->disable(); $portfolio = Portfolio::findFirst(array( array("_id" => $this->request->getPost("id")) )); if ($portfolio->delete() == false) { $r = "fail"; } else { $r = "done"; } die($r); } }
I get an error Fatal error: Call to a member function delete() on boolean save () works, delete () is not! help solve the problem