Answer:
Explanation:
namespace Jeroen\ReviewIntegration\Observer;
use Magento\Framework\Event\ObserverInterface;
class ProductReview implements ObserverInterface
{
protected $_storeManager;
protected $_request;
public function __construct(
\Magento\Store\Model\StoreManagerInterface $storeManager,
\Magento\Framework\App\Request\Http $request
) {
$this->_storeManager = $storeManager;
$this->_request = $request;
}
public function execute(\Magento\Framework\Event\Observer $observer)
{
return 'test';
}
}
Algorithm is part of computer science. You an learn it on Khan academy. (you probably werent looking for this but no one was answering)
Answer:
The trigger code is given below
create trigger F1_Del
after delete on Friend
for each row
when exists (select * from Friend
where ID1 = Old.ID2 and ID2 = Old.ID1)
begin
delete from Friend
where (ID1 = Old.ID2 and ID2 = Old.ID1);
end
create trigger F1_Insert
after insert on Friend
for each row
when not exists (select * from Friend
where ID1 = New.ID2 and ID2 = New.ID1)
begin
insert into Friend values (New.ID2, New.ID1);
end