Pimcore\Model\Tool\Targeting\Rule::getId PHP Method

getId() public method

public getId ( ) : integer
return integer
    public function getId()
    {
        return $this->id;
    }

Usage Example

 public function ruleAddAction()
 {
     $target = new Targeting\Rule();
     $target->setName($this->getParam("name"));
     $target->save();
     $this->_helper->json(["success" => true, "id" => $target->getId()]);
 }