FOF30\Controller\DataController::getIDsFromRequest PHP Метод

getIDsFromRequest() публичный Метод

Gets the list of IDs from the request data
public getIDsFromRequest ( DataModel &$model, boolean $loadRecord = true ) : array
$model FOF30\Model\DataModel The model where the record will be loaded
$loadRecord boolean When true, the record matching the *first* ID found will be loaded into $model
Результат array
    public function getIDsFromRequest(DataModel &$model, $loadRecord = true)
    {
        // Get the ID or list of IDs from the request or the configuration
        $cid = $this->input->get('cid', array(), 'array');
        $id = $this->input->getInt('id', 0);
        $kid = $this->input->getInt($model->getIdFieldName(), 0);
        $ids = array();
        if (is_array($cid) && !empty($cid)) {
            $ids = $cid;
        } else {
            if (empty($id)) {
                if (!empty($kid)) {
                    $ids = array($kid);
                }
            } else {
                $ids = array($id);
            }
        }
        if ($loadRecord && !empty($ids)) {
            $id = reset($ids);
            $model->find(array('id' => $id));
        }
        return $ids;
    }