# How do i get create a "Mautic\\CoreBundle\\Entity\\IpAddress" object

**URL:** <https://forum.mautic.org/t/how-do-i-get-create-a-mautic-corebundle-entity-ipaddress-object/22367>\
**Category:** Development\
**Created:** [January 17, 2022, 2:08pm UTC](https://forum.mautic.org/t/how-do-i-get-create-a-mautic-corebundle-entity-ipaddress-object/22367 "2022-01-17T14:08:53Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![ivan006](https://sea2.discourse-cdn.com/flex020/user_avatar/forum.mautic.org/ivan006/32/6379_2.png) [@ivan006](https://forum.mautic.org/u/ivan006)\
**Post date:** [January 17, 2022, 2:08pm UTC](https://forum.mautic.org/t/how-do-i-get-create-a-mautic-corebundle-entity-ipaddress-object/22367/1 "2022-01-17T14:08:53Z")

</div>

I either want to create one from scratch or get one based on a record from the database.

when i do

```auto
$ip = "105.233.34.7";

        $IpAddressObject = new IpAddress();
        $IpAddressObject->setIpAddress($ip);

        $hit->setIpAddress($IpAddressObject);

```

i get error

```auto
[2022-01-18 08:07:20] mautic.CRITICAL: Uncaught PHP Exception Doctrine\ORM\ORMException: 
"The EntityManager is closed." at /home/csanewsc/public_html/crm/vendor/doctrine/orm/lib
/Doctrine/ORM/ORMException.php line 145 {"exception":"[object] (Doctrine\\ORM
\\ORMException(code: 0): The EntityManager is closed. at /home/csanewsc/public_html/crm/vendor
/doctrine/orm/lib/Doctrine/ORM/ORMException.php:145)"} []

```
