DDC-3242: Initialize the type array #4010

Closed
opened 2026-01-22 14:33:39 +01:00 by admin · 3 comments
Owner

Originally created by @doctrinebot on GitHub (Aug 7, 2014).

Originally assigned to: @Ocramius on GitHub.

Jira issue originally created by user bilou:

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

Originally created by @doctrinebot on GitHub (Aug 7, 2014). Originally assigned to: @Ocramius on GitHub. Jira issue originally created by user bilou: 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
admin closed this issue 2026-01-22 14:33:40 +01:00
Author
Owner

@doctrinebot commented on GitHub (Aug 7, 2014):

Comment created by @ocramius:

You just set it in your entities:

class Foo
{
    private $id;
    private $someArrayField;

    public function **construct()
    {
        $this->someArrayField = ['un' => 'one', 'deux' => 'two', 'trois' => 'three'];
    }
}
@doctrinebot commented on GitHub (Aug 7, 2014): Comment created by @ocramius: You just set it in your entities: ``` class Foo { private $id; private $someArrayField; public function **construct() { $this->someArrayField = ['un' => 'one', 'deux' => 'two', 'trois' => 'three']; } } ```
Author
Owner

@doctrinebot commented on GitHub (Aug 7, 2014):

Issue was closed with resolution "Fixed"

@doctrinebot commented on GitHub (Aug 7, 2014): Issue was closed with resolution "Fixed"
Author
Owner

@doctrinebot commented on GitHub (Aug 7, 2014):

Comment created by bilou:

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

@doctrinebot commented on GitHub (Aug 7, 2014): Comment created by bilou: Ok thanks, I thought of initializing into the annotations as for the other types.
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: doctrine/archived-orm#4010