36], [['nombre'], 'string', 'max' => 100], [['idSagarhpa'], 'integer'], [['id'], 'unique'], [['idPadre'], 'exist', 'skipOnError' => true, 'targetClass' => Producto::class, 'targetAttribute' => ['idPadre' => 'id']], ]; } /** * {@inheritdoc} */ public function attributeLabels() { return [ 'id' => 'ID', 'nombre' => 'Nombre', 'idPadre' => 'Id Padre', 'creado' => 'Creado', 'idSagarhpa' => 'idSagarhpa', 'modificado' => 'Modificado', 'eliminado' => 'Eliminado', ]; } /** * Gets query for [[IdPadre]]. * * @return \yii\db\ActiveQuery */ public function getIdPadre() { return $this->hasOne(Producto::class, ['id' => 'idPadre']); } /** * Gets query for [[Productos]]. * * @return \yii\db\ActiveQuery */ public function getProductos() { return $this->hasMany(Producto::class, ['idPadre' => 'id']); } }