private function setName() { $Where = isset($this->Post) ? "post_id != {$this->Post} AND " : ""; $WsPosts = new WsPosts(); $WsPosts->setPost_title($this->Data['post_title']); $WsPosts->Execute()->Query("{$Where}#post_title#"); if ($WsPosts->Execute()->getResult()) { $this->Data['post_name'] = $this->Data['post_name'] . '-' . $WsPosts->Execute()->getRowCount(); } }