because the repository does not have the PHPMaker table insert() method.
So my question is:
If the generated PHPMaker 2026 table class still contains insert(), update(), etc., what is the correct way to obtain that generated table object from a Custom File?
You may read Global Functions -> Container(). You can use the, e.g. Container("MyTableName"). However, note that the insert() function signature is:
/**
* Inserts a table row with specified data
*
* Table expression and columns are not escaped and are not safe for user-input.
*
* @param array<string, mixed> $data (unquoted column name as key)
* @param array<string, ParameterType> $types (quoted column name as key)
*
* @return int|numeric-string The number of affected rows.
*
* @throws Exception
*/
public function insert(array $data, array $types = []): int|string
You may need to pass the parameter type for some fields if the data your provided needs conversion. It is much better (safer and easier) to use entity. As explained in Doctrine ORM, you simply do:
$entity = new Entity\MyTable; // See note below
$entity->setField1('value1');
$entity->setField2('value2');
$em = EntityManager(); // Get EntityManager of the main database (assume `MyTable` is from main database)
// $em->persist($user); // Optional for insert
$em->flush();
Note: The entity class name is basically the singular form of the table name in Pascal case, e.g. if the table name is "Users", then the entity class name is User . If the table name cannot be singularized, the original table name will be used.