Details

    • Type: Documentation Documentation
    • Status: Resolved
    • Priority: Major Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: None
    • Component/s: None
    • Security Level: All
    • Environment:
      windows

      Description

      Hi there,

      I'm having issues with initializing a field in one of my entities whose type is array. Could you just give an example where an array field is initilized with this value for instance (array('un' => 'one', 'deux' => 'two', 'trois' => 'three'))? Because I can't find anything about the array type initilization. Thanks a lot

        Activity

        Hide
        Marco Pivetta added a comment -

        You just set it in your entities:

        class Foo
        {
            private $id;
            private $someArrayField;
        
            public function __construct()
            {
                $this->someArrayField = ['un' => 'one', 'deux' => 'two', 'trois' => 'three'];
            }
        }
        
        Show
        Marco Pivetta added a comment - You just set it in your entities: class Foo { private $id; private $someArrayField; public function __construct() { $ this ->someArrayField = ['un' => 'one', 'deux' => 'two', 'trois' => 'three']; } }
        Hide
        bilou gagou added a comment -

        Ok thanks, I thought of initializing into the annotations as for the other types.

        Show
        bilou gagou added a comment - Ok thanks, I thought of initializing into the annotations as for the other types.

          People

          • Assignee:
            Marco Pivetta
            Reporter:
            bilou gagou
          • Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: