Question: i'm trying to past the value of $current\_sku to the end the $title text field input on the form. How can I achieve it? Correctly, it's showing in the text input hints..

```
<?php 
    $objectManager = \Magento\Framework\App\ObjectManager::getInstance();
    $product = $objectManager->get('Magento\Framework\Registry')->registry('current_product');//get current product
?>

<!--get product sku-->      <?php $current_sku = $product->getSku(); ?>             
<div class="field required">
                    <label class="label" for="amfaq-title">
                        <?= $block->escapeHtml(__('Your question:')); ?>
                    </label>
                    <div class="control">
                        <textarea name="title"
                                  id="amfaq-title"
                                  title="<?= $block->escapeHtml(__('Question')); ?>"
                                  class="required-entry input-text"
                                  cols="5"
                                  rows="3"
                                  data-bind="value: title"
                                  placeholder="<?= $block->escapeHtml(__('Type your question here ...')) .'('. $current_sku .')' ;?>"></textarea>
                    </div>
                </div>

```

[![enter image description here](https://i.stack.imgur.com/N3fiP.png)](https://i.stack.imgur.com/N3fiP.png)

Answer: 
We should use Service Contracts Layer:

```
class OrderCollectData
{
    /**
     * @var \Magento\Sales\Api\OrderRepositoryInterface
     */
    protected $orderRepository;
    /**
     * @var \Magento\Framework\Api\SearchCriteriaBuilder
     */
    protected $searchCriteriaBuilder;

    /**
     * @param \Magento\Sales\Api\OrderRepositoryInterface $orderRepository
     * @param \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder
     */
    public function __construct(
        \Magento\Sales\Api\OrderRepositoryInterface $orderRepository,
        \Magento\Framework\Api\SearchCriteriaBuilder $searchCriteriaBuilder
    ) {
        $this->orderRepository = $orderRepository;
        $this->searchCriteriaBuilder = $searchCriteriaBuilder;
    }

    public function execute()
    {
        $searchCriteria = $this->searchCriteriaBuilder
        ->addFilter(
           'status'
           'processing'
           'eq'
        )
        ->addFilter(
           'status'
           'pending'
           'eq'
        )->create();

        $orders = $this->orderRepository->getList($searchCriteria);
        foreach ($orders->getItems() as $order) {
               //Your code
        };

    }
}

```
Something like this should work

```php
public function __construct(
    \Magento\Sales\Model\ResourceModel\Order\CollectionFactory $orderCollectionFactory,
) {
    $this->orderCollectionFactory = $orderCollectionFactory;
}

public function getOrderCollection($status)
{
    $orderCollection = $this->orderCollectionFactory
        ->create()
        ->addAttributeToSelect('*')
        ->addAttributeToFilter('status', ['eq'=> $status]);

    return $orderCollection;
}

```

So you would call

```
$this->getOrderCollection('processing')
$this->getOrderCollection('pending')

```