createUser($id + self::POST_GENERATOR_SYSTEM_POST_USER); $post = new Post( $id, $user, $this->getFaker()->text(500), $this->getFaker()->text(5000), new ArrayCollection(), ); $this->getEntityManager()->persist($post); $this->getEntityManager()->flush(); return $post; } }