RSS Feed/News Developer feature: Improve entity creation process

Status
Not open for further replies.

ENXF NET

Administrator
Staff member
Administrator
Moderator
+Lifetime VIP+
S.V.I.P.S Member
S.V.I.P Member
V.I.P Member
Collaborate
Registered
Joined
Nov 13, 2018
Messages
24,679
Points
823

Reputation:

Creating various entities is a fairly common task, and requires manual fixing of type hinting.

Code like this is very common.
PHP:

Code:
/** @var \XF\Entity\Phrase $phrase */
$phrase = $this->_em->create('XF:Phrase');
or
PHP:

Code:
$phrase = $this->_em->create('XF:Phrase');
assert($phrase instanceof \XF\Entity\Phrase );
In either case, a stringy identifier is being used and the full type is repeated again before/after. phpstorm's metadata can sometimes help, but not in all cases.

There is however a...

Read more

Continue reading...
 
Status
Not open for further replies.
Top