id; } public function __get($name) { if ($name == 'id') return $this->id; } public function Save() { global $entityManager; $entityManager->persist($this); $entityManager->flush(); } public static function Find($id) { global $entityManager; return $entityManager->find(get_called_class(), $id); } public static function Delete($id) { global $entityManager; $user = $entityManager->getReference(get_called_class(), $id); $entityManager->remove($user); $entityManager->flush(); echo "Элемент удален: $id"; } }