Hello, when trying to add text to the database, an error occurs when saving.
Error:
My code:
Error:
InvalidArgumentException: Column 'user_id' is read only, can only be set with forceSet in src\XF\Mvc\Entity\Entity.php at line 612
My code:
HTML:
<?php
namespace LKSWDQW\WM\XF\Pub\Controller;
class Account extends XFCP_Account
{
public function actionAccountDetails()
{
$parent = parent::actionAccountDetails();
if ($this->isPost())
{
$wMessage = $this->filter('lkswdqw_wm', 'str');
$message = $this->em()->create("XF:User");
$message->user_id = 1;
$message->lkswdqw_wm = "{$wMessage}";
$message->save();
}
return $parent;
}
}