Some domain logic is beautiful if applied to the entity itself. For example, the following things are in order:
class myEntity {
protected $items;
public function equals($otherEntity){
}
public function subtotal(){
$total = 0;
foreach($this->items as $i) $total += $i;
return $i;
}
}
What you do not want in entites are things with side effects outside this object (or its entities), data persistence (entities should never know about the EntityManager or repositories, etc.).
, , - ( Entity). - , , .