Answer the question
In order to leave comments, you need to log in
How to check if a value exists in the database (zend 2)?
Essence: you need to check for the presence in the database of news with the entered URL.
At the moment the solution is something like:
public function checkUrl($url) {
if ($this->getNewsTable()->getItemByURL($url)) {
return true;
} else {
return false;
}
}
Answer the question
In order to leave comments, you need to log in
Give an example of the code that worked for you, there should be no problems with RecordExists.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question