マゼンタの宝石を使おうとしています。ドキュメントは非常に弱いです。呼び出しに成功しましたMagento::Category.info(1)
。
しかし、私は電話をかけることができませんでしたMagento::Category.create(args)
。
メソッドの定義は次のようになります。
# catalog_category.create
# Create new category and return its id.
#
# Return: int
#
# Arguments:
#
# int $parentId - ID of parent category
# array $categoryData - category data ( array(’attribute_code’⇒‘attribute_value’ )
# mixed $storeView - store view ID or code (optional)
def create(attributes)
id = commit("create", attributes)
record = new(attributes)
record.id = id
record
end
これが私が試したものです(親IDは1です)
args = [1, {:name => 'Cars', :description => 'Great Cars', :is_active => '1', :url_key => 'cars'}]
category_id = Magento::Category.create(args)
exception: 1 -> SQLSTATE[21000]: Cardinality violation: 1241 Operand should contain 1 column(s)
誰かがメソッドを呼び出す例を提供できますか?