Attribute.php 834 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. /**
  3. * Copyright © Magento, Inc. All rights reserved.
  4. * See COPYING.txt for license details.
  5. */
  6. /**
  7. * EAV Form Attribute Resource Model
  8. *
  9. * @author Magento Core Team <core@magentocommerce.com>
  10. */
  11. namespace Magento\Eav\Model\ResourceModel\Form;
  12. abstract class Attribute extends \Magento\Framework\Model\ResourceModel\Db\AbstractDb
  13. {
  14. /**
  15. * Return form attribute IDs by form code
  16. *
  17. * @param string $formCode
  18. * @return array
  19. */
  20. public function getFormAttributeIds($formCode)
  21. {
  22. $bind = ['form_code' => $formCode];
  23. $select = $this->getConnection()->select()->from(
  24. $this->getMainTable(),
  25. 'attribute_id'
  26. )->where(
  27. 'form_code = :form_code'
  28. );
  29. return $this->getConnection()->fetchCol($select, $bind);
  30. }
  31. }