When I used manual "ORM (How to Manage Entities)" I managed to write little code for creating entity with 2 parameters:
<?
include ("bootstrap.php");
use\application\Espo\Core\ORM\Entity;
use\application\Espo\Controllers;
use\application\Espo\Services;
use\application\PDO;
use\application\Espo\Core\Utils\Config;
use\application\Espo\Core\ORM\EntityManager;
$entityManager = $this->getEntityManager();
$call1 = $entityManager->getEntity('Call');
$call1->set('name', 'Test Call');
$call1->set('status', 'Completed');
$entityManager->saveEntity($call1);
?>
I got same error every time I'm trying to process it
Fatal error: Using $this when not in object context in /var/www/admin/www/server_name/test.php
How to define "$this"? Documentation have nothing about it
<?
include ("bootstrap.php");
use\application\Espo\Core\ORM\Entity;
use\application\Espo\Controllers;
use\application\Espo\Services;
use\application\PDO;
use\application\Espo\Core\Utils\Config;
use\application\Espo\Core\ORM\EntityManager;
$entityManager = $this->getEntityManager();
$call1 = $entityManager->getEntity('Call');
$call1->set('name', 'Test Call');
$call1->set('status', 'Completed');
$entityManager->saveEntity($call1);
?>
I got same error every time I'm trying to process it
Fatal error: Using $this when not in object context in /var/www/admin/www/server_name/test.php
How to define "$this"? Documentation have nothing about it
Comment