Details

    • Type: Bug Bug
    • Status: Open
    • Priority: Major Major
    • Resolution: Unresolved
    • Affects Version/s: 1.2.1
    • Fix Version/s: None
    • Component/s: None
    • Labels:
      None
    • Environment:

      Description

      schema.yml

      CheCategory:
      options:
      collate: utf8_unicode_ci
      charset: utf8
      actAs:
      Timestampable: ~
      NestedSet: ~
      columns:
      name:
      type: string(255)
      CheItem:
      options:
      collate: utf8_unicode_ci
      charset: utf8
      actAs:
      Timestampable: ~
      columns:
      name:
      type: string(255)
      category_id:
      type: integer(12)
      relations:
      CheItemPhoto:
      type: many
      local: id
      foreign: item_id
      CheItemAttribute:
      type: many
      local: id
      foreign: item_id
      CheCategory:
      local: category_id
      foreign: id

      CheAttribute:
      options:
      collate: utf8_unicode_ci
      charset: utf8
      columns:
      name:
      type: string(255)
      attr_type:
      type: integer(2)
      label:
      type: string(255)
      sort_order:
      type: integer(5)
      default: 9999
      relations:
      CheItemAttribute:
      local: id
      foreign: attribute_id

      CheItemAttribute:
      options:
      collate: utf8_unicode_ci
      charset: utf8
      columns:
      item_id:
      type: integer(12)
      attr_value:
      type: clob
      attribute_id:
      type: integer(12)
      relations:
      CheItem:
      local: item_id
      foreign: id
      CheAttribute:
      local: attribute_id
      foreign: id

      CheItemPhoto:
      options:
      collate: utf8_unicode_ci
      charset: utf8
      actAs:
      Timestampable: ~
      columns:
      item_id:
      type: integer(12)
      basefile:
      type: string(255)
      caption:
      type: string(255)
      is_default:
      type: boolean
      default: false
      relations:
      CheItem:
      local: item_id
      foreign: id

      fixtures.yml

      CheAttribute:
      Attr_price:
      name: Price
      label: price
      sort_order: 1
      attr_type: <?php echo CheAttribute::ATTR_STRING."\n" ?>
      Attr_desc:
      name: Desc
      label: desc
      sort_order: 2
      attr_type: <?php echo CheAttribute::ATTR_HTML."\n" ?>

      CheCategory:
      Cat_0:
      name: Items category
      children:
      Cat_1:
      name: Cups
      children:
      Cat_2:
      name: Beer
      Cat_3:
      name: Tea
      children:
      Cat_5:
      name: China
      Cat_6:
      name: Russian
      Cat_4:
      name: Coffee

      CheItem:
      Item_8:
      name: Vobla
      CheCategory: Cat_1
      Item_1:
      name: Vobla2
      CheCategory: Cat_2

      CheItemAttribute:
      Ite_attr_0:
      CheItem: Item_1
      CheAttribute: Attr_price
      attr_value: 10
      Ite_attr_1:
      CheItem: Item_1
      CheAttribute: Attr_desc
      attr_value: abcsdd
      Ite_attr_2:
      CheItem: Item_8
      CheAttribute: Attr_price
      attr_value: 123
      Ite_attr_3:
      CheItem: Item_8
      CheAttribute: Attr_desc
      attr_value: test

      code:

      $b = Doctrine::getTable("CheAttribute")>createQuery("A2")>leftJoin("A2.CheItemAttribute IA2 WITH IA2.item_id = ?", 2)>addOrderBy("A2.sort_order ASC")>execute();

      var_dump($b[0]>getCheItemAttribute()>getAttrValue());

      $tb = Doctrine::getTable("CheAttribute")>createQuery("A")>leftJoin("A.CheItemAttribute IA WITH IA.item_id = ?", 1)>addOrderBy("A.sort_order ASC")>execute();

      var_dump($tb[0]>getCheItemAttribute()>getAttrValue());
      exit();

      in browser i see:

      string '10' (length=2)

      string '10' (length=2)

      but expected:

      10

      123

      With hydration Array & Scalar hydrated data is ok.

        Activity

        There are no comments yet on this issue.

          People

          • Assignee:
            Jonathan H. Wage
            Reporter:
            Diordienko Mykhail
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated: