class EntityUtil

Methods

static bool
isEmpty($entity)

LAZY loading したエンティティの有無をチェックする.

static bool
isNotEmpty($entity)

LAZY loading したエンティティの有無をチェックする.

Details

at line 46
static bool isEmpty($entity)

LAZY loading したエンティティの有無をチェックする.

削除済みのエンティティを LAZY loading した場合、 soft_delete filter で フィルタリングされてしまい、正常に取得することができない. しかし、 Proxy オブジェクトとして取得されるため、この関数を使用して 有無をチェックする. この関数を使用せず、該当のオブジェクトのプロパティを取得しようとすると、 EntityNotFoundException がスローされてしまう.

Parameters

$entity LAZY loading したエンティティ

Return Value

bool エンティティが削除済みの場合 true

See also

https://github.com/EC-CUBE/ec-cube/pull/602#issuecomment-125431246

at line 69
static bool isNotEmpty($entity)

LAZY loading したエンティティの有無をチェックする.

EntityUtil::isEmpty() の逆の結果を返します.

Parameters

$entity

Return Value

bool

See also

EntityUtil::isEmpty()