src/Slashworks/BackendBundle/Model/om/BaseUserQuery.php
public function filterByLastname($lastname = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($lastname)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $lastname)) {
                $lastname = str_replace('*', '%', $lastname);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(UserPeer::LASTNAME, $lastname, $comparison);
    }
public function filterByLastname($lastname = null, $comparison = null)
    {
        if (null === $comparison) {
            if (is_array($lastname)) {
                $comparison = Criteria::IN;
            } elseif (preg_match('/[\%\*]/', $lastname)) {
                $lastname = str_replace('*', '%', $lastname);
                $comparison = Criteria::LIKE;
            }
        }

        return $this->addUsingAlias(UserPeer::LASTNAME, $lastname, $comparison);
    }
public function filterByLastname ( $ lastname = null , $ comparison = null ) { if ( null === $ comparison ) { if ( is_array ( $ lastname ) ) { $ comparison = Criteria :: IN ; } elseif ( preg_match ( '/[\%\*]/' , $ lastname ) ) { $ lastname = str_replace ( '*' , '%' , $ lastname ) ; $ comparison = Criteria :: LIKE ; } } return $ this -> addUsingAlias ( UserPeer :: LASTNAME , $ lastname , $ comparison ) ; }
Filter the query on the lastname column

Example usage:
<code>
$query->filterByLastname('fooValue');   // WHERE lastname = 'fooValue'
$query->filterByLastname('%fooValue%'); // WHERE lastname LIKE '%fooValue%'
</code>

@param     string $lastname The value to use as filter.
Accepts wildcards (* and % trigger a LIKE)
@param     string $comparison Operator to use for the column comparison, defaults to Criteria::EQUAL

@return UserQuery The current query, for fluid interface
Filter the query on the lastname column