App\SessionsBundle\Entity\Sessions:
  type: entity
  table: sessions
  repositoryClass: App\SessionsBundle\Repository\SessionsRepository
  indexes:
    index_symfony_cookie:
      columns: [ symfony_cookie ]
    index_cookie_name:
      columns: [ cookie_name ]
    index_remote_ip:
      columns: [ remote_ip ]
    index_created_at:
      columns: [ created_at ]
    index_updated_at:
      columns: [ updated_at ]
  id:
    id:
      type: string
      unique: true
      generator:
        strategy: CUSTOM
      customIdGenerator:
        class: Ramsey\Uuid\Doctrine\UuidGenerator
  fields:
    symfony_cookie:
      type: string
      length: 255
    cookie_name:
      type: string
      length: 255
      nullable: true
    remote_ip:
      type: string
      length: 255
      nullable: true
    remote_domain:
      type: string
      length: 255
      nullable: true
    browser_string:
      type: string
      length: 255
    created_by:
      type: string
      length: 255
      nullable: true
    created_at:
      type: datetime
    updated_at:
      type: datetime
      nullable: true
  manyToOne:
    sites:
      targetEntity: Sites
      joinColumn:
        name: site_id
        referencedColumnName: id
      cascade: ["persist", "remove"]
      inversedBy: sessions
    previous_session:
      targetEntity: Sessions
      joinColumn:
        name: previous_session_id
        referencedColumnName: id
      cascade: ["persist", "remove"]
  oneToMany:
    session_urls:
      targetEntity: SessionUrls
      mappedBy: sessions
      cascade: [ "persist", "remove" ]
    session_values:
      targetEntity: SessionValues
      mappedBy: sessions
      cascade: [ "persist", "remove" ]
    session_text_values:
      targetEntity: SessionTextValues
      mappedBy: sessions
      cascade: [ "persist", "remove" ]
  lifecycleCallbacks:
    prePersist: [ setCreatedAtValue, setUpdatedAtValue ]
    preUpdate: [ setUpdatedAtValue ]