{
    "content": [
        {
            "type": "text",
            "text": "# User::Identity::Item (perldoc)\n\n## NAME\n\nUser::Identity::Item - general base class for User::Identity\n\n## DESCRIPTION\n\nThe \"User::Identity::Item\" base class is extended into useful modules: it has no use by its own.\n\n## Sections\n\n- **NAME**\n- **INHERITANCE**\n- **SYNOPSIS**\n- **DESCRIPTION**\n- **METHODS** (4 subsections)\n- **DIAGNOSTICS**\n- **SEE ALSO**\n- **LICENSE**\n\nUse structuredContent.sections for detailed options, examples, and full documentation.\n"
        }
    ],
    "structuredContent": {
        "command": "User::Identity::Item",
        "section": "",
        "mode": "perldoc",
        "summary": "User::Identity::Item - general base class for User::Identity",
        "synopsis": "",
        "tldr_summary": null,
        "tldr_examples": [],
        "tldr_source": null,
        "flags": [],
        "examples": [],
        "see_also": [],
        "section_outline": [
            {
                "name": "NAME",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "INHERITANCE",
                "lines": 8,
                "subsections": []
            },
            {
                "name": "SYNOPSIS",
                "lines": 1,
                "subsections": []
            },
            {
                "name": "DESCRIPTION",
                "lines": 2,
                "subsections": []
            },
            {
                "name": "METHODS",
                "lines": 1,
                "subsections": [
                    {
                        "name": "Constructors",
                        "lines": 18
                    },
                    {
                        "name": "Attributes",
                        "lines": 12
                    },
                    {
                        "name": "Collections",
                        "lines": 73
                    },
                    {
                        "name": "Searching",
                        "lines": 13
                    }
                ]
            },
            {
                "name": "DIAGNOSTICS",
                "lines": 33,
                "subsections": []
            },
            {
                "name": "SEE ALSO",
                "lines": 3,
                "subsections": []
            },
            {
                "name": "LICENSE",
                "lines": 5,
                "subsections": []
            }
        ],
        "sections": {
            "NAME": {
                "content": "User::Identity::Item - general base class for User::Identity\n",
                "subsections": []
            },
            "INHERITANCE": {
                "content": "User::Identity::Item is extended by\nMail::Identity\nUser::Identity\nUser::Identity::Archive\nUser::Identity::Collection\nUser::Identity::Location\nUser::Identity::System\n",
                "subsections": []
            },
            "SYNOPSIS": {
                "content": "",
                "subsections": []
            },
            "DESCRIPTION": {
                "content": "The \"User::Identity::Item\" base class is extended into useful modules: it has no use by its own.\n",
                "subsections": []
            },
            "METHODS": {
                "content": "",
                "subsections": [
                    {
                        "name": "Constructors",
                        "content": "User::Identity::Item->new( [$name], %options )\n-Option     --Default\ndescription  undef\nname         <required>\nparent       undef\n\ndescription => STRING\nFree format description on the collected item.\n\nname => STRING\nA simple name for this item. Try to give a useful name in the context of the item time.\nEach time when you lookup items, you need to specify this name, so it should be unique and\nnot to hard to handle in your program. For instance, when a person is addressed, you\nusually will give him/her this a nickname.\n\nparent => OBJECT\nThe encapsulating object: the object which collects this one.\n"
                    },
                    {
                        "name": "Attributes",
                        "content": "$obj->description()\nFree format description on this item. Please do not add any significance to the content of\nthis field: if you are in need for an extra attribute, please contact the author of the\nmodule to implement it, or extend the object to suit your needs.\n\n$obj->name( [$newname] )\nThe name of this item. Names are unique within a collection... a second object with the same\nname within any collection will destroy the already existing object with that name.\n\nChanging the name of an item is quite dangerous. You probably want to call\nUser::Identity::Collection::renameRole() instead.\n"
                    },
                    {
                        "name": "Collections",
                        "content": "$obj->add($collection, $role)\nThe $role is added to the $collection. The $collection is the name of a collection, which\nwill be created automatically with addCollection() if needed. The $collection can also be\nspecified as existing collection object.\n\nThe $role is anything what is acceptable to User::Identity::Collection::addRole() of the\ncollection at hand, and is returned. $role typically is a list of parameters for one role,\nor a reference to an array containing these values.\n\nexample:\n\nmy $ui   = User::Identity->new(...);\nmy $home = $ui->add(location => [home => street => '27 Roadstreet', ...] );\nmy $work = $ui->add(location => work, tel => '+31-2231-342-13', ... );\n\nmy $travel = User::Identity::Location->new(travel => ...);\n$ui->add(location => $travel);\n\nmy $system = User::Identity::Collection::System->new(...);\n$ui->add($system => 'localhost');\n\n$obj->addCollection( $object | <[$type], %options> )\nAdd a new collection of roles to an item. This can be achieved in two ways: either create an\nUser::Identity::Collection $object yourself and then pass that to this method, or supply all\nthe %options needed to create such an object and it will be created for you. The object\nwhich is added is returned, and can be used for many methods directly.\n\nFor %options, see the specific type of collection. Additional options are listed below.\n\n-Option--Default\ntype    <required>\n\ntype => STRING|CLASS\nThe nickname of a collection class or the CLASS name itself of the object to be created.\nRequired if an object has to be created. Predefined type nicknames are \"email\", \"system\",\nand \"location\".\n\nexample:\n\nmy $me   = User::Identity->new(...);\nmy $locs = User::Identity::Collection::Locations->new();\n$me->addCollection($locs);\n\nmy $email = $me->addCollection(type => 'email');\nmy $email = $me->addCollection('email');\n\n$obj->collection($name)\nIn scalar context the collection object with the $name is returned. In list context, all the\nroles within the collection are returned.\n\nexample:\n\nmy @roles = $me->collection('email');        # list of collected items\nmy @roles = $me->collection('email')->roles; # same of collected items\nmy $coll  = $me->collection('email');        # a User::Identity::Collection\n\n$obj->parent( [$parent] )\nReturns the parent of an Item (the enclosing item). This may return \"undef\" if the object is\nstand-alone.\n\n$obj->removeCollection($object|$name)\n$obj->type()\nUser::Identity::Item->type()\nReturns a nice symbolic name for the type.\n\n$obj->user()\nGo from this object to its parent, to its parent, and so on, until a User::Identity is found\nor the top of the object tree has been reached.\n\nexample:\n\nprint $email->user->fullName;\n"
                    },
                    {
                        "name": "Searching",
                        "content": "$obj->find($collection, $role)\nReturns the object with the specified $role within the named collection. The collection can\nbe specified as name or object.\n\nexample:\n\nmy $role  = $me->find(location => 'work');       # one location\nmy $role  = $me->collection('location')->find('work'); # same\n\nmy $email = $me->addCollection('email');\n$me->find($email => 'work');\n$email->find('work');   # same\n"
                    }
                ]
            },
            "DIAGNOSTICS": {
                "content": "Error: $object is not a collection.\nThe first argument is an object, but not of a class which extends\nUser::Identity::Collection.\n\nError: Cannot load collection module for $type ($class).\nEither the specified $type does not exist, or that module named $class returns compilation\nerrors. If the type as specified in the warning is not the name of a package, you specified\na nickname which was not defined. Maybe you forgot the 'require' the package which defines\nthe nickname.\n\nError: Creation of a collection via $class failed.\nThe $class did compile, but it was not possible to create an object of that class using the\noptions you specified.\n\nError: Don't know what type of collection you want to add.\nIf you add a collection, it must either by a collection object or a list of options which\ncan be used to create a collection object. In the latter case, the type of collection must\nbe specified.\n\nError: Each item requires a name\nYou have to specify a name for each item. These names need to be unique within one\ncollection, but feel free to give the same name to an e-mail address and a location.\n\nWarning: No collection $name\nThe collection with $name does not exist and can not be created.\n\nWarning: Unknown option $name for a $class\nOne used option is not defined. Check the manual page of the class to see which options are\naccepted.\n\nWarning: Unknown options @names for a $class\nMore than one option is not defined.\n",
                "subsections": []
            },
            "SEE ALSO": {
                "content": "This module is part of User-Identity distribution version 1.01, built on February 11, 2022.\nWebsite: http://perl.overmeer.net/CPAN/\n",
                "subsections": []
            },
            "LICENSE": {
                "content": "Copyrights 2003-2022 by [Mark Overmeer <markov@cpan.org>]. For other contributors see ChangeLog.\n\nThis program is free software; you can redistribute it and/or modify it under the same terms as\nPerl itself. See http://dev.perl.org/licenses/\n",
                "subsections": []
            }
        }
    }
}