Exemplo n.º 1
0
 /**
  * 2015-10-10
  * @param string $name
  * @param string $label
  * @return void
  */
 protected final function attribute($name, $label)
 {
     /** @var int $ordering */
     static $ordering = 1000;
     df_eav_setup()->addAttribute('customer', $name, ['type' => 'static', 'label' => "{$this->labelPrefix()} {$label}", 'input' => 'text', 'sort_order' => $ordering, 'position' => $ordering++, 'visible' => false, 'system' => false, 'required' => false]);
     /** @var int $attributeId */
     $attributeId = df_first(df_fetch_col('eav_attribute', 'attribute_id', 'attribute_code', $name));
     df_conn()->insert(df_table('customer_form_attribute'), ['form_code' => 'adminhtml_customer', 'attribute_id' => $attributeId]);
 }
Exemplo n.º 2
0
Arquivo: db.php Projeto: mage2pro/core
/**
 * 2015-04-13
 * @used-by df_fetch_col_int_unique()
 * @used-by Df_Catalog_Model_Processor_DeleteOrphanCategoryAttributesData::_process()
 * @used-by Df_Logging_Model_Resource_Event::getEventChangeIds()
 * @used-by Df_Tax_Setup_3_0_0::customerClassId()
 * @used-by Df_Tax_Setup_3_0_0::deleteDemoRules()
 * @used-by Df_Tax_Setup_3_0_0::taxClassIds()
 * @param string $table
 * @param string $cSelect
 * @param string|null $cCompare [optional]
 * @param int|string|int[]|string[]|null $values [optional]
 * @param bool $distinct [optional]
 * @return int[]|string[]
 */
function df_fetch_col_int($table, $cSelect, $cCompare = null, $values = null, $distinct = false)
{
    /** намеренно не используем @see df_int() ради ускорения */
    return df_int_simple(df_fetch_col($table, $cSelect, $cCompare, $values, $distinct));
}